【问题标题】:Cross-sell all simple products from a group product together. Possible?交叉销售一组产品中的所有简单产品。可能的?
【发布时间】:2023-03-26 14:30:01
【问题描述】:

我有一个产品的多个版本,我将它们组合成一个分组产品。当我交叉销售它们时,我希望所有简单产品都是可点击的(而不是默认情况下,Magento 选择其中一种简单产品)。基本上是这样的:

【问题讨论】:

  • 您在 Magento Enterprise 上吗? TargetRule 模块可能会有所帮助...

标签: magento magento-1.7


【解决方案1】:

复制到本地商店模板/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?

【讨论】:

    猜你喜欢
    • 2016-06-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多