Product's Rebate price is zero on basket

Help for integrating the Laravel package
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!
veeran ambalam
Posts: 19
Joined: 06 Mar 2021, 14:51

Product's Rebate price is zero on basket

Post by veeran ambalam » 13 Aug 2021, 10:58

aimeos-laravel 2021.04.4
php 7.4.9

Why on localhost::8000/jsonapi/basket API returns "order.base.product.rebate: 0.00"

veeran ambalam
Posts: 19
Joined: 06 Mar 2021, 14:51

Re: Product's Rebate price is zero on basket

Post by veeran ambalam » 13 Aug 2021, 11:56

Here I like to share what I have found so far, this might help you to get an Idea.

1. On debugging I found this on the product price plugin -> getPrice(); " return $price->setRebate( '0.00' ); ".

Why product rebate is set to zero, for what purpose?
Do we set the right price again somewhere on the code?

2. I tried to put logger on the file /price/Item/Standard.php setPrice($value); but $value is always "Zero";

3. Added dd($item); on /price/Item/Standard.php addItem( $item )

Below is the dd result, please notice price.id = 142 and price.rebate = 0.00 but on my database for price.id = 142 price.rebate = 25.00

Aimeos\MShop\Price\Item\Standard {#536 ▼
-currencyid: "INR"
-precision: 2
-tax: 457.62711864407
-prefix: "price."
-available: true
-modified: true
#bdata: array:18 [▼
"price.id" => "142"
"price.siteid" => "1."
"price.type" => "default"
"price.currencyid" => "INR"
"price.domain" => "product"
"price.label" => ""
"price.quantity" => "1"
"price.value" => "3000.00"
"price.costs" => "0.00"
"price.rebate" => "0.00"
"price.taxrates" => array:1 [▶]
"price.status" => "1"
"price.mtime" => "2021-07-01 17:51:55"
"price.editor" => "Vijaya Shanthi (kobzo test)"
"price.ctime" => "2021-07-01 17:51:55"
".currencyid" => "INR"
".precision" => 2
"price.taxflag" => true
]
-listItems: []
-listRefItems: []
-listRmItems: []
-listPrepared: false
-listRmMap: []
-listMap: []
-listMax: 0
-propItems: []
-propRmItems: []
-propMax: 0
-precision: 2
}

veeran ambalam
Posts: 19
Joined: 06 Mar 2021, 14:51

Re: Product's Rebate price is zero on basket

Post by veeran ambalam » 14 Aug 2021, 06:34

Very Sorry the issue was a misunderstanding of the Actual price and Rebate calculations found the bellow article and understood it.
post13218.html#p13218

Post Reply