Unable to call method "createSearch"

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!
User avatar
taimoorbbb
Posts: 1
Joined: 07 Sep 2021, 00:48

Unable to call method "createSearch"

Post by taimoorbbb » 07 Sep 2021, 00:54

hi, i am getting this error when i try to get the products

Aimeos\MShop\Exception
Unable to call method "createSearch"

i am using aimeos package in laravel 8.

this is how my code looks

$context = \App::make('\Aimeos\Shop\Base\Context')->get(TRUE);

//Obtain the manager for products
$this->orderManager = \Aimeos\MShop::create($context, 'product');

//Create the search for retrieve the orders
$search = $this->orderManager->createSearch();
$search->setConditions( $search->compare('==', 'product.siteid', $siteID));
$products = $this->orderManager->searchItems($search, ['text', 'price', 'media', 'attribute', 'product'] );
dd($products);

after calling my route instead of getting the list of products, i get unable to call method "createSearch"

Any help on this, really appreciate that. Thanks

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

Re: Unable to call method "createSearch"

Post by aimeos » 07 Sep 2021, 08:25

You are using code for Aimeos 2019.x and before. Please check the current documentation:
https://aimeos.org/docs/latest/models/managing-items/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply