Add multiple product to the cart with single button

Phoca Cart - complex e-commerce extension
keep2000
Phoca Enthusiast
Phoca Enthusiast
Posts: 59
Joined: 14 Nov 2022, 12:04

Add multiple product to the cart with single button

Post by keep2000 »

Would it be possible to add multiple products to the cart with a single click of the 'Add to Cart' button? Perhaps if the id and quantity inputs could be arrays in .phItemCartBoxForm?

Tags:
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48513
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Add multiple product to the cart with single button

Post by Jan »

Hi, for now, there is no such option, do you have some use case for this feature?

Jan
If you find Phoca extensions useful, please support the project
keep2000
Phoca Enthusiast
Phoca Enthusiast
Posts: 59
Joined: 14 Nov 2022, 12:04

Re: Add multiple product to the cart with single button

Post by keep2000 »

The shop sells phones, and customers can choose from suggested accessories such as cases, screen protectors, chargers, cables, etc. These are individual products that can be purchased along with the phone as kind of an upsell. There is no bundle or package pricing; just multiple products added to the cart with a single click.

We use this solution on multiple webshops that we have built.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48513
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Add multiple product to the cart with single button

Post by Jan »

Can you paste some link to see how this works?

Jan
If you find Phoca extensions useful, please support the project
keep2000
Phoca Enthusiast
Phoca Enthusiast
Posts: 59
Joined: 14 Nov 2022, 12:04

Re: Add multiple product to the cart with single button

Post by keep2000 »

https://apneumatika.hu/webaruhaz/pneuma ... -reszletek
This is a VirtueMart shop. The child products are listed in a table with separate quantity inputs but a single "Add to Cart" button. This allows you to easily select the desired quantities of multiple sizes in one table.

Another example
https://masszazsmedencek.hu/masszazsmed ... azsmedence
Here, you can add additional products to the cart using a list of checkboxes.

It might be possible to achieve this by using product_id[] instead of product_id and implementing a fallback with (array)product_id in the processing logic.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48513
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Add multiple product to the cart with single button

Post by Jan »

Hi, thank you for this info, I think, the best way is to create specific extension for this feature. Added to feature request list.
https://github.com/PhocaCz/PhocaCart/issues/246
Jan
If you find Phoca extensions useful, please support the project
Post Reply