Author Topic: Clear cart  (Read 1379 times)

Offline vanuatoo

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Clear cart
« 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.

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 4463
  • Karma: +207/-0
    • View Profile
Re: Clear cart
« Reply #1 on: October 02, 2017, 08:12:32 AM »
Hello.

Check how others builtin extensions do this for example paypal standard or paypal pro
“Chuck Norris is so amazing.”
― Mother Teresa

Offline maxter

  • Full Member
  • ***
  • Posts: 104
  • Karma: +35/-0
    • View Profile
Re: Clear cart
« Reply #2 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

 

Powered by SMFPacks Social Login Mod