Retrieve all media of all selection products of product
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!
Retrieve all media of all selection products of product
Hi guys, I need help and hope one of you can do it.
I need to get all images related to a product of select type. Which command can do it?
In code of body-standard.php in detail folder the media elements were getting with that :
$this->get( 'detailMediaItems', map() )
but if i use in products-standard.php it return: Aimeos\Map Object ( [list:protected] => Array ( ) ) 1
I need to get all images related to a product of select type. Which command can do it?
In code of body-standard.php in detail folder the media elements were getting with that :
$this->get( 'detailMediaItems', map() )
but if i use in products-standard.php it return: Aimeos\Map Object ( [list:protected] => Array ( ) ) 1
Re: Retrieve all media of all selection products of product
The media items for the detailMediaItems property are created here:
https://github.com/aimeos/ai-client-htm ... #L547-L554
You have to pass
to the partial to get that data in the partial too:
e.g. here: https://github.com/aimeos/ai-client-htm ... d.php#L525
https://github.com/aimeos/ai-client-htm ... #L547-L554
You have to pass
Code: Select all
'detailMediaItems' => $this->get( 'detailMediaItems', map() )
e.g. here: https://github.com/aimeos/ai-client-htm ... d.php#L525
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: Retrieve all media of all selection products of product
So if I want to get images in product-standard.php, I've add
in items-body-standard.php, in catalog->list folder like this:
and then retrieve the value from product-standard.php like this:
right?
Code: Select all
'detailMediaItems' => $this->get( 'detailMediaItems', map() ),
Code: Select all
<div class="catalog-list-items" data-infinite-url="<?= $infiniteScroll && $this->get( 'listPageNext', 0 ) > $this->get( 'listPageCurr', 0 ) ? $this->url( $listTarget, $listController, $listAction, array( 'l_page' => $this->get( 'listPageNext' ) ) + $this->get( 'listParams', [] ), [], $listConfig ) : '' ?>">
<?= $this->partial(
$this->config( 'client/html/common/partials/products', 'common/partials/products-standard' ),
array(
'require-stock' => (int) $this->config( 'client/html/basket/require-stock', true ),
//'basket-add' => $this->config( 'client/html/catalog/lists/basket-add', true ),
'productItems' => $this->get( 'itemsProductItems', map() ),
'products' => $this->get( 'listProductItems', map() ),
'position' => $this->get( 'itemPosition' ),
'detailMediaItems' => $this->get( 'detailMediaItems', map() ),
)
); ?>
</div>
Code: Select all
$this->get('detailMediaItems', [])
Re: Retrieve all media of all selection products of product
In the catalog/lists panel, the "detailMediaItems" view property isn't available. You can either create a decorator to add "listMediaItems" based on the code from the link or you add that code in the template to create it there.
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