2012-10-25 121 views

回答

0

複製到您的本地存儲模板/app/design/frontend/base/default/template/checkout/cart/crosssell.phtml

<?php if($this->getItemCount()): ?> 
    <div class="crosssell"> 
     ......... 

     <?php foreach ($this->getItems() as $_item): ?> 
     <?php if ($_item->getTypeId() == 'grouped') 
     { 
      $associatedProducts = $_item->getTypeInstance(true)->getAssociatedProducts($_item); 

      <?php foreach ($associatedProducts as $ap): ?> 
        //display associated group products here 
        <li class="item"> 
          ...... 
         copy existing html structure and replace $_item with $ap 
         <?php echo $this->htmlEscape($ap->getName()) ?> 
        </li> 
       <?php ?> 
      <?php } 
       else 
       { ?> 
       <li class="item"> 
        ...... 
        // copy existing code here 
       </li> 
      <?php } ?> 

     <?php endforeach; ?> 

     ................. 

Magento - how do I get associated products of product Group?

+0

看起來沒錯。謝謝 – Heraldmonkey