about rebate
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!
- giorgimetivishvili
- Posts: 4
- Joined: 30 Mar 2021, 10:48
about rebate
Laravel: ^8.0
aimeos-laravel: ~2020.10
PHP: 7.4
Server: Apache Debian
Hello, i have 2 questions:
1. how to show rebate on cart mini and standard pages? (just calculate them by my self?) but when i get $this->getProducts() it has actual price but price.rebate is 0 for product, so how to show rebates in cart?
2. what happens if i have product in cart and from admin i change price for it? does price changes or does validation fails during checkout?
aimeos-laravel: ~2020.10
PHP: 7.4
Server: Apache Debian
Hello, i have 2 questions:
1. how to show rebate on cart mini and standard pages? (just calculate them by my self?) but when i get $this->getProducts() it has actual price but price.rebate is 0 for product, so how to show rebates in cart?
2. what happens if i have product in cart and from admin i change price for it? does price changes or does validation fails during checkout?
Re: about rebate
The rebates shown in the product list and detail view are not available any more in the basket because they are only for "informational" purpose and not saved in the order. Instead, the price.rebate value in the basket are used for discounts related to coupons or other "real" discounts.giorgimetivishvili wrote: ↑07 Apr 2021, 14:13 1. how to show rebate on cart mini and standard pages? (just calculate them by my self?) but when i get $this->getProducts() it has actual price but price.rebate is 0 for product, so how to show rebates in cart?
To show the original product rebates, you have to load the products for all order products in the basket but this slows down the basket operations. Another option is to extend the copyFrom() method in order product item class and store the rebate as additional property using:
Code: Select all
$orderProduct->set( '_rebate', $price->getRebate() )
Then, you can get the original rebate in the frontend using
Code: Select all
$orderProduct->get( '_rebate', 0 )
Depends on your setup. By default, the ProductPrice plugin will change the price automatically and inform the customer in the checkout summary page.giorgimetivishvili wrote: ↑07 Apr 2021, 14:13 2. what happens if i have product in cart and from admin i change price for it? does price changes or does validation fails during checkout?
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
- giorgimetivishvili
- Posts: 4
- Joined: 30 Mar 2021, 10:48
Re: about rebate
thanks for reply i'll try out and let you know