Can't fetch attributes images at suggested products
Posted: 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
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;
?>