How to hide plugin Parameters in Joomla With VMCONFIG
5 (100%) 1 vote

LOOKING FOR NEW WEBSITE TEMPLATES FOR NEXT PROJECTS?

Check out 65+ FREE Joomla! templates See 60+ FREE WordPress themes

Within Joomla plugins, there are manifest files that have the name <extension_name>.xml . They contain general information about the installation and parameters for the configuration of the plugin itself.

In VirtueMart, those configuration parameters are used inside the component itself when creating a payment, shipment or a custom field.
Since VirtueMart 3, you can hide those parameters in Joomla Plugin manager by using the tag <vmconfig>.

To do it, you just change the <config>section in the plugin xml to <vmconfig>. If the plugin xml contains a <vmconfig>section, it is now used and does not appear in the Joomla plugin. If a plugin xml does not contain a <vmconfig> section, as a fallback the <config>section is used and in this case, it WILL appear in the Joomla plugin config).

Example:

<?xml version="1.0" encoding="UTF-8" ?>
<extension version="2.5" type="plugin" group="vmshipment" method="upgrade">
    <name>By weight, ZIP and countries</name>
   ....
    <languages>
        <language tag="en-GB">en-GB.plg_vmshipment_weight_countries.ini</language>
    </languages>
    <files>
        <filename plugin="weight_countries">weight_countries.php</filename>
        <folder>weight_countries</folder>
    </files>
    <vmconfig>
        <fields name="params">
            <fieldset name="restrictions">
                <field name="show_on_pdetails" type="radio" scope="com_virtuemart" default="1"
                               label="VMSHIPMENT_WEIGHT_COUNTRIES_SHOW_ON_PRDETAILS"
                               description="VMSHIPMENT_WEIGHT_COUNTRIES_SHOW_ON_PRDETAILS_TIP">
                            <option value="0">COM_VIRTUEMART_NO</option>
                            <option value="1">COM_VIRTUEMART_YES</option>
                </field>
                .....
            </fieldset>
        </fields>
    </vmconfig>
</extension>

If you have any question about this post, don’t hesitate to leave a comment below. And don’t forget to share with your friends if you find it useful! Thanks!

Join Joomla & WordPress template club to access all themes and SAVE 95% cost than single PRO template purchase!

Join Joomla! Club (50% OFF on today) Join Joomla! Club (50% OFF on today)

Leave a Reply

Your email address will not be published. Required fields are marked *

[Flash Sale!] 20% OFF for PRO order, 50% OFF for Membership! Limited time, hurry up! Save money for your order on today!
[xMas is coming!] Enjoy your purchase extra discount up to 50% OFF for all products! Coupon code: XMAS50