All things Shopify and commerce
Hey everyone,
I could use some help with an issue I'm having. So, whenever I click on a product, the URL contains "/collections/name" like this:
But what I actually want is just this: https://wrapsify.com/products/classic-bike-keychain-to-my-man-ride-safe-always-come-home-to-me-gkt26...
I find the extra "/collections/motorcycle-gifts" part unnecessary and would prefer a cleaner URL like "wrapsify.com/products/...".
Does anyone know how I can fix this?
Thanks in advance!
Hi @wrapsify
For such URLs, there is a within: collection filter in your code, you have to remove it to get rid of it.
Thanks!
I want to remove /collections/ when accessing /products/ pages, is there any tutorial article?
No, actually you will find it in a file product-item.liquid, product-card.liquid or similar file
It depends upon theme and you need some liquid knowledge to remove it so that you don't remove any other part
Thanks!
You have a Turbo theme.
I do not know if your theme is the same version as the one I have, but in mine it's necessary to modify the following files:
In Sections:
product-recently-viewed-template.liquid
In Snippets:
collection-swatch.liquid
product-details.liquid
product-slider.liquid
product-thumbnail.liquid
quick-shop-button.liquid
You need to search for "| within: collection" and remove these found strings.
For example, in snippets/collection-swatch.liquid there is code like:
<a href="{{ variant.url | within: collection }}" class="swatch" ...
<a href="{{ variant.url }}" class="swatch" ...
There may be multiple occurrences in some files.
And do not forget to make a theme duplicate before you proceed with any modifications!
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024