Fetch Catalog list in Laravel controller

Help for integrating the Laravel package
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!
kartikbhat
Posts: 40
Joined: 02 Dec 2021, 17:18

Fetch Catalog list in Laravel controller

Post by kartikbhat » 25 Apr 2023, 11:47

I have an array of product ids, I need to fetch those products matching these products to display on browser.. How can I achieve this in Laravel controller.. I need to get all details of the product as we get on catalog list page


Help me resolve this

TIA :)

User avatar
aimeos
Administrator
Posts: 7881
Joined: 01 Jan 1970, 00:00

Re: Fetch Catalog list in Laravel controller

Post by aimeos » 29 Apr 2023, 07:21

Use the product frontend controller:
https://github.com/aimeos/ai-controller ... e.php#L136

Code: Select all

$context = app('aimeos.context')->get();
$cntl = \Aimeos\Controller\Frontend::create( $context, 'product' );
$ref = ['attribute', 'media', 'price', 'text'];
$products = $cnt->uses( $ref )->product( [<product IDs>] )->search()
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply