【问题标题】:magento disable flatrate shipping methodmagento 禁用统一运费方式
【发布时间】:2013-10-22 04:04:06
【问题描述】:

我们希望购物车总价 90 美元及以上免运费:如果在应用折扣后购物车总价值低于 90 美元,则免运费不适用,应适用 7.95 美元的统一运费。

我正在为 magento 实现自定义 API,这反映了页面在 magento 用户帐户中刷新后。但 API(mycart.php) 显示的是旧结果(显示 'flatrate' 而不是 'free_shipping' 高于 $90 )

我正在应用购物车级别的运费。

我的示例代码:

$quote = $this->_getQuote($cart_id, $store);

        try {
            if($sub_total >= 90){               
                $shipping_code = "freeshipping_freeshipping";               
                //$quote->getShippingAddress()->setFreeShipping(1);
                //$quote->save();
            }
            else {
                $shipping_code = "flatrate_flatrate";               
            }   

            if ($quote->getShippingAddress()->getCountryId() == '') {               
                $quote->getShippingAddress()->setCountryId($this->_country);
            }                   

            $address = $quote->getShippingAddress();

            $address->setShippingMethod($shipping_code)->setCollectShippingRates(true);
            $address->save();

【问题讨论】:

    标签: magento


    【解决方案1】:
    Disable To set up flat rate shipping navigate to 
    System -> Configuration and click on Shipping Methods 
    in the left column. 
    

    【讨论】:

      【解决方案2】:

      我已经使用以下 sn-ps 解决了这个问题:

      $quote->collectTotals();    
      $quote->save(); 
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-11-29
        • 1970-01-01
        • 2015-01-18
        • 1970-01-01
        • 1970-01-01
        • 2019-05-31
        • 2013-05-03
        • 1970-01-01
        相关资源
        最近更新 更多