Home > Uncategorized > Attribute include based on custom Design – useful tip on attribute.phtml

Attribute include based on custom Design – useful tip on attribute.phtml

This will do a include based on the custom design.

<?php if ($_product->getData('custom_design')): ?>
<?php $_custom_design= $_product->getResource()->getAttribute('custom_design')->getFrontend()->getValue($_product); ?>
<?php if ($_custom_design=="default/your theme name"){
echo $this->getLayout()->createBlock('cms/block')->setBlockId('static block id1')->toHtml()
; }
else {
echo $this->getLayout()->createBlock('cms/block')->setBlockId('static block id2')->toHtml()
; } ?>
<?php endif; ?>

Advertisement
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.