Class 'Aimeos\MShop\Factory' not found

How to configure and adapt Aimeos based shops as developer
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!
JackDarkWeb
Posts: 10
Joined: 10 May 2021, 05:35

Class 'Aimeos\MShop\Factory' not found

Post by JackDarkWeb » 22 Jun 2021, 07:33

$total=100;
$context = app()->make('\Aimeos\Shop\Base\Context')->get();
$manager = \Aimeos\MShop\Factory::createManager($context, 'product');
$search = $manager->createSearch(true);
$items = $manager->searchItems($search, ['text', 'price', 'media', 'attribute', 'product'],$total);


I want to get the first 100 products but an error is displayed

Class 'Aimeos\MShop\Factory' not found

Please how can I solve this problem?
Last edited by JackDarkWeb on 22 Jun 2021, 10:10, edited 1 time in total.

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

Re: Class 'Aimeos\MShop\Factory' not found

Post by aimeos » 22 Jun 2021, 07:35

The \Aimeos\MShop\Factory class doesn't exist for years any more. Where did you find that code?
Instead, use

Code: Select all

\Aimeos\MShop::create( $context, 'product' )
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

JackDarkWeb
Posts: 10
Joined: 10 May 2021, 05:35

Re: Class 'Aimeos\MShop\Factory' not found

Post by JackDarkWeb » 22 Jun 2021, 10:08

Then I can write this

$context = app()->make('\Aimeos\Shop\Base\Context')->get();
$manager = \Aimeos\MShop::create($context, 'product');

What method can I use on the $manager object to retrieve all created products?

My objective is to recover all the products created

Post Reply