I think its easy but i don't found a way. In the product view.phtml ,I want to show the SKU. But only for simple Products. Is there any Way like this:

<div class="product-sku">
<?php echo $_helper->productAttribute($_product,$_product->getSku()->addAttributeToFilter('type_id', 'simple'), 'sku') ?>

This way don't work.


Try like this,

<?php if($_product->getTypeId() == 'simple'): ?>

<div class="product-sku">
  <h3><?php echo $_product->getSku()?></h3>
<?php endif; ?>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.