开发者

Is it possible to target just Simple Product from phtml template?

开发者 https://www.devze.com 2023-02-06 13:08 出处:网络
I see something like: <?php if(!$_item->isComposite() && $_item->isSaleable()): ?>

I see something like:

     <?php if(!$_item->isComposite() && $_item->isSaleable()): ?>

and this

  <?php if(!$_product->isGrouped())开发者_如何转开发: ?>

But couldn't find a way to target only the Simple Product type in similar manner.


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


As an alternative possibility you could assume a Simple product is on that is no other type.

<?php if (!$_item->isComposite() && !$_item->isSuper() && !$_item->isVirtual()): ?>
    <!-- Simple type only -->
<?php endif; ?>


There is already a template file catalog/product/view/type/simple.phtml that only displays for Simple type products.

If that doesn't show in the right place for you look in layout/catalog.xml for <PRODUCT_TYPE_simple> to see how to make your own Simple-only template file.

0

精彩评论

暂无评论...
验证码 换一张
取 消