Storing metadata in each order.

If you are runnig Joomla 3.x and Virtuemart 3.x please post to this forum your questions or support tickets about One Page Checkout

Storing metadata in each order.

Postby konstantinos » Mon Jul 05, 2021 8:38 am

Hello,

I want to include some extra metadata with each order (such as the user's referral link).
Is this possible?

Thanks
konstantinos
 
Posts: 23
Joined: Wed Mar 25, 2015 3:27 pm

Re: Storing metadata in each order.

Postby admin » Mon Aug 02, 2021 4:55 pm

hello, you might want to create the field (cart field only) in virtuemart and mark it as "custom rendered" within opc shopper field configuration (and order field)

then you need to render it inside main opc form in onepage.unlogged(+logged+registration).tpl.php file as

<input type="hidden" name="{your vm field as you created it}" value="<?php htmlentities(json_encode($any_data_you_can_get_with_php)); ?>" id="my_custom_input" />

and/or you might want to inject the data with javascript per the ID of the hidden input.

there are other ways in OPC on how to handle this depending on security and source of the datas.

best regards, stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm


Return to One Page Checkout for Virtuemart 3 on Joomla 3.x

cron