Where to get Categories List from Databse

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!
kartikbhat
Posts: 40
Joined: 02 Dec 2021, 17:18

Where to get Categories List from Databse

Post by kartikbhat » 01 Feb 2022, 07:16

I need to display all the categories (specifically subcategories of HOME category) in one html page and need to create a hyperlink to each category, which redirects me to page where I can view products under that category; kindly let me know what flow that I need to follow to achieve this...

Laravel V : 8.4
Aimeos : 2021.10.*
PHP v: 7.3
Paltform : Windows 11

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

Re: Where to get Categories List from Databse

Post by aimeos » 02 Feb 2022, 09:59

You can either use the catalog/filter component in your page like done here:
- https://github.com/aimeos/aimeos-larave ... op.php#L30
- https://github.com/aimeos/aimeos-larave ... ade.php#L7
- https://github.com/aimeos/aimeos-larave ... de.php#L18

Another option is to use the Aimeos Catalog frontend controller class in an own Laravel controller to retrieve the categories:

Code: Select all

$tree = \Aimeos\Controller\Frontend::create( app( 'aimeos.context' )->get(), 'catalog' )->getTree();
The available methods are described here:
https://github.com/aimeos/ai-controller ... /Iface.php
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply