Trying to override a tpl file using my_changes add-on

I’m trying to override a template file and would like some help with doing so in the my changes add-on.



I want to override the ‘default_long_options_template.tpl’ file



I created a ‘default_long_options_template.override.tpl’ file and placed it in the following path(s):



basic/templates/addons/my_changes/hooks/

basic/templates/addons/my_changes/hooks/product_templates/

basic/templates/addons/my_changes/hooks/blocks/product_templates/

basic/templates/addons/my_changes/blocks/product_templates/

basic/templates/addons/my_changes/product_templates/



Nothing has seemed to work. What am I missing?



Thanks

Never seen an entire template be subjected to an override.



You can override view_main_info as follows:



customer/addons/my_changes/hooks/products/view_main_info.override.tpl



[size=4]Assuming that “My Changes” is active and you have cleared your cache it should work.[/size]

[quote name='requincreative' timestamp='1386358918' post='173089']

Never seen an entire template be subjected to an override.



You can override view_main_info as follows:



customer/addons/my_changes/hooks/products/view_main_info.override.tpl



Assuming that “My Changes” is active and you have cleared your cache it should work.

[/quote]



Yes, I have since discovered that i can just change the view_main_info hook. This is what I've done:



[color=#282828][font=arial, verdana, tahoma, sans-serif]basic/templates/addons/my_changes/hooks/products/view_main_info.override.tpl[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]Notice I have 'basic/template/…" You have 'customer/addons/…" Where is 'customer' ? I know its seems like a basic question but I don't see where that is. [/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]Thanks[/font][/color]

You are using CS-Cart version 4 then? There is no customer directory in version 4.



Assuming that you have the My Changes addon set to Active, you will need to clear your cache in version 4 by appending ?ctpl&cc to the admin.php URI.

My Changes is not set to “Active” by default in CS-Cart Version 4, s double check that and then clear your cache as noted above.





design/themes/basic/templates/addons/my_changes/hooks/products/view_main_info.override.tpl

Thanks. But everything has been done accordingly to instructions. I've clear the cache an also have rebuild cache automatically turned on but its still not working correctly.



Any other common issues or thoughts as to what I'm not doing?

Nope if you are using the default template “basic” and you have My Changes set to active and cache cleared it should work.



I will say that refreshing the same product page over and again is not re-generating the cache. Navigate to another product to confirm.

The path is correct, but what code are you using in the override file? It may sound stupid, but does the code differ from the default code within the {hook…} {/hook} tags in default_long_options_template.tpl?



If 'my_changes' is set to Active…backup your my_changes files/folders, uninstall, clear cache, then reinstall the addon and set it to 'Active' again, clear the cache again. If still no different, manually delete the contents of /var/cache/ via FTP and try again. Also, try press F5 on your keyboard to force your browser to re-cache the page.

Thank you Jeremy and StellarBytes. I manually cleared the cache and now I can see the changes.

Are 2 types of overrides:[list=1]

[]override hook addons/my_changes/hooks/products/view_main_info.override.tpl

[
]override file addons/my_changes/overrides/blocks/product_templates/default_long_options_template.tpl

[/list]

As far i can see you wist to create a custom product details page and this ca be easy done by adding addons/my_changes/blocks/product_templates/new_default_long_options_template.tpl with your custom code and just selected from the Settings > Appearance [Product detailed page layout]



*the path depend of your cs-cart version but the idea is the same



I hope that helps,





Valentin

[color=#808080][size=2]part of hungryweb.net[/size][/color]

Just wanted to confirm that Valentin's proposed method for overriding files still works with CS-Cart 4.1+