VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: TonyP on March 22, 2018, 14:36:34 PM

Title: Add multiple copies of product with different custom fields
Post by: TonyP on March 22, 2018, 14:36:34 PM
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