One Update Cart Button

If you are runnig Joomla 3.x and Virtuemart 3.x please post to this forum your questions or support tickets about One Page Checkout

One Update Cart Button

Postby spike1968 » Tue Oct 15, 2019 4:43 pm

Hi Stan,

I have found this code
Code: Select all
<p><a class="button btn btn-active" href="index.php?option=com_onepage&amp;task=clearcart">Clear Cart</a></p>

for clearing the cart.

Is there a similar snippet that will allow one button only to update the cart?

For example

Code: Select all
<p><a class="button btn btn-active" href="index.php?option=com_onepage&amp;task=updatecart">Update Cart</a></p>


Thanks in advance

Cheers
Martyn
spike1968
 
Posts: 18
Joined: Thu Nov 24, 2016 10:14 am

Re: One Update Cart Button

Postby admin » Wed Oct 16, 2019 11:18 am

hello martyn, yes, there is a theme which has a single button to update all quantities, you can check "black" theme and it's demo is available here:

https://php73.rupostel.com/mero/index.php/en/cart

(add a few products to the cart)

the most important files to handle this functionality are

tabcontent.js (includes the function updateAll referenced from the button in basket.html.php )
update_form_ajax.tpl.php

includes definition of the input box that is then used in ajax code:
Code: Select all
<input onchange2="return Onepage.updateProduct(this);" type="text" title="<?php echo OPCLang::_('COM_VIRTUEMART_CART_UPDATE'); ?>" rel="<?php echo $product->cart_item_id.'|'.md5($product->cart_item_id); ?>" class="inputbox opcq updatebtn" size="3" name="quantity" id="quantity_for_<?php echo md5($product->cart_item_id); ?>" value="<?php echo $product->quantity; ?>" />


to use "onchange" event you can try to rename onchange2 to onchange

best regards, stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm


Return to One Page Checkout for Virtuemart 3 on Joomla 3.x

cron