我使用安裝程序腳本爲訂單和報價創建了一個屬性。這些可以在entity_attribute表中看到。在結帳時,我想設置價值並將其與訂單一起保存。我創建了一個事件和觀察者函數。但價值不會節省。請任何幫助。magento自定義訂單屬性值不保存
config.xml中
<sales_order_save_after>
<observers>
<clickandcollect_save_location_orderattributes>
<type>model</type>
<class>Balance_Clickandcollect_Model_Observer</class>
<method>saveLocationOrderattributes</method>
</clickandcollect_save_location_orderattributes>
</observers>
</sales_order_save_after>
Observer.php
public function saveLocationOrderattributes($observer){
$event = $observer->getEvent();
$order = $event->getOrder();
//$quote = $event->getQuote();
$order->setLocation('1');
}
誰能幫我解決這個問題。我不明白我犯了什麼錯誤。
謝謝
嗨,謝謝你的回覆。之前我添加了save(),但是後來出現了一個錯誤,說內存超出了:(我該怎麼做。在我的php.ini內存中已放置爲168M – KNKM 2014-10-31 05:18:20
,您可以將它增加到256M或512M爲你工作,也見我的更新代碼 – liyakat 2014-10-31 05:19:24
它不工作。是否有任何其他解決方案。我想要的是保存訂單屬性值在結帳。任何幫助... – KNKM 2014-10-31 05:35:59