How to clear basket on frontent when custom checkout controller used?

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Sabir_Ali
Posts: 12
Joined: 12 Feb 2024, 06:43

How to clear basket on frontent when custom checkout controller used?

Post by Sabir_Ali » 24 Apr 2024, 12:42

PHP: 8.2.7
Laravel Framework: 10.48.4
System: Debian GNU/Linux 12

We integrate another theme and we use blade files as templates for all new views. My task now is to implement checkout process on our own view template. But I use my custom controller for that. Almost everything works fine except clearing basket on front-end. I redirect user to another view body to show information message. And during creation order from basket information, E-mail notification send using Laravel event. So, when everything is done the products in basket are still there.

I even tried to use Basket Plugin, created by documentation, where well known update() method was created to clear the basket after order is created. The registration of the plugin is fine. But the update method doesn't triggered because it doesn't detect the event. I used two events: 'setOrder.before' and 'setOrder.after' (second is not exist as I know, but I tried).

The question is "is there a way to clear basket on front-end using custom controller or I have to use base CheckoutController (redefine it) to get cleared basket after checkout process is done? Or I'm on a completely wrong way to implement this function?"

User avatar
aimeos
Administrator
Posts: 7915
Joined: 01 Jan 1970, 00:00

Re: How to clear basket on frontent when custom checkout controller used?

Post by aimeos » 25 Apr 2024, 07:23

Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Sabir_Ali
Posts: 12
Joined: 12 Feb 2024, 06:43

Re: How to clear basket on frontent when custom checkout controller used?

Post by Sabir_Ali » 25 Apr 2024, 08:52

Thanks a lot! :)

Post Reply