I’m new to cs-cart or the smarty concept to be exact, I have made changes to cs-cart and saved them to my changes addon, but the problem is how to create hooks in order to view the changes moreover the concept of hooking addon I do not understand.
Please if there is resources you can provide me, share it with me.
Okay, first of all, I want to tell you what I did:
My objective is not to change the core files so I added my changes to a folder called my_changes addon.
The second thing I want to do is:
Is to create a hook for the my_changes addon in order to display those changes to the view
The third thing let’s say I managed to create a hook, what is the next step? do I need to install my hook? do I need to use some pre-build addon to add my hook? I have read about Hook and API, Zapier but I don’t have them in my admin panel, I searched for them. my cs-cart version is 4.16
If you have a directory design/backend/templates/addons/my_changes (for changes in admin panel), you should create there directory ‘hooks’, then directory with the name as the first part of the hook you want to plug into.
For example, if hook is “products:update_product_name” then you should create a folder ‘products’.
Then, you should create a file with the name of the second part of the hook. So in above example, it should be update_product_name.post.tpl. Code you put into this file will appear under the hook in the source file.