Pubilc Rebate Price in 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!
Pejka
Posts: 17
Joined: 24 Oct 2016, 11:04

Re: Pubilc Rebate Price in Basket

Post 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 :)

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

Re: Pubilc Rebate Price in Basket

Post 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:
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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply