Magento:使用各种购物车价格规则修改免费送货方式标签

时间:2016-02-02 22:53:06

标签: php magento


我需要在我的Magento目录中设置三个购物车价格规则的免费送货,我需要在每个方案中使用“免费送货”标签。我知道如何通过编辑标题和方法名称字段来修改所有全球免费送货实例的标签,通过配置/运输方式/免费送货,但我想根据适用的购物车价格规则控制标题和方法名称。

例:
购物车规则1返回“标题1,方法名称1,$ 0.00”
购物车规则2返回“标题2,方法名称2,$ 0.00”
购物车规则3返回“标题3,方法名称3,$ 0.00”

1 个答案:

答案 0 :(得分:0)

use following custom script

$quote=Mage::getSingleton('checkout/session')->getQuote();
 $data=$quote->getShippingAddress()->getAllShippingRates();
  foreach($data as $_rate){
   if($_rate->getCode()=='freeshipping_freeshipping'){

     $_rate->setCarrierTitle('new carrier name'); /* new carrier title here */
     $_rate->setMethodTitle('new method title');/* new method title here */
     $_rate->save();

    }
  }