开发者

Magento view related products in list.phtml

开发者 https://www.devze.com 2023-03-30 14:32 出处:网络
I have the following requirement; I want to show a products configured related productson the category listing page (list.phtml).

I have the following requirement;

I want to show a products configured related products on the category listing page (list.phtml). I figured I could make some call on the list.phtml inbetween the for each loop for each product using the [b]$_product[/b] variable but I can't seem to populate the relatedProductCollection sorry new to all this is it even possible.

<?php foreach ($_productCollection as[b] $_product[/b]):?>
    <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?>last<?php endif; ?>" >
        <div class="product-s开发者_StackOverflow社区hop">
            <div class="f-fix">


                     <?php  $product->getRelatedProductCollection(); ?>


    </li>
<?php endforeach; ?>


$product has been used to call the getRelatedProductCollection function.

but,

In that foreach loop you have taken it as $_product.

Can you see the difference ??

Underscore is missing. This is taken from your code. Make the variable same in both the places and try.

0

精彩评论

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