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)
#3642 by Pejka
15 Nov 2016, 09:04
Well that's not very optimal.. I actually need the original rebate value when doing coupon calculations, since there will be product rebates, coupons, and discounts (for which I'm using coupons), and of all these, only one should be actually applied, the one which gives the greatest rebate, and the rebate must be set on the products themselves (for an XML that is to be sent elsewhere).
I could do this with the getRawValues function hack, but actually it's a bit messy, and if you're planning on adding something like this anyways, it's just gonna be more time to retool stuff. So yeah, I think I'm gonna wait for that getOriginalRebate method, and do something else in the meantime :)
#3643 by aimeos
15 Nov 2016, 10:24
If you want to apply rebates via a basket plugin, you have to fetch the product incl. prices from the database for your calculations. The calculated rebate amount must then be set with setRebate() in the price item of the ordered product if it's a product related rebate or in a rebate product if it's a common rebate.

The price checking plugin is a good reference how to retrieve products and their prices you should use for calculation:

The proposed getOriginalRebate() would be only valid for displaying the old product rebate in the basket but that's not the case in your situation.