Magento CE - 强制用户购买至少 2 种产品进行结账
Magento CE - Force user to buy at least 2 products to check out
是否有一种 OOB 方法可以强制用户从简单产品的子集中购买 2 种或更多产品?
例如,如果用户购买了衬衫 X,则他还必须购买任何一条裤子。我们有 100 多件衬衫和裤子,因此将它们作为 "bundled" 产品提供是不可行的。
有很多方法,我知道的一种是:你可以去app\design\frontend\yourtheme\template\checkout\onepage\link.phtml
。
<?php if ($this->isPossibleOnepageCheckout()):?>
<?php if(Mage::helper('checkout/cart')->getCart()->getItemsQty() >= $minimunQuantityYouWant):?>//this code is ours
<button type="button" title="<?php echo $this->__('Proceed to Checkout') ?>" class="button btn-proceed-checkout btn-checkout<?php if ($this->isDisabled()):?> no-checkout<?php endif; ?>"<?php if ($this->isDisabled()):?> disabled="disabled"<?php endif; ?> onclick="window.location='<?php echo $this->getCheckoutUrl() ?>';"><span><span><?php echo $this->__('Proceed to Checkout') ?></span></span></button>
<?php else:?>//this code is ours
Type msg here, like "You need minimum x items to finish."//this code is ours
<?php endif;?>//this code is ours
<?php endif?>
还有一个扩展,我没测试过:)
https://www.magentocommerce.com/magento-connect/minimum-order-quantity.html
是否有一种 OOB 方法可以强制用户从简单产品的子集中购买 2 种或更多产品?
例如,如果用户购买了衬衫 X,则他还必须购买任何一条裤子。我们有 100 多件衬衫和裤子,因此将它们作为 "bundled" 产品提供是不可行的。
有很多方法,我知道的一种是:你可以去app\design\frontend\yourtheme\template\checkout\onepage\link.phtml
。
<?php if ($this->isPossibleOnepageCheckout()):?>
<?php if(Mage::helper('checkout/cart')->getCart()->getItemsQty() >= $minimunQuantityYouWant):?>//this code is ours
<button type="button" title="<?php echo $this->__('Proceed to Checkout') ?>" class="button btn-proceed-checkout btn-checkout<?php if ($this->isDisabled()):?> no-checkout<?php endif; ?>"<?php if ($this->isDisabled()):?> disabled="disabled"<?php endif; ?> onclick="window.location='<?php echo $this->getCheckoutUrl() ?>';"><span><span><?php echo $this->__('Proceed to Checkout') ?></span></span></button>
<?php else:?>//this code is ours
Type msg here, like "You need minimum x items to finish."//this code is ours
<?php endif;?>//this code is ours
<?php endif?>
还有一个扩展,我没测试过:) https://www.magentocommerce.com/magento-connect/minimum-order-quantity.html