Page 1 of 1

getRefItems("price") m2 price missing

Posted: 27 Sep 2022, 10:46
by rvhelp
Hello,

I'm trying to get the m2 price of a product in the catalog detail page.

Image

With the following command I only get the default price:

$this->detailProductItem->getRefItems("price")
object(Aimeos\Map)#2858 (2) { ["list":protected]=> array(1) { [4071426]=> object(Aimeos\MShop\Price\Item\Standard)#2438 (17) { ["currencyid":"Aimeos\MShop\Price\Item\Standard":private]=> string(3) "EUR" ["tax":"Aimeos\MShop\Price\Item\Standard":private]=> NULL ["precision":"Aimeos\MShop\Price\Item\Base":private]=> int(2) ["available":protected]=> bool(true) ["modified":protected]=> bool(false) ["bprefix":protected]=> string(6) "price." ["bdata":protected]=> array(18) { ["price.id"]=> string(7) "4071426" ["price.siteid"]=> string(2) "1." ["price.type"]=> string(7) "default" ["price.currencyid"]=> string(3) "EUR" ["price.domain"]=> string(7) "product" ["price.label"]=> string(10) "EUR 107.82" ["price.quantity"]=> string(1) "1" ["price.value"]=> string(6) "107.82" ["price.costs"]=> string(4) "0.00" ["price.rebate"]=> string(5) "34.38" ["price.taxrates"]=> array(1) { ["tax"]=> string(5) "20.00" } ["price.status"]=> string(1) "1" ["price.mtime"]=> string(19) "2022-09-20 00:00:12" ["price.editor"]=> string(9) "scheduler" ["price.ctime"]=> string(19) "2022-01-27 00:00:20" [".currencyid"]=> string(3) "EUR" [".precision"]=> int(2) ["price.taxflag"]=> bool(true) } ["listItems":"Aimeos\MShop\Price\Item\Base":private]=> array(0) { } ["listRefItems":"Aimeos\MShop\Price\Item\Base":private]=> array(0) { } ["listRmItems":"Aimeos\MShop\Price\Item\Base":private]=> array(0) { } ["listPrepared":"Aimeos\MShop\Price\Item\Base":private]=> bool(true) ["listRmMap":"Aimeos\MShop\Price\Item\Base":private]=> array(0) { } ["listMap":"Aimeos\MShop\Price\Item\Base":private]=> array(0) { } ["listMax":"Aimeos\MShop\Price\Item\Base":private]=> int(0) ["propItems":"Aimeos\MShop\Price\Item\Base":private]=> array(0) { } ["propRmItems":"Aimeos\MShop\Price\Item\Base":private]=> array(0) { } ["propMax":"Aimeos\MShop\Price\Item\Base":private]=> int(0) } } ["sep":protected]=> string(1) "/" }
If i dump "detailProductItem" the m2 price is found in it:
Image

How can I access it?

Re: getRefItems("price") m2 price missing

Posted: 28 Sep 2022, 11:20
by aimeos

Code: Select all

$this->detailProductItem->getRefItems("price")
This should return all active prices regardless of the type and according to your screenshot, there's no start/end date in the list item and the status is "1" for both items.

Can you check what happens here?
https://github.com/aimeos/aimeos-core/b ... #L285-L305

Re: getRefItems("price") m2 price missing

Posted: 28 Sep 2022, 14:20
by rvhelp
The problem was that the price had an end date from a few days ago. On the live system, these are updated via cronjob. Thanks for your help.