I am trying to display a static block based on the selection that has been made when adding a product in the magento backend.
So the situation is, I am adding the product and select a option from a dropdown attribute which has been created. The options are:
-Do not show table -Show table 1 -Show table 2 and so on...
Static blocks have been created realated to the dropdown options:
-Static block table 1 -Static block table 2 and so on...
I am using the following code in the phtml file which I want to display it:
<?php if ($_product->getAttributeText('tableselect') == "Table 1"): ?> <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('table_1_block')->toHtml() ?> <?php endif; ?>
Its not working for me, what am i doing wrong here? Please help
Thanks in advance.