Override Existing Option from Another Package

  • Hello,


    How can I override an existing option by installing another package?


    For example, my Package_A installs a boolean example_option with defaultvalue of 0.


    Now, I have my Package_B and what I want is to set example_option to 1 by installing this package.


    I have tried this in my Package_B option.xml:

    Code
    1. <option name="example_option">
    2. <defaultvalue>1</defaultvalue>
    3. </option>

    but this results in an error: option 'example_option' is already provided by 'Package_A'

  • There's no "legal" way to do so.

    CSS
    1. * { background-color: rgba(255,0,0,.2); }
    2. * * { background-color: rgba(0,255,0,.2); }
    3. * * * { background-color: rgba(0,0,255,.2); }
    4. * * * * { background-color: rgba(255,0,255,.2); }
  • Thanks for the responses. Well, I think I have this weird scenario of mine :D


    Let's say I have My_Plugin which will be offered both as Free and Premium. When installed, the premium options features will be already there but is disabled. When My_Plugin_Premium is installed, that will enable the premium options in My_Plugin.


    Something like this:

  • I would recommend, that the new options are shipped with the premium upgrade. That's what we do for example in our TinyIMG plugin.


    You should not forget, that people also can uninstall the premium package and just leave the free package installed, so you would also have to disable the options, again. That's way more work, than required and it's not easily done, for obvious reasons.

    CSS
    1. * { background-color: rgba(255,0,0,.2); }
    2. * * { background-color: rgba(0,255,0,.2); }
    3. * * * { background-color: rgba(0,0,255,.2); }
    4. * * * * { background-color: rgba(255,0,255,.2); }