Shopify themes, liquid, logos, and UX
Hi All!
I appreciate the help anyone can provide! I'm looking to make the Vendor/Brand name from product pages clickable and lead to auto-populated collections by vendor. I'm using this code:
{% if product.vendor %}
<div class="vendor-name">
Brand: <a href="/collections/vendors?q={{ product.vendor | handleize }}">{{ product.vendor }}</a>
</div>
{% endif %}
The problem is, for single-word vendors, it populates just fine, but if a vendor name is more than one word, it leads to a 404 page. I'm sure it's just a small thing I'm missing, but any ideas there? Thanks again!
Solved! Go to the solution
This is an accepted solution.
Hi @MontanaGC 👋 Confirm if it's a url encoding problem, try manually replacing the space, or dashes, with the space url encoding: %20.
The vendor value is being put into a query parameter so it needs to be url encoded not handelize as that inserts dashes and the vendor name does not have spaces in it.
https://shopify.github.io/liquid/filters/url_encode/ , e.g. q={{ product.vendor | url_encode }}
If you need this debugged further or theme customization then contact me for services
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
This is an accepted solution.
Hi @MontanaGC 👋 Confirm if it's a url encoding problem, try manually replacing the space, or dashes, with the space url encoding: %20.
The vendor value is being put into a query parameter so it needs to be url encoded not handelize as that inserts dashes and the vendor name does not have spaces in it.
https://shopify.github.io/liquid/filters/url_encode/ , e.g. q={{ product.vendor | url_encode }}
If you need this debugged further or theme customization then contact me for services
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
This worked like a charm! Thanks, Paul!
Hey 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, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024