News:

AbanteCart v1.4.2 is released.

Main Menu
support

Clear cart

Started by vanuatoo, October 02, 2017, 04:52:09 AM

Previous topic - Next topic

vanuatoo

Hello,

I'm implementing integration with 3rd party payment system.
I have one problem. When the payment system invokes callback.php I need to update the order status (which I'm doing in the database) and also clear the customer cart.
Can you help me how to properly clear the cart without using API?
Any example code would be very helpful.

Basara

Hello.

Check how others builtin extensions do this for example paypal standard or paypal pro

maxter

Cart clear will be with simple call to cart object with clear method.
Here is the cart class:
https://github.com/abantecart/abantecart-src/blob/master/public_html/core/lib/cart.php#L498

Here is how you will call it:
$this->cart->clear();
This is assuming you are inside of the controller or model

Forum Rules Code of conduct
AbanteCart.com 2010 -