Hello everyone!
I have tried in many ways but I can not. I would like to override the file:
app/code/community/IWD/OnepageCheckout/etc/config.xml
and remove the node
config > frontend > events > sales_model_service_quote_submit_after > observers > <method>emptyCart</method>
how can i do? thanks ![]()
copy this file to local folder
So if your just trying to disable the observer Magento has a handy flag for that. You can set the type to <type>disabled</type>. Allthough you could just copy the file a local version that makes it much more diffcult for you to update the module in future.
You can create a small module and update one particular node aslong as your module loads afterwards. For example:
app/etc/modules/Namespace_Modulename.xml
<?xml version="1.0"?>
<config>
<modules>
<Namespace_Modulename>
<active>true</active>
<codePool>local</codePool>
<depends><!-- Adding depends will mean our extension loads afterwards meaning we can override config.xml -->
<IWD_OnepageCheckout/> <!-- Note I have just guessed what the orignal module namespace and module name is here -->
</depends>
</Namespace_Modulename>
</modules>
</config>
app/code/local/Namespace/Modulename/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Namespace_Modulename>
<version>0.1.0</version>
</Namespace_Modulename>
</modules>
<frontend>
<events>
<sales_model_service_quote_submit_after>
<observers>
<some_unine_identifier_from_the_original_module>
<type>disabled</type>
</some_unine_identifier_from_the_original_module>
</observers>
</sales_model_service_quote_submit_after>
</events>
</frontend>
</config>
then to modify this:
<onepagecheckout>
<type>model</type>
<class>onepagecheckout/observer</class>
<method>removeHistoryComment</method>
<method>emptyCart</method>
</onepagecheckout>
in this (removal of the second method):
<onepagecheckout>
<type>model</type>
<class>onepagecheckout/observer</class>
<method>removeHistoryComment</method>
</onepagecheckout>
I have to write:
<?xml version="1.0"?>
<config>
<modules>
<Namespace_Modulename>
<version>0.1.0</version>
</Namespace_Modulename>
</modules>
<frontend>
<events>
<sales_model_service_quote_submit_after>
<observers>
<onepagecheckout>
<type>disabled</type>
</onepagecheckout>
</observers>
</sales_model_service_quote_submit_after>
<sales_model_service_quote_submit_after>
<observers>
<onepagecheckout>
<type>model</type>
<class>onepagecheckout/observer</class>
<method>removeHistoryComment</method>
</onepagecheckout>
</observers>
</sales_model_service_quote_submit_after>
</events>
</frontend>
</config>
I tried this code and definitely emptyCart does not run but would like to be safe rather than removeHistoryComment to run (do not know what it does, why I prefer to work)
thanks ![]()