display variant attributes on catalog page
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!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
display variant attributes on catalog page
Hi,
I'd like to display Variant attributes (eg. salesunit) on the catalog page.
I tried
in a cutom version of
/ext/ai-client-html/client/html/templates/catalog/lists/items-body-list.php
but it still does not work.
I'm using the wrong mehtod? Are there other / better possibilities to display variant attributes?
Thanks
I'd like to display Variant attributes (eg. salesunit) on the catalog page.
I tried
Code: Select all
$productItem->getRefItems( 'attribute', null, 'variant' ),
/ext/ai-client-html/client/html/templates/catalog/lists/items-body-list.php
but it still does not work.
I'm using the wrong mehtod? Are there other / better possibilities to display variant attributes?
Thanks
Re: display variant attributes on catalog page
The attributes are not fetched by default in the list view. You can get them if you add "attribute" to this configuration:
https://aimeos.org/docs/Configuration/C ... ts/domains
https://aimeos.org/docs/Configuration/C ... ts/domains
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: display variant attributes on catalog page
I added 'attribute' to client/html/catalog/lists/domains:
but I still do not get any value for attributes definded under:
Products > Characteristic > Variant attributes > salesunit
I tried:
Code: Select all
'domains' => [
0 => 'media',
1 => 'price',
2 => 'text',
3 => 'attribute'
],
Products > Characteristic > Variant attributes > salesunit
I tried:
Code: Select all
$productItem->getRefItems( 'attribute', null, 'variant' );
$productItem->getRefItems( 'variant', null, 'salesunit' );
Re: display variant attributes on catalog page
Code: Select all
$productItem->getRefItems( 'attribute', null, 'variant' );
Code: Select all
'domains' => [
0 => 'media',
1 => 'price',
2 => 'text',
3 => 'attribute'
4 => 'product'
],
Code: Select all
foreach( $product->getRefItems( 'product', null, 'default' ) as $article ) {
$attrItems = $article->getRefItems( 'attribute', null, 'variant' );
}
https://github.com/aimeos/ai-client-htm ... #L254-L287
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: display variant attributes on catalog page
unfortunately it's not working.
For a simple test I added just this code on my catalog/lists page:
but I get on values either for $article nor $attrItems.
I'd like to list all variants with their sailesunit (e.g. kg, ml, g,) on a catalog page
For a simple test I added just this code on my catalog/lists page:
Code: Select all
<?php
foreach( $productItem->getRefItems( 'product', null, 'default' ) as $article ) {
echo $article;
$attrItems = $article->getRefItems( 'attribute', null, 'variant' );
echo $attrItems;
}
?>
I'd like to list all variants with their sailesunit (e.g. kg, ml, g,) on a catalog page
Re: display variant attributes on catalog page
Use the "client/html/catalog/lists/basket-add" configuration setting, which does this already for you:
https://aimeos.org/docs/Configuration/C ... basket-add
https://aimeos.org/docs/Configuration/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