Page 1 of 1

Product Basic Options

Posted: 12 Sep 2019, 08:48
by cyrotek
Hello,

I've added a key/value pair to the options, the info says "Article specific configuration options, will be available as key/value pairs in the templates", but where and how??? I cant seem to find it.

Re: Product Basic Options

Posted: 12 Sep 2019, 09:21
by aimeos
For products, categories and list items which have a config property:

Code: Select all

$config = $product->getConfig();
$value = $product->getConfigValue( 'yourkey' );

Re: Product Basic Options

Posted: 12 Sep 2019, 09:26
by cyrotek
Throws an error:

Code: Select all

Oops, an error occurred!
Call to undefined method 
Aimeos\MShop\Order\Item\Base\Product\Standard::getConfig()
I try to retrieve it in the summary basket for testing purpose.

Re: Product Basic Options

Posted: 12 Sep 2019, 09:27
by aimeos
Ordered products don't have configuration, they only have the attributes that are added when putting them into the basket:

Code: Select all

$orderAttributes = $orderProduct->getAttributeItems();

Re: Product Basic Options

Posted: 12 Sep 2019, 09:30
by cyrotek
Ah okay, how do I make it available than?

Edit: Never mind, made it work as attribute, even better due to translations. :)