Using My_Changes To Override My_Account.tpl

I read several documents and forum topics about template override and using my_changes to control the custom version, however I confess that I am a bit confused about how the folder structure shoud be.

By example, I am trying to override the my_account.tpl that is path:

design/themes/[theme_name]/templates/blocks/my_account.tpl

I tried to overriding creating the following structure:

design/theme/[theme_name]/addons/my_changes/templates/blocks/my_account.tpl

But seems that is not working. I copied the original file and made changes in file inside the folder on my_changes and the changes doesnt seems to be working in this case. The folder structure is correct or I am missing something?

Hello,

If you want to override a template, you have to include a directory "overrides" in your add-on structure.

For your example. for file:

design/themes/[theme_name]/templates/blocks/my_account.tpl

The path to overriding file should go like that:

design/themes/[theme_name]/templates/addons/my_changes/overrides/blocks/my_account.tpl

Remember to clean cache after you make a change.

Also, make sure that my_changes add-on is active - by default, it is disabled.

Best regards,

Team CS-Cart Poland

Hi!

Thanks! Now it is working. Is necessary to use the override folder in all cases?

I read some topics (maybe outdated) where is said to add the word "override" not as a folder, but as in the own filename.

Hello

If you want to override a hook in a tpl file then you use "override" in filename. For example, if the hook's name is "orders:shipping_info" and you want to overwrite it, in the orders directory you create the shipping_info.override.tpl file and write your code with it.

Best regards

Robert

Please find useful information about overrides here

https://docs.cs-cart.com/latest/developer_guide/addons/hooking/tpl_hooks.html