Advertisement
moggiex

Yes/No Attribute show custom static block in Magento

May 13th, 2015
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.87 KB | None | 0 0
  1. <?php
  2.  
  3.             // Extra code for showing is a pallet delivered product
  4.  
  5.                 $att_is_pallet = $_product->getResource()->getAttribute('att_is_pallet')->getFrontend()->getValue($_product);
  6.  
  7.                 if( isset( $att_is_pallet ) && !empty( $att_is_pallet ) && $att_is_pallet == "Yes" ) {
  8.  
  9.                     // New header block
  10.                     $theBlock = 'block_pallet';
  11.                     if(Mage::getModel('cms/block')->load($theBlock)->getIsActive() && $tempHTML = Mage::getModel('cms/block')->load($theBlock)->getContent() ) {
  12.                         echo '<div class="is-pallet">';
  13.                         echo Mage::getSingleton('widget/template_filter')->filter($tempHTML);
  14.                         echo '</div>';
  15.                     }
  16.  
  17.                 }
  18.  
  19.             // /Extra code for showing is a pallet delivered product
  20.  
  21.             ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement