Simple way to to Increase the Number of Cross-sell Items in cart from 4 to 12?
-
04-10-2020 - |
質問
I can't believe that Magento just decides for everyone that they should ONLY have 4 cross-sell items and that's it! I have 12 and I want all 12 of them to appear hopefully without the need to re-write half of the Magento code!
I found this:
How to Increase the Number of Crosssell Items in Cart?
but the article seems to be written for an older version of Magento. I have Magento 1.9.1
Is there really no simple way to do this?
解決
You have to copy this file in local folder with same directory structure:
app/code/core/Mage/Checkout/Block/Cart/Crosssell.php
To
app/code/local/Mage/Checkout/Block/Cart/Crosssell.php
And change the max limit $_maxItemCount
of cross sell as you want
class Mage_Checkout_Block_Cart_Crosssell extends Mage_Catalog_Block_Product_Abstract
{
/**
* Items quantity will be capped to this value
*
* @var int
*/
protected $_maxItemCount = 4;
所属していません magento.stackexchange