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

1 Answer 1

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)
9
  • <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, 2013 at 9:17
  • Try putting null instead of 0. If it will not work try option 2. 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 working
    – Fra
    Dec 17, 2013 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. Dec 17, 2013 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, 2013 at 14:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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