Hello !
I am currently using v3.2.2 on Joomla 3.7.3.
I am using VM only for check out as i've got a different way of displaying products. I need to use a custom add to cart link.
I found and used this
/index.php?option=com_virtuemart&view=cart&task=add&virtuemart_product_id=6&virtuemart_category_id=8&quantity=1
This one , links me to the cart but it wont really add my product.
Please help ???
product id must be an array: virtuemart_product_id[]=6
/index.php?option=com_virtuemart&view=cart&task=add&virtuemart_product_id[]=6&virtuemart_category_id=8&quantity=1
the quantity also, you can even add more than one product at once.
What is the "syntax" for adding more than one products in the same URL? Also, does this work with child products?
Hey
Maybe someone could please give me advise how I can add some custom fields with predefined values in the URL?
The URL, provided here looks really good and it works, but my article has custom fields, which must be filled as well.
Please tell me how to change the URL, so it will accept custom fields with values
I tried the following:
/index.php?option=com_virtuemart&view=cart&task=add&virtuemart_product_id[]=177&virtuemart_custom_id=39[]-1.0&quantity=1
Where the custom_id=39 is the used custom field and the -1.0 should be the value of this field.
But it isn't working
THX in advance!
Hi,
the get request for custom field is more like this for example:
&customProductData[2265][6]=7514&customProductData[2265][25]=7515&quantity[]=1&virtuemart_product_id[]=2265
[2265] => product ID
[6] => the ID of the custom option in the #__virtuemart_customs table
7514 => the ID of the customfield stored for this product id in #__virtuemart_product_customfields table
But so the custom field must exist first
Hope it help a little bit
Hey
Sorry for the late reply!
Your suggestion works almost brilliant, after a couple of tests
One last question:
How to add multiple products in that style? - Do I have to call one url after the other, or is there a way to combine them in one URL?
THX a lot in advance
index.php&optionvirtuemart&view=cart&task=add&quantity[]=5&virtuemart_product_id[]=22&quantity[]=2&virtuemart_product_id[]=55
Hey
THX - but this I tried and is not working
When I add an article with this url, it works:
index.php?option=com_virtuemart&view=cart&task=add&customProductData[175][44][119]=14.00&customProductData[175][45][118]=8&customProductData[175][43][117]=1&quantity[]=1&virtuemart_product_id[]=175
But when I combine (same article, with different custom product data), it just adds the last article, but not both:
index.php?option=com_virtuemart&view=cart&task=add&customProductData[175][44][119]=14.00&customProductData[175][45][118]=8&customProductData[175][43][117]=1.00&quantity[]=1&virtuemart_product_id[]=175&customProductData[175][44][119]=14.00&customProductData[175][45][118]=8&customProductData[175][43][117]=4.00&quantity[]=1&virtuemart_product_id[]=175
THX