2010-09-14 102 views
0

場景: 更改運費價格使用變量在設計過程中解析設計。 我需要使用phtml checkout發送的一些變量來更改最終的運費。magento結帳:更改運費價格

例如,

Shipping method 1: cost 33$ 

Shipping method 2: cost 23$ 

Shipping method 3: cost 10$ 
    special packaging checkbox (y/n) + 10$ (set it as yes for this example) 
    assicuration: 

我手動插入此複選框,只是在設計,但我需要增加最終價格,並添加一個簡單的標籤,其中包括該產品發貨

總應該是

shipment total         20$ 

回答

2

在爲了做到這一點,您需要編寫自己的運輸模塊。有一個wiki文章here附帶說明,否則在這個過程中有很多好的博客文章。我建議您使用現有的Magento運輸模塊之一(例如Mage_Shipping_Model_Carrier_Flatrate)作爲示例,然後擴展collectRates方法以測試變量的值。