Can't fetch attributes images at suggested products
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!
Can't fetch attributes images at suggested products
Hi all!
I can't fetch images of atributes of suggested products.
I have suggested products at my client\html\templates\catalog\detail\body-default.php
At the suggested product I have the same code for including attributes like into the single product
Finally, at my attribute-custom.php I am recieving attribute's images.
But this code is working only at the single product. I can't fetch images of atributes of suggested products. What can I do?
I can't fetch images of atributes of suggested products.
I have suggested products at my client\html\templates\catalog\detail\body-default.php
Code: Select all
<?php if( ( $posItems = $this->detailProductItem->getRefItems( 'product', null, 'suggestion' ) ) !== []
&& ( $products = $getProductList( $posItems, $this->get( 'detailProductItems', [] ) ) ) !== [] ) : ?>
<section class="catalog-detail-suggest">
<?= $this->partial(
$this->config( 'client/html/common/partials/products', 'common/partials/products-atpack.php' ),
array( 'products' => $products, 'itemprop' => 'isRelatedTo' )
); ?>
</section>
<?php endif; ?>
Code: Select all
<div class="items-attribute items-attribute<?=$productItem->getId();?>">
<?= $this->partial(
'common/partials/attribute-custom.php',
array(
'productItem' => $productItem,
'attributeItems' => $this->get( 'attributeItems', [] ),
'attributeConfigItems' => $productItem->getRefItems( 'attribute', null, 'config' ),
'attributeCustomItems' => $productItem->getRefItems( 'attribute', null, 'custom' ),
'attributeHiddenItems' => $productItem->getRefItems( 'attribute', null, 'hidden' ),
'subClass' => $productItem->getId()
)
); ?>
</div>
Code: Select all
<?php
foreach( $attribute->getListItems( 'media', 'default' ) as $listItem ) :
echo 'cool! I'm attribute's image!';
endforeach;
?>
Laravel 6.18.19 | php 7.4.7 | Xubuntu | Aimeos Laravel 2019.10.5
Re: Can't fetch attributes images at suggested products
In 2017.10, second level references (images of attributes fetched along with products) are not available automatically. This is the case since 2018.01. Before, you have to match with the items in "attributeItems", which contains those images.
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