Jump to content

Need help with Module for changing Add Category and Update Category page


slymatt

Recommended Posts

Hello,

 

So my issue is im trying to create a module that attaches to the hooks:

 

actionCategoryAdd

actionCategoryUpdate

 

But when i use 

public function hookActionCategoryAdd($params)
{
   return $this->display(__FILE__, 'views/templates/hook/newfieldstut.tpl');
	
}   

Nothing shows up am i doing something wrong?

 

Cheers in advance

Link to comment
Share on other sites

Well first what you are trying to accomplish with module ?

 

Second those hooks have action in their names so they used when you want to change some 

data on category add or update. They do not display anything. You need to use display hooks 

if you want some code from  tpl file to appear.

 

Also you consider creating custom hook for your module.

Link to comment
Share on other sites

Yes it is overriding.

 

If you want to add field to category admin page, you need to override

correct admin tpl file and maybe AdminCategory Controller.

 

Sorry you said all code you want within the module. But module can override 

files on install.

 

But to get to your first post, maybe action hooks are 

good to use in your case just use them to save data not 

displaying form.

Link to comment
Share on other sites

if i override this could cause issues for other modules that may be installed couldnt it, and i cant just use an action hook as you said because i need to display the field first to get the input.

 

I dont want to cause issues with other modules 

Link to comment
Share on other sites

Yeah I understand, and it is recommended to not use overrides if possible.

 

Ok let me ask for more info.

 

Where you want to show that input , back office or front office, can you display it in modules page?

Could you maybe create new table that will save input and id of category ?

Link to comment
Share on other sites

Ive added an image where i wanted the new field its in the backend Where you add a new category, also update the category aswell.

 

I could add it to the config page and loop through each category but that would be a ton more work that i was hoping wouldn't be needed

 

Hope this clears a few more things up.

post-721078-0-62595800-1447434854_thumb.png

Edited by slymatt (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...