【发布时间】:2012-06-20 11:52:18
【问题描述】:
我在 magento 中创建了一个商店。我想在产品描述页面中增加追加销售产品的数量。目前它在前面显示 4 个产品,点击下一个链接后显示其他产品。 我想把它改成5。
【问题讨论】:
标签: magento magento-1.6
我在 magento 中创建了一个商店。我想在产品描述页面中增加追加销售产品的数量。目前它在前面显示 4 个产品,点击下一个链接后显示其他产品。 我想把它改成5。
【问题讨论】:
标签: magento magento-1.6
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。
【讨论】:
我认为这可能对至少使用更新版本的 magento (EE) 的人有用。
您可以制作更新脚本,这至少在企业版(1.14)中有效:
$scope = '0';
$installer->setConfigData('catalog/enterprise_targetrule/upsell_position_limit', '5', 'default', $scope);
【讨论】: