开发者

Magento retrieve the 'Minimum order amount' for free shipping value

I would like to retrieve the 'Minimum order amount' value for free shipping in the 'CartController.php' class.

How can I get this value ? Is开发者_Go百科 Mage::getStoreConfig() will do the job ? But which path?


Without VAT:

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;
      }
}


the values are stored in the core_config_data table, and a search WHERE path like '%minimum%' should result in few enough rows for you to spot which one. Alternatively, the 'name' of the input-field in the admin area will be the path with _s in place of /s.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜