get hierarchical categories of product in for breadcrumb?
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!
get hierarchical categories of product in for breadcrumb?
for example:
i have categories home > cat-1 > cat-2 > cat-3
i set cat-3 for my product category
i want 2 thing?
1- show my product even when i was in cat-2 or cat-1 or home in catalog/list page because these categories are parents of cat-3 and when product is in cat-3 so it falls into the category of the parent?
2- when i was in product detail page (catalog/detail), i want to show hierarchical categories of product for breadcrumb, so my breadcrumb gets like this: Home > Cat-1 > Cat-2 > Cat-3
How can I do those?
i have categories home > cat-1 > cat-2 > cat-3
i set cat-3 for my product category
i want 2 thing?
1- show my product even when i was in cat-2 or cat-1 or home in catalog/list page because these categories are parents of cat-3 and when product is in cat-3 so it falls into the category of the parent?
2- when i was in product detail page (catalog/detail), i want to show hierarchical categories of product for breadcrumb, so my breadcrumb gets like this: Home > Cat-1 > Cat-2 > Cat-3
How can I do those?
Re: get hierarchical categories of product in for breadcrumb
You can adapt the behavior using this config: https://aimeos.org/docs/Configuration/C ... sts/levelsAhmad wrote: 1- show my product even when i was in cat-2 or cat-1 or home in catalog/list page because these categories are parents of cat-3 and when product is in cat-3 so it falls into the category of the parent?
The catalog stage component renders the breadcrumb of the category you are coming from automatically.Ahmad wrote: 2- when i was in product detail page (catalog/detail), i want to show hierarchical categories of product for breadcrumb, so my breadcrumb gets like this: Home > Cat-1 > Cat-2 > Cat-3
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: get hierarchical categories of product in for breadcrumb
ok, if i want to render the breadcrumb from the product deepest category to home without considering category that customer coming from, like this:aimeos wrote:
The catalog stage component renders the breadcrumb of the category you are coming from automatically.
in product detail page: Home > cat-1 > cat-2 > cat-3 > product-name
in cat-3 page: Home > cat-1 > cat-2 > cat-3
what should I do?
Re: get hierarchical categories of product in for breadcrumb
On the list page, this is already the case. There, the current category up to the root category is printed (You are here: Home / cat 1):
http://laravel.demo.aimeos.org/perf/en/ ... &f_catid=3
On the detail page, the category the user is coming from is used as current category for two reasons:
- The users normally want to go back to where they are coming from and not to what you think is the main category for this product
- Products can be assigend to multiple categories and then you have to choose in some way which is the "right" one
If you want to show the breadcrumb from of your main category nevertheless, you can search for the categories the product is assigned to using the catalog lists manager (using catalog.lists.refid). Choose one of them and use the getPath() method of the catalog manager to fetch the catalog items along the root line:
https://github.com/aimeos/ai-client-htm ... d.php#L457
http://laravel.demo.aimeos.org/perf/en/ ... &f_catid=3
On the detail page, the category the user is coming from is used as current category for two reasons:
- The users normally want to go back to where they are coming from and not to what you think is the main category for this product
- Products can be assigend to multiple categories and then you have to choose in some way which is the "right" one
If you want to show the breadcrumb from of your main category nevertheless, you can search for the categories the product is assigned to using the catalog lists manager (using catalog.lists.refid). Choose one of them and use the getPath() method of the catalog manager to fetch the catalog items along the root line:
https://github.com/aimeos/ai-client-htm ... d.php#L457
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
