developing shipment plugin - want to auto add extra userfields

Started by welrachid, February 21, 2015, 12:24:36 PM

Previous topic - Next topic

welrachid

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
Best regards,
Wel

welrachid

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.
Best regards,
Wel

alatak

Hello
The klarna payment plugin does that.
Please have a look in the plgVmOnStoreInstallPaymentPluginTable function

welrachid

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.
Best regards,
Wel

AH

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 ()
Regards
A

Joomla 4.4.5
php 8.1