【问题标题】:How to increase the number of upsell products in magento?如何增加magento中追加销售产品的数量?
【发布时间】:2012-06-20 11:52:18
【问题描述】:

我在 magento 中创建了一个商店。我想在产品描述页面中增加追加销售产品的数量。目前它在前面显示 4 个产品,点击下一个链接后显示其他产品。 我想把它改成5。

【问题讨论】:

    标签: magento magento-1.6


    【解决方案1】:

    catalog.xml 中的一些布局更新 XML 在布局中调用加售块,并且此 catalog/product_list_upsell(又名 Mage_Catalog_Block_Product_List_Upsell 块实例)施加/评估限制。

    <catalog_product_view translate="label">
        <!-- snip -->
        <reference name="content">
            <!-- snip -->
            <block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="catalog/product/list/upsell.phtml">
                <action method="setColumnCount"><columns>4</columns></action>
                <action method="setItemLimit"><type>upsell</type><limit>4</limit></action>
            </block>
            <!-- snip -->
        </reference>
        <!-- snip -->
    </catalog_product_view>
    

    您可以使用上述信息和您的布局的local.xml(如果您还没有,请创建它)覆盖item_limit 值:

    <catalog_product_view>
        <reference name="product.info.upsell">
            <action method="setItemLimit"><type>upsell</type><limit>5</limit></action>
            <!--
            if you want them all rendered on one line, change the column_count as well:
            <action method="setColumnCount"><columns>5</columns></action>
            -->
        </reference>
    </catalog_product_view>
    

    更多信息,see the Mage_Catalog_Block_Product_List_Upsell class definition

    【讨论】:

    • 这对我不起作用。必须更新管理区域中的号码。所有 XML 更改都被忽略。我错过了什么?
    【解决方案2】:

    我认为这可能对至少使用更新版本的 magento (EE) 的人有用。

    您可以制作更新脚本,这至少在企业版(1.14)中有效:

    $scope = '0';
    $installer->setConfigData('catalog/enterprise_targetrule/upsell_position_limit', '5', 'default', $scope);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-03-19
      • 1970-01-01
      • 2015-05-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多