• Home
  • Joomla services
    • Joomla website building
    • Emergency services for Joomla
    • Joomla support
    • Joomla, Virtuemart SEO
    • PageSpeed services
    • J! extension development
    • More Joomla services
      • Joomla hosting
      • Template services
      • PSD to Joomla
      • Content management services
      • Web portal development
  • Joomla extensions
    • Rel link plugin
    • Virtuemart Reorder
    • Pure CSS FAQ module
    • Admin notes
    • Accessibility plugin for J3!
    • Livesession plugin
    • Meta data for Joomla!
    • VM Crosslink
  • Software development
    • Web portal development
    • Custom software development
    • Metabase support services
    • ERP software development
  • Blog
  • Contact

How to add multiple products to cart with one click in Virtuemart?

  • Add multiple products by a link or button
  • Add multiple products by a form

These workarounds are fully comaptible with Virtuemart and you don't need extra extension to use it. It is a built in feature in Virtuemart.

By link or button

With the following code there will be 2 products added to the Virtumart cart automatically.
Product IDs: 316, 314 - This code should be copied and pasted into your content where you want to display your offer.

  https://example.com/index.php?option=com_virtuemart&view=cart&task=add&virtuemart_product_id[]=316&quantity[]=1&virtuemart_product_id[]=314&quantity[]=1  

Changing the quantity

You can define how many products you want to add by modifying the "&quantity[]=1" part:

  &quantity[]=15  

If you are using AWO Coupon you can add the coupon with the same click by adding the following line:
In this case the summer20off is the coupon code you share with your customers, you don't need coupon IDs.

  &addcoupontocart=summer20off  

Using it as a link for a special offer/bundle
You can put the link anywhere, like into Joomla content, newsletters, Fb posts etc.

  <a href="https://example.com/index.php?option=com_virtuemart&view=cart&task=add&virtuemart_product_id[]=316&quantity[]=1&virtuemart_product_id[]=314&quantity[]=1">Check out our special deal</a>  

To use as a button just simply add the following class to your link:

class="button"  

By html form

In case you want to use a form you can copy and paste the following code:

  <form method="post"/>  <input class="button" title="Add to Cart" type="submit" name="addtocart" value="Add to Cart"/>  <input type="hidden" name="option" value="com_virtuemart"/>  <input type="hidden" name="view" value="cart"/>  <input type="hidden" name="task" value="add"/>  <input type="hidden" name="virtuemart_product_id[]" value="316"/>  <input type="hidden" name="quantity[]" value="1"/>  <input type="hidden" name="virtuemart_product_id[]" value="314"/>  <input type="hidden" name="quantity[]" value="2"/>  </form>  

There are some tricks how you can improve user experience for using this kind of addtocart feature in Virtuemart.

By Oliver Menyhart

Blog
Modified Date 2022-10-21
Published: 2022-01-19
 
  • Home /
  • Blog /
  • How to add multiple products to cart with one click in Virtuemart?
Joomla services
  • Joomla extension development
  • Pagespeed
  • Joomla Support
  • J! website building
  • Web portal development
  • Joomla hosting
  • Content management services
  • Joomla, Virtuemart SEO
  • Template development and optimization
  • Psd to Joomla
  • Emergency services
Software development
  • Custom software development
  • Metabase support and development
  • Our Joomla extensions
Contact
  • Contact details
  • Company details
  • Write to us!

Cloudhoreca Kft. and this site is not affiliated with or endorsed by The Joomla! Project™. Any products and services provided through this site are not supported or warrantied by The Joomla! Project or Open Source Matters, Inc. Use of the Joomla!® name, symbol, logo and related trademarks is permitted under a limited license granted by Open Source Matters, Inc.


close amphtml version