0

我有一个客户不小心将产品添加到相关产品部分而不是追加销售部分。我有一个名为 upsell_slider.phtml 的文件,它会输出以下内容:

<?php if(count($this->getItemCollection()->getItems())): ?>
<div class="box-collateral box-up-sell upsell-slider">
    <h2><?php echo $this->__('Fashion Statement') ?></h2>
    <?php  $this->setColumnCount(4); // uncomment this line if you want to have another number of columns. also can be changed in layout ?>
    <?php $this->resetItemsIterator(); ?>
    <?php
        $products_count = 0;
        while($this->getIterableItem()){
            $products_count++;
        }
    ?>
    <div <?php if ($products_count > 1): ?>id="block-upsell-slider"<?php else:?> class="no-slider" <?php endif; ?>>
    <ul class="products-grid carousel-ul" id="upsell-product-table">
    <?php $this->resetItemsIterator(); while ($_item=$this->getIterableItem()) : ?>
        <li class="item grid_3 alpha">
            <a class="product-image" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_item->getName()) ?>"><img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->constrainOnly(TRUE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize(420, null); ?>" <?php echo MAGE::helper('ThemeOptions/Retina')->getRetinaData('upsell', $_item); ?> alt="<?php echo $this->htmlEscape($_item->getName()) ?>" /></a>
            <div class="product-details">
                <h3 class="product-name"><a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->htmlEscape($_item->getName()) ?></a></h3>
            </div>
        </li>
    <?php endwhile; ?>
    </ul>
    </div>
    <?php if ($products_count > 1): ?>
    <div class = 'next'></div>
    <div class = 'prev unselectable'></div>
    <?php endif; ?>
</div>
<script type="text/javascript">
      /* Upsell Block Slider */
      if(jQuery('#block-upsell-slider').length) {
          jQuery('#block-upsell-slider').iosSlider({
           responsiveSlideWidth: true,
           snapToChildren: true,
           desktopClickDrag: true,
           infiniteSlider: true,
           /* navSlideSelector: '.sliderNavi .naviItem', */
           navNextSelector: '.box-up-sell .next',
           navPrevSelector: '.box-up-sell .prev'
         });
     }

     function upsell_set_height(){
        var upsell_height = 0;
        jQuery('#block-upsell-slider li.item').each(function(){
            if(jQuery(this).height() > upsell_height){
                upsell_height = jQuery(this).height();
            }
        })
        jQuery('#block-upsell-slider').css('min-height', upsell_height+2);
    }
    setTimeout(function(){
        upsell_set_height();
    }, 1000);
    jQuery(window).resize(function(){upsell_set_height();});
     /* Upsell Block Slider */
</script> 
<?php endif ?>

而且我一辈子都看不到相关产品,而不是追加销售产品。

4

1 回答 1

0

我有更好的解决方案。您可以通过一个查询将相关产品转换为加售。

UPDATE `catalog_product_link` SET `link_type_id` = 4 WHERE `link_type_id` = 1;

笔记。这将使所有相关产品都转为追加销售。
...并在尝试之前备份表。

于 2013-10-15T13:56:48.637 回答