Add price after pressing "add to basket" button
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!
-
- Posts: 44
- Joined: 24 Jun 2019, 14:46
Add price after pressing "add to basket" button
Hi,
I have a product without a price. How can I add the price after pressing the "add to basket" button?
Thank you very much
I have a product without a price. How can I add the price after pressing the "add to basket" button?
Thank you very much
Re: Add price after pressing "add to basket" button
What's your use case?
Aimeos contains a custom price attribute where customers can enter an arbitrary price, e.g. when buying vouchers and the price is added to the basket product then
Aimeos contains a custom price attribute where customers can enter an arbitrary price, e.g. when buying vouchers and the price is added to the basket product then
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 44
- Joined: 24 Jun 2019, 14:46
Re: Add price after pressing "add to basket" button
Use case:
The product can have a strange type of calculation of the price that depends on external factors like the betting system or something like creation of gadgets.
The product can have a strange type of calculation of the price that depends on external factors like the betting system or something like creation of gadgets.
Re: Add price after pressing "add to basket" button
Write a decorator for the basket frontend controller, that calculates the price and adds it to the product item:
https://github.com/aimeos/ai-controller ... /Decorator
https://github.com/aimeos/ai-controller ... /Decorator
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 44
- Joined: 24 Jun 2019, 14:46
Re: Add price after pressing "add to basket" button
What happens if another user adds the same product but has a different price?
Re: Add price after pressing "add to basket" button
What happens in your decorator and how the prices are calculated is totally up to you (and your external factors).
If you have configurable products (with additonal options that have an additional price), you can also assign one or more config attributes with own prices to the product. Customers can then choose the options they want and the total price of the product is calculated automatically.
If you have configurable products (with additonal options that have an additional price), you can also assign one or more config attributes with own prices to the product. Customers can then choose the options they want and the total price of the product is calculated automatically.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 44
- Joined: 24 Jun 2019, 14:46
Re: Add price after pressing "add to basket" button
I know that but i don't have configurable products.aimeos wrote: ↑22 Aug 2019, 09:15 If you have configurable products (with additonal options that have an additional price), you can also assign one or more config attributes with own prices to the product. Customers can then choose the options they want and the total price of the product is calculated automatically.
Creating an identical product with the price I calculate while adding it into the basket, can be a solution?
Re: Add price after pressing "add to basket" button
Sure, the basket decorator will be your friend in that caselucadambros wrote: ↑22 Aug 2019, 09:36 Creating an identical product with the price I calculate while adding it into the basket, can be a solution?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 44
- Joined: 24 Jun 2019, 14:46
Re: Add price after pressing "add to basket" button
Thank you very much!
-
- Posts: 44
- Joined: 24 Jun 2019, 14:46
Re: Add price after pressing "add to basket" button
Last question: how can I change the value of a param into the decorator?
I have the array
How can I change the value of that?
I have the array
Code: Select all
$view->param( 'b_prod' );