我创建了一个实现了新的运输方式,以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