VirtueMart Forum

VirtueMart 2 + 3 => General Questions => Topic started by: alitvin on January 12, 2017, 20:26:15 pm

Title: Adding multiple products with a single click
Post by: alitvin on January 12, 2017, 20:26:15 pm
Somebody knows, how to add a product group with a single click?
Title: Re: Adding multiple products with a single click
Post by: Jörgen on January 13, 2017, 07:26:20 am
Hello

first:
http://forum.virtuemart.net/index.php?topic=79799.0 (http://forum.virtuemart.net/index.php?topic=79799.0)

What kind of group ? Tried clone product ?

There are some store handling softwares out there, a quick search gave this:

https://virtuemart-manager.com/useful-articles/tools/virtuemart-access-management/ (https://virtuemart-manager.com/useful-articles/tools/virtuemart-access-management/)

regards

Jörgen @ Kreativ Fotografi

Title: Re: Adding multiple products with a single click
Post by: Milbo on January 13, 2017, 08:52:05 am
In general the vm core can add more than one product at once. The rest is mainly form.
Title: Re: Adding multiple products with a single click
Post by: Studio 42 on January 13, 2017, 23:43:22 pm
Perhaps what you search is my tool  : VirtueMart Batch Edit PROducts (http://shop.st42.fr/en/products/vm-be-pro-batch-product-edit.htm) because virtuemart access management is to add some restrictions only as i know?
Title: Re: Adding multiple products with a single click
Post by: alitvin on January 14, 2017, 10:52:19 am
I have a few products on the page, and I want to add a button, when clicked, all products displayed on this page have been added to the cart using ajax.

Joomla 3, Virtuemart 3
Title: Re: Adding multiple products with a single click
Post by: Studio 42 on January 14, 2017, 13:02:54 pm
For this you have http://sm-planet.net/index.php?option=com_content&view=article&id=2:catproduct&catid=8&Itemid=110 if the design is right for you
Title: Re: Adding multiple products with a single click
Post by: alitvin on January 15, 2017, 10:06:21 am
The solution was so simple ... As said Milbo, vm core can add more than one product at once. It is only necessary to send a request with the id and quantity of all products, not just one. Thank you all for your help.
Title: Re: Adding multiple products with a single click
Post by: mariolr on February 07, 2017, 00:28:35 am
Hi Alitvin, could you please specify how did you build the multiple request?
Title: Re: Adding multiple products with a single click
Post by: Milbo on February 07, 2017, 09:55:47 am
Just take a look here please
http://extensions.virtuemart.net/component/virtuemart/?customfields%5B34%5D=multi+add&customfields%5B35%5D=&customfields%5B36%5D=&customfields%5B37%5D=&customfields%5B38%5D=&customfields%5B39%5D=&customfields%5B40%5D=&keyword=&searchAllCats=0&view=category&option=com_virtuemart&virtuemart_category_id=0&Itemid=137

This is the official vm store listing all products which provide this feature
Title: Re: Adding multiple products with a single click
Post by: mariolr on February 07, 2017, 13:13:49 pm
Thanks Milbo. I already use CatproductContent and it's a great tool and the sm-planet team gave professional support when needed. I think it's easyer with addJS.
I'm working on a custom tool that collects orders from different people. At the end I have a table with the sum of all the orders and I have for every row $row[id] as product_id and $row[quantity] as quantity.
I'm only missing a button that takes this data and add them to the cart in one click.
I wonder if the easyest way is addJS.
Title: Re: Adding multiple products with a single click
Post by: Studio 42 on February 07, 2017, 14:55:37 pm
If you have no customfields, you only need product ID and quantity from a form or from a generated link
Eg yoursite/?index.php&optionvirtumart&view=cart&task=add&quantity[]=5&virtuemart_product_id[]=22&quantity[]=2&virtuemart_product_id[]=55 ...
In this case you see directly the cart.
I use this for eg. to charge my customers for the support so they have only to validate the cart and it work too in emails ;)
Title: Re: Adding multiple products with a single click
Post by: mariolr on February 07, 2017, 17:33:29 pm
Yes, I tested the url solution but for orders with 60-100-150 products, won't the url get too long?
The url limit lenght suggested is about 2000 so I tested a 80 products - 3400 char url...and it works!
(mac - firefox)
Should I take the risk?
Title: Re: Adding multiple products with a single click
Post by: Studio 42 on February 07, 2017, 21:11:36 pm
If your URL is to long, then you need to use a POST
with inputs
Code: [Select]
<form method="post" action="yoursite/?index.php&option=virtumart&view=cart&task=add">
<input name="virtuemart_product_id[]" value="22"><input name="quantity[]" value="5">
<input name="virtuemart_product_id[]" value="55 "><input name="quantity[]" value="2">
....
<input type=submit value="submit all">
</form>