Why is my website's breadcrumb navigation not displaying correctly?

“Could someone help me with an issue I’m experiencing on my website? When I navigate from the homepage to a collection and then a specific product, the breadcrumbs aren’t displaying correctly. Even though I’m on a path like /collection/product, the breadcrumbs only show ‘homepage/product.’ Any ideas on how to fix this breadcrumb display problem?”

Hi @sao ,

This is not as issue actually. Shopify doesnot know where the user is coming from unless, we provide a collection on the product URL.

For example

  1. https://www.aiciavem.ro/products/sanie-plastic-pentru-copii

On this url, shopify does not know where the user is comming from. This is because one single product cn belong to multiple collections.

  1. https://www.aiciavem.ro/collections/copiii/products/sanie-plastic-pentru-copii

However, for this URL, shopify detects the product is visited from the collection /collections/copiii/. So the full breadcrumb is shown.

If you require further help, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!

Best Regards,
Makka

It is not like u say , actually you cant get from a collection to a product,you can enter on the website press on a collection ,press on a product and you ll see that the breadcrumbs will be only : home/product

Hi @sao ,

We can get from collection to a product. Shopify provides “within” filter which can we used to generate product URL based on the collection page they visited.

You can review the following collections pages for example. The breadcrumb will generate based on the collection page they are coming from.

https://mangit.myshopify.com/collections/for-men

https://mangit.myshopify.com/collections/for-women

For more information, you can visit shopify’s official documentation https://shopify.dev/docs/api/liquid/filters/within

Yes but I do not find what I need to activate to make it work normally, at my website www.aiciavem.ro you can t get a url like www.aiciavem.ro/collection/product .

Hi @sao ,

This will require updating template files. This code is not default present on the base template.