Product not within the collection URL

Hi,

I dont understand why my product URL is not part of my collection URL.

This is the collection showing all my products: https://florence-streif.com/collections/alle-abstrakte-kunstwerke

and then when I click into a product it goes to: https://florence-streif.com/products/pouring-nature

instead of: https://florence-streif.com/collections/alle-abstrakte-kunstwerke/products/pouring-nature

Can somebody help me with that?

Thanks a lot!

Florence

Hi @Florence_4

You can add the collection to product URL by following the steps:

  • Go to your store admin > Sale channels > open Online store
  • In Themes > click “…” in your current theme > Edit code
  • Open card-product.liquid file, find this line of code href="{{ card_product.url }} around line 155
  • Replace it with this code href="{{ card_product.url | within: collection }}
  • Save your file.

Hi @Dan-From-Ryviu

thanks, it worked for the navigation going from the collection page to a product, but it does not work when I click directly on a product from the entry page - and it still is under the path products and not collections:

when I click on the first, I land on: https://florence-streif.com/products/pouring-nature

why do these URLs even exists? Do I need to redirect all of them now?

Thanks

Florence

@Dan-From-Ryviu would be great if you can help me. Thanks!

Hi @Florence_4

It can be added to the collection URL if you click on the product on the collection page only.

@Dan-From-Ryviu but then I have 2 URLs for the same product. That’s not good. Is there a different solution?

https://florence-streif.com/products/pouring-nature

https://florence-streif.com/collections/alle-abstrakten-kunstwerke/products/pouring-nature