Template to override : not a Hook

Can I use MyChanges to override a template even if I am not using a hook in the template, but rather want to override the whole thing?

And if so where would I put it? the template I want to override is in: mySkin/customer/views/products/components



How would I name the files (same as original or not)?



thanks in advance.

I don’t know about using the mychanges, but if you cannot find a workaround here’s one option:


  1. Use the “Local Modifications” addon instead of mychanges. I’ve attached my notes file in case they help you. The notes include the download for the addon. I’ve found it more flexible than mychanges since you can have a separate stylesheet as well to keep style changes distinct.


  2. For whatever template you want to replace ENTIRELY, not just a a hook point, you can create a custom hook. For example to modify the file you asked about add an opening hook tag to the top of your file:

    {hook name=“products:components”}



    Then at the end of the document add a closing hook tag.

    {/hook}



    You’ve now essentially made a new hook that encompasses everything between the hook tags (the entire file).



    Next go to your Local Modifications addon folder and create the following:
  3. A products folder
  4. A template file in the new products folder called components.overrride.tpl



    Paste the original files source code into this new file and make your necessary changes. This new file will now completely override the original. If you mess up just delete your override file to go back to normal.



    One more tip, I usually comment just before each of these custom hooks so I can search across my entire site for all the points where a change was made. This helps with upgrading and file comparison. I use the format :


You could obviously use your own comment.

Lastly I'd like to make the suggestion that the CS-Cart developers should add file level hooks to all the templates. That is, every template file should have at least one hook set that wraps the entire file contents, making replacing the entire files easier. This would be very easy for them to incorporate.

Hope the above helps.

Hook_reference_notes.zip