VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: welrachid on September 13, 2015, 11:33:09 AM

Title: developing a plugin that has dynamic setup options in xml
Post by: welrachid on September 13, 2015, 11:33:09 AM
Hi everyone.
I'm developing a plugin that i would like to do some certain action based on the possible order statuses a shop has.
This would normally require me to make some entries in the XML file that comes with the plugin. Since a xml file is not dynamic i cannot figure out how i would include other possible order statuses a shop can have (than those that are standard)
I would like the plugin to be a plugin that is called each time a status change happens.

Joomla 3.4.3
VM 3.0.9.4

If you want me to clarify anything please do not hesitate to ask

Thanks
Wel
Title: Re: developing a plugin that has dynamic setup options in xml
Post by: GJC Web Design on September 13, 2015, 11:51:01 AM
Do you mean to have any Status that a shopper owner might create available in the plugin admin?
Title: Re: developing a plugin that has dynamic setup options in xml
Post by: welrachid on September 13, 2015, 13:30:03 PM
yes exactly.

if a shopowner for example creates a new order status lets say A,B,C,D (or whatever) i want those to be able to be listed in the plugin administration..
Title: Re: developing a plugin that has dynamic setup options in xml
Post by: GJC Web Design on September 13, 2015, 20:45:27 PM
have a look either how e.g.

<field name="categories" value_field="category_name" type="vmcategories" multiple="true" size="10" default="" label="VMSHIPMENT_WEIGHT_CATEGORIES"
                       description="VMSHIPMENT_WEIGHT_CATEGORIES_DESC"/>

is rendered
administrator\components\com_virtuemart\fields\vmcategories.php  with a form field subclassed from JFormField

or do a query in the xml

https://docs.joomla.org/SQL_form_field_type

Title: Re: developing a plugin that has dynamic setup options in xml
Post by: welrachid on September 13, 2015, 22:10:50 PM
Thanks will look into it. Will report if i succeed in doing what i have in mind :)
Title: Re: developing a plugin that has dynamic setup options in xml
Post by: Studio 42 on September 14, 2015, 00:13:35 AM
SImply, check Joomla fields types or do a custom field type. NO mystery to do this.
If you said adding new undefined dynamic fields to XML, this is more complicate using Joomla Jform and need to prebuild the XML file on demand and push it to the main form.