I want to remove some XML value without touching core XML files, is it possible ?
The scenario is the following.
In /app/code/core/Mage/Tax/etc/config.xml we have some config value for the totals (<sales><quote><totals>).
I want to comment out the tax one so the tax line is not displayed in the frontend.
- commenting the node in the core XML file works fine but it is not the best approach.
- If I have put new empy values in a separate module I have a different effect ( it is not like remove the declaration)
In particular I want to do something like:
<!--<renderer>tax/checkout_tax</renderer>-->
asked Dec 16, 2013 at 15:53
Fra
6,98512 gold badges66 silver badges101 bronze badges
1 Answer 1
Theoretically inside of your module you can:
- in
config.xmlreset the node to something like<renderer>0</renderer> - register an observer and
Mage::getConfig()->setNode('path', NULL)
answered Dec 16, 2013 at 20:20
Tim Bezhashvyly
11.6k6 gold badges44 silver badges73 bronze badges
-
<renderer>0</renderer>is giving me a different result: removing the node from core XML file returnnullwhile<renderer>0</renderer>return a string with value 0Fra– Fra2013年12月17日 09:17:52 +00:00Commented Dec 17, 2013 at 9:17 -
Try putting
nullinstead of0. If it will not work try option 2.Tim Bezhashvyly– Tim Bezhashvyly2013年12月17日 10:08:31 +00:00Commented Dec 17, 2013 at 10:08 -
I have already tried both ( 0 and null ) the issue is that they are converted to string ... I think solution 2 is the only one workingFra– Fra2013年12月17日 10:40:41 +00:00Commented Dec 17, 2013 at 10:40
-
@Francesco, not quite. Solution 1 can be still valid for some cases where setting the value to
0or something else will do the job.Tim Bezhashvyly– Tim Bezhashvyly2013年12月17日 13:01:34 +00:00Commented Dec 17, 2013 at 13:01 -
1Hi Tim, I think it is good idea to improve the answer specifying that
method 1is not equivalent to comment out the line in the core fileFra– Fra2013年12月17日 14:27:09 +00:00Commented Dec 17, 2013 at 14:27
default
System > Configuration > Tax > Shopping Cart Display Settingsto not show tax?