Extension list

yootheme

ecommerce

joomla

Skip to main content

List of all our extensions

Create an account

Remove multiple products at once from the cart

Remove multiple products at once from the cart was created by keep2000

Posted 2 years 4 months ago #162
When you remove a product from the cart, VM has a trigger: vDispatcher::trigger('plgVmOnRemoveFromCart',array($this,$prod_id));
I use this to remove binded products like when there is a phone and a case in the cart and you remove the phone, the plugin removes the case as well.
The cart management does work, but there is a bit of issue with the display.
For testing add this to a vmcustom plugin:
Code:
    function plgVmOnRemoveFromCart( &$cart, $prod_id )     {         unset($cart->product[$prod_id+1]);         unset($cart->cartProductsData[$prod_id+1]);     }
Add two products to the cart, and remove the first one.
The expected behavior: it should show an empty cart, because VM removed the first product and the plugin removed the second one.

Actual behavior:
vmuikitx removes the first product, but the second one is still there. The cart module already shows 0 products. When I refresh the checkout page, it's empty.
 

Please Log in or Create an account to join the conversation.

Replied by keep2000 on topic Remove multiple products at once from the cart

Posted 2 years 4 months ago #166
maybe a quick solution is an optional non-ajax version for removing products

Please Log in or Create an account to join the conversation.

Time to create page: 0.437 seconds
Powered by Kunena Forum