Magento – How to use custom variables in Product descriptions

customproductvariables

Many products need to have the same or partly the same description, in order to be able to edit them all at once it would come in handy to make use of the magento custom variables. They work in CMS blocks but I was not able to make them show their contend in product descriptions.
Is there a way to achieve this without reinventing the wheel?

Best Answer

If i understood your question right. First of all create one custom variable called "panel-width" fill all the details in variable.

Now you've to call this variable in product view page ..catalog/product/view.phtml and call below code wherever you want to implement.

<!-- get custom variables -->
<?php $panelWidth = Mage::getModel('core/variable')->loadByCode('panel-width')->getValue('plain'); ?>

Here $panel-widht is vaiable code. Simple use variable $panelWidth to display your content. Use this example with your custom variable values and need.

Related Topic