Add multiple copies of product with different custom fields

Started by TonyP, March 22, 2018, 14:36:34 PM

Previous topic - Next topic

TonyP

Hi !
I'm trying to develop a module that allows to add a product and its other versions (determined through custom fields) but I don't know how to send the data.

I found a way to add a product to the cart :

{"option":"com_virtuemart",
"nosef":"1",
"view":"cart",
"task":"addJS",
"format":"json",
"lang":"fr",
"Itemid":"136",
"customProductData":{"161":{"13":"448"}},
"quantity":["1"],
"virtuemart_product_id":["161","161"],
"pname":"Cap ",
"pid":"161",
"language":"fr-FR"}

But how can I had multiple copies of the same product with different custom fields ?
This is an idea of what I'd like to do :
"customProductData":[{"161":{"13":"448"}},{"161":{"13":"450"}} ]

Joomla : 3.8.6.
VirtueMart : 3.2.12