Page 2 of 2

Re: Pubilc Rebate Price in Basket

Posted: 15 Nov 2016, 09:04
by Pejka
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 :)

Re: Pubilc Rebate Price in Basket

Posted: 15 Nov 2016, 10:24
by aimeos
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:
https://github.com/aimeos/aimeos-core/b ... tPrice.php

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.