这是我如何形容sales_order_place_after事件无法在Observer中调用方法。 Magento的1.8
<models>
<chatattributes>
<class>Rockstar_Chatattributes_Model</class>
</chatattributes>
<chatattributes>
<class>Rockstar_Chatattributes_Model</class>
<resourceModel>chatattributes_resource</resourceModel>
</chatattributes>
<chatattributes_resource>
<class>Rockstar_Chatattributes_Model_Resource</class>
</chatattributes_resource>
</models>
</global>
<frontend>
<events>
<sales_order_place_after>
<observers>
<place_order>
<type>singleton</type>
<class>chatattributes/observer</class>
<method>placeOrder</method>
</place_order>
</observers>
</sales_order_place_after>
<sales_quote_item_set_product>
<observers>
<quote_item>
<type>singleton</type>
<class>chatattributes/observer</class>
<method>setQuoteItem</method>
</quote_item>
</observers>
</sales_quote_item_set_product>
<add_to_cart_before>
<observers>
<add_to_cart>
<type>singleton</type>
<class>chatattributes/observer</class>
<method>addToCart</method>
</add_to_cart>
</observers>
</add_to_cart_before>
</events>
</frontend>
这里是我的Observer.php(Rockstar的/ Chatattributes /型号/ Observer.php)
<?php
class Rockstar_Chatattributes_Model_Observer
{
public function placeOrder($observer) {
var_dump('Never Ever change Magento Core code'); die;
}
public function setQuoteItem($observer) {
var_dump('quote item'); die;
}
public function addToCart($observer) {
var_dump('added to cart'); die;
}
}
所以,当我订货,我想在我的观察者中调用方法'placeOrder'...但我不能.....我已经删除了VAR文件夹并使用777权限再次创建它。
你这里写任何更多的自定义观测方法的全球标签&下把? – DRAJI
是的,我已更新的问题....请看看 –
请不要调用两个自定义观察者方法。验证此帖子链接http://chillydraji.wordpress.com/2014/03/03/how-to-create-new-attribute-to-order-in-magento/ – DRAJI