Skip to content

[Forwardport] Prevent not category links in breadcrumbs at product page #14994 #15480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

vovayatsyuk
Copy link
Member

It's a cherry-pick of #14994

Description

Magento 2.2.4 only.
When a product is opened from a homepage and menu has a link to the homepage,
two home links will be inserted into breadcrumbs.

Update: Added the case with "Contacts" link in the navigation.

Manual testing scenarios

  1. Open app/code/Magento/Theme/view/frontend/templates/html/topmenu.phtml
  2. Insert the following code:
<li class="level0 level-top" role="presentation">
    <a href="<?php echo $block->getUrl() ?>" class="level-top" tabindex="-1" role="menuitem"><span>Home</span></a>
</li>
<li class="level0 level-top" role="presentation">
    <a href="<?php echo $block->getUrl('contact') ?>" class="level-top" tabindex="-1" role="menuitem"><span>Contacts</span></a>
</li>

Right before

<?= /* @escapeNotVerified */ $_menu ?>
  1. Open homepage or contacts page
  2. Click on any product to navigate to its page (It may be a product in cart)
  3. Breadcrumbs will have two "Home" links, or Contacts page will be added into breadcrumbs.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-engcom-team
Copy link
Contributor

Hi @vovayatsyuk. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.3.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants