2013-12-22 17 views
1

我想作出選擇,如果客戶想要當天交貨的運費是10美元,否則將是標準收費。只想添加當天交付的複選框。我只有很多信息,如果有人能幫助我,我會很開心,因爲它對我來說很難。如何在magento中按日期添加運費?

回答

1

假設您在請求傳送對​​象中傳遞了deliveryDate。

如果我們考慮以下功能 公共職能collectRates(Mage_Shipping_Model_Rate_Request $請求)平rate.Then的代碼

{ 
If($request->Deliverydate == Today)// replace code for getting today 
{ 
ShippingPrice=10; 
} 
elseif ($this->getConfigData('type') == 'O') { // per order 
      $shippingPrice = $this->getConfigData('price'); 
     } elseif ($this->getConfigData('type') == 'I') { // per item 
      $shippingPrice = ($request->getPackageQty() * $this->getConfigData('price')) - ($this->getFreeBoxes() * $this->getConfigData('price')); 
     } else { 
      $shippingPrice = false; 
     } 
+0

你能詳細告訴我因爲我是新來的Magento。我還沒有通過交貨日期,現在只有標準收費。 –