Skip to content
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

Breadcrumb markup for products filed in a category #51

Open
dreamwhisper opened this issue Dec 17, 2019 · 1 comment
Open

Breadcrumb markup for products filed in a category #51

dreamwhisper opened this issue Dec 17, 2019 · 1 comment
Labels

Comments

@dreamwhisper
Copy link
Contributor

Describe the bug
Breadcrumb markup does not always follow the Genesis markup. As a result, styling applied to breadcrumbs does not work correctly for some WooCommerce pages.

To Reproduce
Steps to reproduce the behavior:

  1. Turn breadcrumbs on for Single Posts.
  2. Create a category and make sure at least one product is in the category.
  3. Visit the product. Note that the breadcrumb includes the category, but it is not wrapped with the breadcrumb-link-wrap span. The link also does not use the breadcrumb-link class.

Expected behavior
We need to update the Genesis Connect for WooCommerce breadcrumb output to ensure wrappers are consistent for categorized products.

@nickcernis
Copy link
Contributor

nickcernis commented Dec 17, 2019

Confirmed. Current source on a product page such as /product/product-name/ is:

<div class="breadcrumb" itemprop="breadcrumb" itemscope itemtype="https://schema.org/BreadcrumbList">You are here:
    <span class="breadcrumb-link-wrap" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
        <a class="breadcrumb-link" href="http://dev.test/" itemprop="item">
            <span class="breadcrumb-link-text-wrap"
                  itemprop="name">Home</span>
        </a>
        <meta itemprop="position" content="1">
    </span>
    <span aria-label="breadcrumb separator">/</span>
    <a href="http://dev.test/product-category/uncategorized/" title="Uncategorized">Uncategorized</a>
    <span aria-label="breadcrumb separator">/</span>Product Name
</div>

The issues @dreamwhisper noted are both visible there:

  • A separate breadcrumb-link-wrap should wrap the product category breadcrumb link.
  • The product category link (“Uncategorized” in this case) should take a class of breadcrumb-link, like the Home link.

In addition:

  • <meta itemprop="position" content="2"></span> is missing from the product category.
  • itemprop="item" is also missing.
  • The breadcrumb-link-text-wrap span is absent too.

Here's the (correct) expected output on a regular post for comparison:

<div class="breadcrumb" itemscope="" itemtype="https://schema.org/BreadcrumbList">You are here:
    <span class="breadcrumb-link-wrap" itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem">
        <a class="breadcrumb-link" href="http://dev.test/" itemprop="item">
            <span class="breadcrumb-link-text-wrap"
                  temprop="name">Home</span>
        </a>
        <meta itemprop="position" content="1">
    </span>
    <span aria-label="breadcrumb separator">/</span>
    <span class="breadcrumb-link-wrap" itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem">
        <a class="breadcrumb-link" href="http://dev.test/category/uncategorized/" itemprop="item">
            <span class="breadcrumb-link-text-wrap" itemprop="name">Uncategorized</span>
        </a>
        <meta itemprop="position" content="2"></span>
    <span aria-label="breadcrumb separator">/</span>The Secret Method to Creating the Perfect Amount of Simple
</div>

Noting that in Slack Jen pointed to gencwooc_get_single_crumb as a good place to start looking for the bug.

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

No branches or pull requests

2 participants