Featured Products Listing On Home Page

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
bilginkilic
Posts: 34
Joined: 05 Jul 2020, 07:08

Featured Products Listing On Home Page

Post by bilginkilic » 19 Jul 2020, 10:55

How to choose 5 products from the admin page and label them as a featured product of the month. After that, we want to fetch that 5 products to front end page? Which function to use to get those labeled products? Thank you.
@bilginkilic_ (twitter)

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

Re: Featured Products Listing On Home Page

Post by aimeos » 21 Jul 2020, 09:22

You can assign your products as "promotion" products to the root category in the admin backend (rebuild the index afterwards) or add the root category in the "categories -> promotion" section of the product detail view.

The catalog list component does display these promotional products if your URL contains the f_catid parameter with the ID of the root category or if you set the root category as default category using this configuration:
https://aimeos.org/docs/Configuration/C ... id-default

You can also use the Catalog facade to retrieve those products from the database yourself and pass them to your own template:

Code: Select all

$items = \Aimeos\Shop\Facades\Product::uses(['text', 'media', 'price'])
    ->category(<catid>, 'promotion')->search();
https://github.com/aimeos/ai-controller ... ce.php#L51
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply