Help for integrating the Laravel package
Forum rules: Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#5633 by Travin
03 Feb 2018, 03:24
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

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; ?>

At the suggested product I have the same code for including attributes like into the single product
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>


Finally, at my attribute-custom.php I am recieving attribute's images.
Code: Select all<?php
foreach( $attribute->getListItems( 'media', 'default' ) as $listItem ) :
echo 'cool! I'm attribute's image!';
endforeach;
 ?>

But this code is working only at the single product. I can't fetch images of atributes of suggested products. What can I do?
#5637 by aimeos
04 Feb 2018, 15:37
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.