How to get product characteristics and attributes in the product frontend template

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!
kdim95
Advanced
Posts: 207
Joined: 26 Aug 2022, 12:17

How to get product characteristics and attributes in the product frontend template

Post by kdim95 » 28 Oct 2022, 14:43

Laravel framework version: 9.37.0
Aimeos Laravel version: * 2022.07.2
PHP Version: 8.1.11
Environment: Linux

Hello, I want to get the product characteristics and attributes in this template for example
templates\client\html\common\partials\products.php


How do I go about doing this?

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

Re: How to get product characteristics and attributes in the product frontend template

Post by aimeos » 29 Oct 2022, 09:14

Add "attribute" and "product/property" to this configuration setting:
https://aimeos.org/docs/2022.x/config/c ... s/#domains

Then, you can access attributes and properties using:

Code: Select all

$product->getRefItems( 'attribute', 'color', 'variant' ); // color variant attribute items
$product->getRefItems( 'attribute', '<type code>' ); // some attribute items by type
$product->getPropertyItems( '<property type>' ); // some property items by type
$product->getPropertyItems(); // all property items
$product->getProperties( '<property type>' ); // List of property values
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

kdim95
Advanced
Posts: 207
Joined: 26 Aug 2022, 12:17

Re: How to get product characteristics and attributes in the product frontend template

Post by kdim95 » 31 Oct 2022, 13:08

Thank you, that works, I can access the attributes this way.

Post Reply