Hi guys,
Only new to CS cart, where can I find out more info on hooks?
I have looked in the KB but can find any good guides?
Hi EZ, digging the doc but I don’t have:
a Local Modifications Add-on available in the admin as an Add-on
or this directory: skins/
Perhaps I’m on a newer version - 2.1.2?
So far all I’ve found on the CS-Site is very basic
[url]CS-Cart Documentation — CS-Cart 4.15.x documentation
Substitute my_changes for local or download the free local addon from my site which has the CSS stuff built in.
When that document was written there was no my_changes addon. Hence I did one called ‘local’ and gave it away. Then (in true form) cs-cart came out with a my_changes addon without any structure to it and no instructions on use.
Got it, thanks. ‘my_changes’ I have. Still can’t figure out what to do… so it’s hack a shack time or go back to my old cart software.
The dearth of doc is a serious concern in light of CSC touting “easy integration” (see below) while offering a CS-Cart Design Integration Service @ $675 a site.
[url]https://www.cs-cart.com/features.html[/url]
Design & Layout
- 100% template driven storefront and admin panel
- [COLOR=“Red”]Easy integration to match current design[/COLOR]
- Fully customizable design & layout
Here is a nice tutorial which will help you to implement a basic CSS based change using the My Changes / Hooks concept.
[url]CS-Cart Documentation — CS-Cart 4.15.x documentation
Start with a basic change, once you get the hang of it & then perform your next upgrade, you will really appreciate the benefits of using the My Changes/hooks method to make skin design changes!
[quote name=‘Struck’]Here is a nice tutorial which will help you to implement a basic CSS based change using the My Changes / Hooks concept.
[url]CS-Cart Documentation — CS-Cart 4.15.x documentation
Start with a basic change, once you get the hang of it & then perform your next upgrade, you will really appreciate the benefits of using the My Changes/hooks method to make skin design changes! ;)[/QUOTE]
Thanks Struck, I’m not to concerned with CSS. Already had that roling with @import. I am trying the method above to see how all this goes. Any advantage? Seems like overhead to be calling a TPL and then a nine directory deep CSS file.
So far I’ve discovered that I need to be clearing the cache for every change? (I now have a bookmark on my toolbar) and that the entire Main.tpl code block below needs to be replaced when creating a hook for main_content - ‘main_content.override.tpl’. I cloned top.tpl and then modified - all my changes were showing up and going fine then poof #header just disappeared. Seems semi-logical now but took forever to figure out at the time.
When creating a hook for main_content
Main.tpl
{hook name="index:main_content"}
{/hook}
main_content.override.tpl (doesn’t work)
My cool stuff
main_content.override.tpl (works)
My cool stuff
Hello Grafis,
Tbirnseth is absolutely the “resident expert” on anything regarding the entire Hooks/My_changes concept!
I am not a coder (I am only a struggling business owner which learns everything based around the concept of survival… )
[QUOTE]Thanks Struck, I’m not to concerned with CSS. Already had that roling with @import. I am trying the method above to see how all this goes. Any advantage? Seems like overhead to be calling a TPL and then a nine directory deep CSS file.[/QUOTE]
So far, I have only utilized hooks/my_changes to handle our skin modifications solely to reduce time during subsequent updates, I will now say this is the only way to go & has made updates for the most part effortless! The 1st 4-5 updates I made were without utilizing My-Changes, and were very time consuming to re-incorporate all of the CSS changes made to the skin design. The last update (after incorporating our skin mods into the My_Changes) was a treat, done in no time without any issue!
As far as additional overhead in using my_changes for the extra CSS file being called, I wondered about that as well, although there was no noticeable difference in page load times, so no problems on our end.
Also, you mention the need to clear the CS-Cart cache after basically every change, typically that is true, however, since you are running on 2.1.2, you can switch to “Development Mode” at the bottom of your admin page which should temporarily disable the cache while making changes, then switch back to “Live Mode” when finished.
Thanks for the Developer mode note Struck!
And it now appears… my entire post above is incorrect as I now have two header DIVs. Weird stuff.
When you first create a hook you will need to clear your cache so the page will see the new hook file.
Once that’s done, all changes to the code in the hook will be there since the hook file is read real-time and the content is not cached. So it’s the file name that’s cached, not the content.
Hooks work “marvelous darling” as long as you play by the rules. Sometime finding all the obscure rules requires digging into the template class but it’s pretty straightforward.
The major “gotcha” to watch out for is the override type. It behaves differently than pre or post in that the last addon loaded (highest priority) wins. All lesser priority addon hooks are also overwritten as well as the original code. Personally, I think this is a bug but I got the infamous “working as designed” (or more likely if we change it to work properly it might break something).