Clear cart after checkout #908
-
Hello I am a bit stuck. How can i clear the cart after the payment has been successful? I am handling the payment through a controller and I am using database orders. I know that I can use events e.g. postCheckout however I am using a custom model for my orders instead of the simple commerce OrderModel::class and it does not accept my Model type. Any help is appreciated! Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
duncanmcclean
Sep 5, 2023
Replies: 1 comment 2 replies
-
Are you using your own controller? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ah okay, I don't generally recommend using custom controllers.
Anyways, this is where the cart is cleared in Simple Commerce's
CheckoutController
:simple-commerce/src/Http/Controllers/CheckoutController.php
Line 278 in f16adef
You'll need to import the
CartDriver
trait.