I recently created a custom variable named storecount
– which I'll be programatically increasing for every store that is added to my store locator plugin.
I'd like to show this in various locations including product and category descriptions so when we do add a new store, we're not having to find every occurrence of the store count and manually increase it by 1.
Using {{customVar code=storecount}}
doesn't work in category descriptions. Is there any way I can get this variable without hacking the Magento core to pieces?
Best Answer
The easiest way to do it, is to use the same template processor for category description as it is used for the cms blocks and pages content. The one from the widget module.
For this you need an extension. Let's call it
StackExchange_Catalog
.You will need the following files.
app/etc/modules/StackExchange_Catalog.xml
- the declaration fileapp/code/local/StackExchange/Catalog/etc/config.xml
- the configuration fileclear the cache and try again.