Manual create new order, without removing current basket products

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
GagDalakyan
Posts: 17
Joined: 03 Dec 2020, 13:13

Manual create new order, without removing current basket products

Post by GagDalakyan » 04 Jun 2021, 08:29

Laravel : 6.20.5
Aimeos : 2020.10
PHP Version : 7.2
Environment : Windows
Hi. I have a button buy now in product detail page. When user clicked it i want to create order with only this product and send user to checkout. But i want to save current basket items. How can i do this.

Thanks!

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

Re: Manual create new order, without removing current basket products

Post by aimeos » 05 Jun 2021, 06:31

You can have several baskets with different types, e.g. the standard basket and one for your single product:
https://github.com/aimeos/ai-controller ... #L110-L114

The only problem when using the standard checkout is, that it doesn't distingish between several baskets and would use the standard one because it doesn't set the type. You would have to create a patch sets the type according to a GET parameter or a session value:
https://github.com/aimeos/ai-client-htm ... d.php#L397

If you can create a pull request in the Github repository, we will be happy to merge it into the core.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
GagDalakyan
Posts: 17
Joined: 03 Dec 2020, 13:13

Re: Manual create new order, without removing current basket products

Post by GagDalakyan » 05 Jun 2021, 07:09

Many thanks for your fast reply. I done this by another way ) When user clicked buy now i send user to checkout page with hidden data, and show there only current product, and when user click process in checkout i clear basket via Ajax and add my product to basket,then i submit the form, and everything works. The only problem is that i have to put old basket products back to basket, after checkout process. How can i clone basket products before removing them from basket ? ( For example store in local storage and after checkout process get them from there and add to basket ).

Post Reply