breadcrumb modification in catalog details page
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!
- mahammadareef
- Posts: 54
- Joined: 14 Oct 2022, 11:54
breadcrumb modification in catalog details page
hi, team aimeos,
I want to show the breadcrumb in catalog details page with full details like what exists on the catalog list page,
ex :
if I click any item in this category and catalog details page, where breadcrumb should be like this
how i can fulfill this
I want to show the breadcrumb in catalog details page with full details like what exists on the catalog list page,
ex :
You are here: Bestsellers > Women > Dresses
if I click any item in this category and catalog details page, where breadcrumb should be like this
You are here: Best sellers > Women > Dresses > Name of the product
how i can fulfill this
Re: breadcrumb modification in catalog details page
You can either use the attached categories to create the breadcrumb or pass the f_catid parameter to the detail view. Within a decorator (https://aimeos.org/docs/latest/frontend ... omponents/), you can then use the catalog frontend controller to get the categories for the breadcrumb in the data() method of the decorator:
In the template, you can display the path using:
Code: Select all
$catId = $view->param( 'f_catid' );
// or
$catId = $view->detailProductItem->getRefItems( 'catalog' )->getId()->first();
$path = \Aimeos\Controller\Frontend::create( $this->context(), 'catalog' )->getPath( $catId, ['text'] )->getName();
$path[] = $view->detailProductItem->getName();
$view->detailBreadcrumb = $path
Code: Select all
<?= $enc->html( join( ' > ', $this->get('detailBreadcrumb', []) ) ) ?>
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
- mahammadareef
- Posts: 54
- Joined: 14 Oct 2022, 11:54
Re: breadcrumb modification in catalog details page
i wanted to get this and display this
inside catalog/stage component
I created a decorator for the product detail component and everything is fine
by using this code I can get the first category of the product tats okay, but how i can pass this value or get this value in catalog stage component because $view->detailProductItem not available inside of stage component
Code: Select all
$this->get('detailBreadcrumb', []) )
I created a decorator for the product detail component and everything is fine
Code: Select all
$catId = $view->detailProductItem->getRefItems( 'catalog' )->getId()->first();
by using this code I can get the first category of the product tats okay, but how i can pass this value or get this value in catalog stage component because $view->detailProductItem not available inside of stage component
Re: breadcrumb modification in catalog details page
The breadcrumb on the catalog detail page is added here:
https://github.com/aimeos/ai-client-htm ... dy.php#L57
Here's the code which creates it:
- https://github.com/aimeos/ai-client-htm ... #L193-L204
- https://github.com/aimeos/ai-client-htm ... #L324-L385
In the catalog list page, the breadcrumb is generated by the catalog/stage component:
https://github.com/aimeos/ai-client-htm ... hp#L30-L76
In the catalog/stage component used at the catalog list page you don't have access to the product item because there's none (obviously).
https://github.com/aimeos/ai-client-htm ... dy.php#L57
Here's the code which creates it:
- https://github.com/aimeos/ai-client-htm ... #L193-L204
- https://github.com/aimeos/ai-client-htm ... #L324-L385
In the catalog list page, the breadcrumb is generated by the catalog/stage component:
https://github.com/aimeos/ai-client-htm ... hp#L30-L76
In the catalog/stage component used at the catalog list page you don't have access to the product item because there's none (obviously).
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