Guest User

Untitled

a guest
Oct 24th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. if ($product && $count = 1) {
  2. if ($categoryIds = $product->getCustomAttribute('category_ids')) {
  3. foreach ($categoryIds->getValue() as $categoryId) {
  4. if ($categoryId != 39) {
  5. $category = $this->categoryRepository->get($categoryId);
  6. $catbreadcrumb = array("label" => $category->getName(), "link" => $category->getUrl());
  7. $breadcrumbsBlock->addCrumb("category" . $categoryId, $catbreadcrumb);
  8. $title[] = $category->getName();
  9. }
  10. }
  11. //add last product breadcrumb
  12. $prodbreadcrumb = array("label" => $product->getName(), "link" => "");
  13. $breadcrumbsBlock->addCrumb("product" . $product->getId(), $prodbreadcrumb);
  14. $title[] = $product->getName();
  15. }
  16. } else {
  17. foreach ($path as $name => $breadcrumb) {
  18. $breadcrumbsBlock->addCrumb($name, $breadcrumb);
  19. $title[] = $breadcrumb['label'];
  20. }
  21. }
Add Comment
Please, Sign In to add comment