2013-05-20 125 views
3

同時節約順序編程,我傳遞表(tablerate_bestway),但它給錯誤如何在Magento訂單保存中保存tablerate_bestway送貨方式?

'Please specify a shipping method.' 

我的代碼,以節省運輸方法

$shippingAddress->setCollectShippingRates(true) 
        ->setShouldIgnoreValidation(true) 
        ->setShippingMethod("tablerate_bestway") 
        ->collectShippingRates(); 

然而,如果我通過flatrate_flatrate,它的工作原理。如何保存tablerate_bestway?

在管理中啓用了flat_rate和tablerate_bestway。

回答

4

溶液樣品是:

$shippingAddress->removeAllShippingRates() 
      ->setCollectShippingRates(true) 
      ->setShippingMethod('tablerate_bestway') 
      ->setShippingDescription('Table Rate - Best Way'); 

添加運費說明,不收運費。

相關問題