Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Trying to override a tpl file using my_changes add-on Rate Topic   - - - - -

 
  • MEvans
  • Member
  • Members
  • Join Date: 12-Nov 13
  • 20 posts

Posted 06 December 2013 - 07:05 PM #1

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

 

Posted 06 December 2013 - 07:41 PM #2

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.

Jeremy
Requin Creative Group
CS-Cart License | CS-Cart Addons


 
  • MEvans
  • Member
  • Members
  • Join Date: 12-Nov 13
  • 20 posts

Posted 06 December 2013 - 08:08 PM #3

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.


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

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

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.

Thanks

 

Posted 06 December 2013 - 08:47 PM #4

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.

Jeremy
Requin Creative Group
CS-Cart License | CS-Cart Addons


 

Posted 06 December 2013 - 08:52 PM #5

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

Jeremy
Requin Creative Group
CS-Cart License | CS-Cart Addons


 
  • MEvans
  • Member
  • Members
  • Join Date: 12-Nov 13
  • 20 posts

Posted 06 December 2013 - 09:13 PM #6

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?

 

Posted 06 December 2013 - 09:18 PM #7

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.

Jeremy
Requin Creative Group
CS-Cart License | CS-Cart Addons


 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1807 posts

Posted 06 December 2013 - 11:36 PM #8

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.
Hire StellarBytes for CS-Cart Design & Development Services

 
  • MEvans
  • Member
  • Members
  • Join Date: 12-Nov 13
  • 20 posts

Posted 09 December 2013 - 05:46 PM #9

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

 
  • Hungryweb
  • Senior Member
  • Authorized Reseller
  • Join Date: 10-Feb 12
  • 1249 posts

Posted 09 December 2013 - 06:51 PM #10

Are 2 types of overrides:
  • 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
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
part of hungryweb.net

 

Posted 13 March 2014 - 04:09 PM #11

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

Jeremy
Requin Creative Group
CS-Cart License | CS-Cart Addons