How to clear basket on frontent when custom checkout controller used?
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!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
How to clear basket on frontent when custom checkout controller used?
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?"
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?"
Re: How to clear basket on frontent when custom checkout controller used?
These two lines clear the basket:
https://github.com/aimeos/ai-client-htm ... hp#L97-L98
https://github.com/aimeos/ai-client-htm ... hp#L97-L98
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
![Image](https://aimeos.org/fileadmin/aimeos.org/icons/star.png)