Magento CE - 强制用户购买至少2件商品,查看

时间:2015-12-16 15:54:33

标签: magento-1.7

是否有OOB方式强制用户从一部分简单产品中购买2个或更多产品?

例如,如果用户购买衬衫X,他还必须购买任何一条裤子。我们有超过100多件衬衫和裤子,因此将这些作为“捆绑”产品提供是不可行的。

1 个答案:

答案 0 :(得分:0)

有很多方法,我知道的是:你可以去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