Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ($product && $count = 1) {
- if ($categoryIds = $product->getCustomAttribute('category_ids')) {
- foreach ($categoryIds->getValue() as $categoryId) {
- if ($categoryId != 39) {
- $category = $this->categoryRepository->get($categoryId);
- $catbreadcrumb = array("label" => $category->getName(), "link" => $category->getUrl());
- $breadcrumbsBlock->addCrumb("category" . $categoryId, $catbreadcrumb);
- $title[] = $category->getName();
- }
- }
- //add last product breadcrumb
- $prodbreadcrumb = array("label" => $product->getName(), "link" => "");
- $breadcrumbsBlock->addCrumb("product" . $product->getId(), $prodbreadcrumb);
- $title[] = $product->getName();
- }
- } else {
- foreach ($path as $name => $breadcrumb) {
- $breadcrumbsBlock->addCrumb($name, $breadcrumb);
- $title[] = $breadcrumb['label'];
- }
- }
Add Comment
Please, Sign In to add comment