AbanteCart Community

AbanteCart Development => Extensions and Add-Ons => Payment Modules => Topic started by: vanuatoo on October 02, 2017, 04:52:09 AM

Title: Clear cart
Post by: vanuatoo on October 02, 2017, 04:52:09 AM
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.
Title: Re: Clear cart
Post by: Basara on October 02, 2017, 08:12:32 AM
Hello.

Check how others builtin extensions do this for example paypal standard or paypal pro
Title: Re: Clear cart
Post by: maxter on October 02, 2017, 09:18:58 AM
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