Querying data - top 5 products
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!
- bilginkilic
- Posts: 34
- Joined: 05 Jul 2020, 07:08
Querying data - top 5 products
$items = Product::uses(['text', 'media', 'price','name'])
->category(1)
->sort('name')->slice(0, 48)->search();
how to put site_id condition an extra filter like product limitation, etc in this query?
major point is.. how to fetch limited product..
Like i want to list only 5 items.
ps: current query is picking product price is in euro and usd both..
We wanted to pick only based on store configuration.
->category(1)
->sort('name')->slice(0, 48)->search();
how to put site_id condition an extra filter like product limitation, etc in this query?
major point is.. how to fetch limited product..
Like i want to list only 5 items.
ps: current query is picking product price is in euro and usd both..
We wanted to pick only based on store configuration.
@bilginkilic_ (twitter)
Re: Querying data - top 5 products
To add a site ID filter and limit the items to 5, use:
Code: Select all
$items = Product::uses(['text', 'media', 'price','name'])
->compare('==', 'product.siteid', '<site ID string>')
->category(1)->sort('name')->slice(0, 5)->search();
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