Product Rebate on Basket

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!
createanet
Posts: 72
Joined: 22 Mar 2021, 16:56

Product Rebate on Basket

Post by createanet » 26 Oct 2021, 14:40

Hello,

This question was asked in other threads, but its not to clear. eg.

- laravel-package-f18/unexpected-getrebat ... t1486.html
- help-f15/price-rebate-amount-t2913.html
- Product's Rebate price is zero on basket
- post13218.html#p13218

I was wondering why or what is the reason for resetting rebates when adding products to basket?

https://github.com/aimeos/ai-controller ... se.php#L70

I was expecting rebates to be calculated on the basket, but this above line removes this and is therefore absent when the following is executed in a template and when the line is stored in the database.

Code: Select all

$this->summaryBasket->getPrice()->getRebate()
There was a comment
... when you add a product to the basket, the rebate value is cleared because the rebate field is then used by the coupon providers
If I was to follow the advice in one of the threads above, do I need to implement a new column on the order table, or the order lines? As presumably the existing rebate column on the order line is reserved for those created and applied by coupons?

The object is to display the original price beit a total or individual price for a product for price items that have associated group discounts. ie. weve added a discount price item to a product specifically for users of a group. We wish to display the original price - which I assumed would have been actual price + rebate.

Thanks,

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

Re: Product Rebate on Basket

Post by aimeos » 27 Oct 2021, 11:02

Yes, if you want to display the original price in the basket, the e-mails and the account history, you have to add a new column to the mshop_order_base_product table and set it accordingly by overwriting this method:
https://github.com/aimeos/ai-controller ... se.php#L33
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

createanet
Posts: 72
Joined: 22 Mar 2021, 16:56

Re: Product Rebate on Basket

Post by createanet » 28 Oct 2021, 07:41

okey dokey, thanks :)

Post Reply