how to get list of products of a store
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!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
- ahmed31916
- Advanced
- Posts: 148
- Joined: 14 Apr 2022, 12:15
how to get list of products of a store
Hello,
how to get a list of products of a specific store?
another question, why when I use any method of "MShop\Product\Manager\Standard.php", I got "Called unknown macro".
For example, when I use this method "getSiteItems" like this:
I got this error:
how to get a list of products of a specific store?
another question, why when I use any method of "MShop\Product\Manager\Standard.php", I got "Called unknown macro".
For example, when I use this method "getSiteItems" like this:
Code: Select all
$manager = \Aimeos\MShop::create( app( 'aimeos.context' )->get(), 'index' );
$manager->search( $manager->filter() )->getSiteItems(1);
Code: Select all
Called unknown macro "getSiteItems" on class "Aimeos\MShop\Product\Item\Standard"
Re: how to get list of products of a store
There's no method named getSiteItems() implemented in the product items and therefore, the error is reported.
The site the products are returned for is automatically determined by the site ID included in the locale object of the context. The locale object is returned by the bootstrap() method of the locale manager depending on the site code passed ("default") if nothing else is given:
https://github.com/aimeos/aimeos-core/b ... /Iface.php
The site the products are returned for is automatically determined by the site ID included in the locale object of the context. The locale object is returned by the bootstrap() method of the locale manager depending on the site code passed ("default") if nothing else is given:
https://github.com/aimeos/aimeos-core/b ... /Iface.php
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
- ahmed31916
- Advanced
- Posts: 148
- Joined: 14 Apr 2022, 12:15
Re: how to get list of products of a store
Ok, this return the locale item, but not site products.
How to add site products to the query?
Code: Select all
$manager->bootstrap('default', 'en', 'usd', true, 1);
- Attachments
-
- Screenshot 2022-04-27 163206.png (36.85 KiB) Viewed 1185 times
- ahmed31916
- Advanced
- Posts: 148
- Joined: 14 Apr 2022, 12:15
Re: how to get list of products of a store
@aimeos
help me, please
help me, please
Re: how to get list of products of a store
This will return the products from the current site ("default"):
Code: Select all
$manager = \Aimeos\MShop::create( app( 'aimeos.context' )->get(), 'index' );
$productItems = $manager->search( $manager->filter() );
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
- ahmed31916
- Advanced
- Posts: 148
- Joined: 14 Apr 2022, 12:15
Re: how to get list of products of a store
thank you very very much, clarified.