magento的最低订单金额

时间:2015-01-01 04:31:29

标签: php magento

有没有办法在magento中获得最低订单金额代​​码, 我想将它添加到我的主页的自定义字段中,请用此链接我

谢谢

2 个答案:

答案 0 :(得分:2)

首先,您需要在系统>中设置最小订单金额配置>销售>最低订单金额。默认情况下,当折扣后的小计小于最小金额时,邮件将显示在购物车中。

您可以在Mage_Checkout_CartController

中查看他们是如何做到这一点的
    $minimumAmount = Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())
        ->toCurrency(Mage::getStoreConfig('sales/minimum_order/amount'));

    $warning = Mage::getStoreConfig('sales/minimum_order/description')
        ? Mage::getStoreConfig('sales/minimum_order/description')
        : Mage::helper('checkout')->__('Minimum order amount is %s', $minimumAmount);

    $cart->getCheckoutSession()->addNotice($warning);

答案 1 :(得分:1)

你可以使用getStoreconfig

$amount = Mage::getStoreConfig('sales/minimum_order/amount', $storeId);
如果您有多个商店,请

传递$storeId

希望这对您有所帮助。

相关问题