Colors on the category page
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Colors on the category page
Hello Aimeos!
What solution do you suggest if I want to display the colors (icons) of the product on the category page (Laravel)?
Is there a simple solution?
Thank you very much! these colors:
What solution do you suggest if I want to display the colors (icons) of the product on the category page (Laravel)?
Is there a simple solution?
Thank you very much! these colors:
Re: Colors on the category page
Add this to the ./config/shop.php file in your Laravel application:
This fetches the attributes of the variant products too and you can add them in your template.
See also: https://aimeos.org/docs/latest/config/c ... s/#domains
If you enable this setting and switch to the alternative list view, you will see what you want out of the box:
https://aimeos.org/docs/latest/config/c ... basket-add
Code: Select all
'client' => [
'html' => [
'catalog' => [
'lists' => [
'domains' => ['attribute', 'media', 'price', 'product', 'text']
]
]
]
],
See also: https://aimeos.org/docs/latest/config/c ... s/#domains
If you enable this setting and switch to the alternative list view, you will see what you want out of the box:
https://aimeos.org/docs/latest/config/c ... basket-add
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Colors on the category page
Hi!
Thanks for the help.
Unfortunately, I can't extract attributes from $productItem.
It does not work:
Can you help me?
Thanks for the help.
Unfortunately, I can't extract attributes from $productItem.
It does not work:
Code: Select all
$productItem->getRefItems( 'attribute', null, 'variant' );
Re: Colors on the category page
The variant attributes are attached to the variant articles, not to the selection product itself:
Code: Select all
foreach( $productItem->getRefItems( 'product', 'default', 'default' ) as $articleItem )
{
foreach( $articleItem->getRefItems( 'attribute', 'color', 'variant' ) as $attrItem ) {
echo $attrItem->getRefItems( 'media', 'icon' )->getPreview()->first();
}
}
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star