11

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>-->
  • 2
    Is there some reason you can't change the settings under System > Configuration > Tax > Shopping Cart Display Settings to not show tax? – Peter O'Callaghan Dec 16 '13 at 20:14
  • it is not exactly the same ... however thanks – Fra Dec 19 '13 at 15:48
8

Theoretically inside of your module you can:

  1. in config.xml reset the node to something like <renderer>0</renderer>
  2. register an observer and Mage::getConfig()->setNode('path', NULL)
  • <renderer>0</renderer> is giving me a different result: removing the node from core XML file return null while <renderer>0</renderer> return a string with value 0 – Fra Dec 17 '13 at 9:17
  • Try putting null instead of 0. If it will not work try option 2. – user487772 Dec 17 '13 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 working – Fra Dec 17 '13 at 10:40
  • @Francesco, not quite. Solution 1 can be still valid for some cases where setting the value to 0 or something else will do the job. – user487772 Dec 17 '13 at 13:01
  • 1
    Hi Tim, I think it is good idea to improve the answer specifying that method 1 is not equivalent to comment out the line in the core file – Fra Dec 17 '13 at 14:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.