VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: welrachid on February 21, 2015, 12:24:36 PM

Title: developing shipment plugin - want to auto add extra userfields
Post by: welrachid on February 21, 2015, 12:24:36 PM
Hi dear VM community
I want to make extra fields on an order that has to do with the shipment module. Its extra shipment data. I think the way to do it is to make extra userfields (shopper fields)
I am trying to figure out a way to make these extra fields upon install of the plugin, but i cant figure out if there is a "proper" way to do it?
The way i think i can do it is using some SQL running which will check for the existence of field XYZ or else create it. But i dont think that is the "right" way to do it?

Thx
Wel
Title: Re: developing shipment plugin - want to auto add extra userfields
Post by: welrachid on February 21, 2015, 15:56:47 PM
i forgot to mention versions

Joomla 3.3.6
VM 3.0.2
I'm going to upgrade to latest, but right now i just want it to work on current versions.
Title: Re: developing shipment plugin - want to auto add extra userfields
Post by: alatak on February 21, 2015, 16:36:07 PM
Hello
The klarna payment plugin does that.
Please have a look in the plgVmOnStoreInstallPaymentPluginTable function
Title: Re: developing shipment plugin - want to auto add extra userfields
Post by: welrachid on February 22, 2015, 11:35:21 AM
Quote from: alatak on February 21, 2015, 16:36:07 PM
Hello
The klarna payment plugin does that.
Please have a look in the plgVmOnStoreInstallPaymentPluginTable function
Hi
Thank you very much.
But this is a method i already thought was possible.
I was hoping for a better/more elegant method, maybe in the form of vmparams in xml file or something.

But nevertheless i understand you're part of the dev team, so this is probably the only way. thank you.
Title: Re: developing shipment plugin - want to auto add extra userfields
Post by: AH on February 22, 2015, 15:00:16 PM
It really depends on what the extra fields are

You can store extra fields in your shipment plugin table - as the plugin builds the table in the first instance you can add any fields you require

look at the weight_countries.php

function getTableSQLFields ()

public function getVmPluginCreateTableSQL ()