Author Topic: Adding multiple products with a single click  (Read 3373 times)

alitvin

  • Beginner
  • *
  • Posts: 3
  • A beginner
Adding multiple products with a single click
« on: January 12, 2017, 20:26:15 pm »
Somebody knows, how to add a product group with a single click?

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 2450
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Adding multiple products with a single click
« Reply #1 on: January 13, 2017, 07:26:20 am »
Hello

first:
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/

regards

Jörgen @ Kreativ Fotografi

Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9997
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Adding multiple products with a single click
« Reply #2 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.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4064
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Adding multiple products with a single click
« Reply #3 on: January 13, 2017, 23:43:22 pm »
Perhaps what you search is my tool  : VirtueMart Batch Edit PROducts because virtuemart access management is to add some restrictions only as i know?

alitvin

  • Beginner
  • *
  • Posts: 3
  • A beginner
Re: Adding multiple products with a single click
« Reply #4 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

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4064
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Adding multiple products with a single click
« Reply #5 on: January 14, 2017, 13:02:54 pm »

alitvin

  • Beginner
  • *
  • Posts: 3
  • A beginner
Re: Adding multiple products with a single click
« Reply #6 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.

mariolr

  • Beginner
  • *
  • Posts: 4
Re: Adding multiple products with a single click
« Reply #7 on: February 07, 2017, 00:28:35 am »
Hi Alitvin, could you please specify how did you build the multiple request?

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9997
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

mariolr

  • Beginner
  • *
  • Posts: 4
Re: Adding multiple products with a single click
« Reply #9 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.

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4064
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Adding multiple products with a single click
« Reply #10 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 ;)

mariolr

  • Beginner
  • *
  • Posts: 4
Re: Adding multiple products with a single click
« Reply #11 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?

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4064
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Adding multiple products with a single click
« Reply #12 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>