How to update all quantities from the cart page in one click
I was recently asked by one of my customers how he could have a button to save all quantities in the cart in one click.
Indeed his cutomers do recurring orders and have several line items for each order. With the help of our clone order plugin, they can quickly add all the products from a former order to their cart.
However this will copy the quantites over and from time to time, they might want to change the number of each item.
Reviewing all the product lines and clicking on each quantity update button can quickly turn into a long process
It would be nice to have one button to update all quantities at once. Here is a quick solution for this:
This change implies modifying a Virtuemart template file. since you don't want to loose your changes when you upgrade Virtuemart to a newer version, start by copying this file
- replace YOUR_TEMPLATE by your actual joomla template name
- you may have to create the folder structure
- the file might be present already, in this case keep a copy of it and modify the existing one
Locate a good placement for the new button. One common place would be in the table header:
add the following button to the column header of the Quantity / Update column:
Add the following piece of code at the end of your file: