Remove The Collection Name From A Product URL in Motion theme

Hello!

In all my collection pages, the links to the products are in this format:
/collection/collectionname/product/productname

These urls are canonicalized to /product/productname

So I would like to have the canonical urls of the products to be found from my collections, and thus to /product/productname.

I’m trying to see where in the liquid files of the Motion theme we could make this modification.

Thanks for your help

Check the snippet called product-grid-item and look for code like

{{ product.url | within: collection }}

You should remove the

| within: collection

part (may be more than one location).

This may affect some functionality (if it’s present) like back to collection button, next/prev product buttons, breadcrumbs.

Hi, Tim - I’m trying to do the same in Prestige and I don’t have a snippet called product-grid-item… any suggestions of where to look?

thanks, lk