Price configuration options

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!
PiotrH
Posts: 4
Joined: 18 Jul 2023, 07:40

Price configuration options

Post by PiotrH » 25 Jul 2023, 13:20

Hi

How can I get configuration options (key/value) for product price ?

I have tried getConfigValue() method but with no success:

Code: Select all

Called unknown macro "getConfigValue" on class "Aimeos\MShop\Price\Item\Standard"

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

Re: Price configuration options

Post by aimeos » 26 Jul 2023, 11:28

The price items doesn't have a config property, so there's no way to store key/value pair there. The only items with config properties are:
- catalog
- product
- list items for referencing items from other domains

If you want to store arbitrary key/value pairs for prices, use properties (for prices, there's a mshop_price_property table available). How to manage and retrieve properties is documented here:
https://aimeos.org/docs/latest/models/m ... properties
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

heural
Posts: 85
Joined: 09 Jun 2022, 07:55

Re: Price configuration options

Post by heural » 21 May 2025, 08:44

Hi Aimeos Team,

I have the same problem:

I have added custom values to the price: rebateType:bundle , link in the screenshot,
with an import at the price-domain with "product.lists.config" field.
(aka your answer: - list items for referencing items from other domains)

How can I retrieve this value-pairs withhin a priceItem?
Attachments
chrome-capture-2025-5-21.png
chrome-capture-2025-5-21.png (35.14 KiB) Viewed 157958 times
Thanks a lot!

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

Re: Price configuration options

Post by aimeos » 22 May 2025, 15:09

To get the configuration stored in the list item, you have to use:

Code: Select all

foreach( $product->getListItems( 'price' ) as $listItem )
{
	$config = $listItem->getConfigValue( 'key' );
	$price = $listItem->getRefItem();
}
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply