【问题标题】:How to set minimum quantity in magento cart?如何在magento购物车中设置最小数量?
【发布时间】:2012-08-22 18:08:25
【问题描述】:

我想在我的 magento 网站中设置最低数量...

Magento 配置允许我设置每个产品的最小数量.. 但我想设置每个订单的最小数量..

我的意思是我的客户可以 将他/她想要的任何产品混合到最低数量..

PS:我找到了a thread in magento forums,它解释了如何设置最小订单量。谁能帮我修改此代码以获取最小数量?谢谢

【问题讨论】:

  • 我们需要规则来做到这一点,如果客户没有得到最小数量会发生什么??如果没有得到最小数量,您可以简单地隐藏购买按钮:?
  • @Guerra 我只是不知道如何实现它。你能为我指出正确的方向吗?谢谢

标签: magento


【解决方案1】:

有很多方法可以做到这一点,您可以转到app\design\frontend\yourstore\2012\template\checkout\onepage\link.phtml 或您正在使用的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?>

这解决了你的问题。

【讨论】:

  • 非常感谢兄弟。真的它的工作......投票给你的答案.. :)
  • 这在 Magento v1.9.1.1 中仍然有效,以防有人仍然需要这样做。您可能还想将其添加到您的迷你购物车中:template/checkout/cart/minicart/items.phtml
猜你喜欢
  • 2012-12-28
  • 2014-10-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-05-22
相关资源
最近更新 更多