Magento检索免费送货价值的“最低订单金额”

时间:2010-02-10 14:38:19

标签: php magento shipping

我想在'CartController.php'类中检索免费送货的'最低订单金额'值。

我怎样才能获得这个价值? Mage::getStoreConfig()会完成这项工作吗?但是哪条路?

2 个答案:

答案 0 :(得分:4)

不含增值税:

function getRemainingAmount() 
{
      $symbol  = Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol();
      $total   = Mage::getSingleton('checkout/cart')->getQuote()->getSubtotal();    
      $minimum = Mage::getStoreConfig("carriers/freeshipping/free_shipping_subtotal");

      $value = $minimum - $total;

      if ($value < 0) {
           return false;    
      } else {   
           return number_format($value, 2) . $symbol;
      }
}

答案 1 :(得分:2)

值存储在core_config_data表中,搜索WHERE path like '%minimum%'应该会产生足够少的行,以便您找到哪一行。或者,管理区域中输入字段的“名称”将是_s代替/ s的路径。

相关问题