我創建了一個實現了新的運輸方式,以Magento的一個模塊。目前該模塊運行良好。Magento的:建立自己的配送方式與附加屬性
送貨方法示出了在onepage結帳。
class Tigerbytes_Barverkauf_Model_Carrier_Selbstabholung extends Mage_Shipping_Model_Carrier_Abstract
現在我想擴展功能。新的運輸模塊不應再顯示在前端。因此我添加了一個新的屬性給我的模塊。 (show_frontend)
config.xml中
<default>
<carriers>
<selbstabholung>
<active>1</active>
<allowed_methods>selbstabholung</allowed_methods>
<methods>selbstabholung</methods>
<sallowspecific>0</sallowspecific>
<model>Tigerbytes_Barverkauf_Model_Carrier_Selbstabholung</model>
<name>Selbstabholung</name>
<title>Selbstabholung</title>
<specificerrmsg>Zur Zeit ist die Versandmethode nicht verfuegbar</specificerrmsg>
<handling>0</handling>
<handling_type>F</handling_type>
<show_frontend>0</show_frontend>
</selbstabholung>
</carriers>
system.xml
<show_frontend translate="label">
<label>zeige im Frontend?</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</show_frontend>
屬性show_frontend示於後端和也保存在core_config_data表。現在
最大的問題是讓爲用戶選擇onepage結賬送貨方式時,有在對象沒有show_frontend屬性。
我認爲,用於送貨方式列表中的對象是
Mage_Sales_Model_Quote_Address_Rate
所以我有什麼擴展,即率對象知道的show_frontend屬性?
該死的,你真實!謝謝。我正在考慮收集。 :-) –
是的,有時候magento也可以很簡單。 ;)請將答案標記爲正確。 〜^ – Guerra