Shopify themes, liquid, logos, and UX
Solved! Go to the solution
This is an accepted solution.
I have fixed the problem. Please mark this answer as accepted if it is working as desired.
{% assign vendorCollection = nil %}
{% for collection in product.collections %}
{% if collection.title == block.settings.text %}
{% assign vendorCollection = collection %}
{% break %}
{% endif %}
{% endfor %}
{% if vendorCollection %}
<p class="product--text {{ block.settings.text_style }}" {{ block.shopify_attributes }}>
<a href="{{ vendorCollection.url }}" title="{{ vendorCollection.title }}">{{- block.settings.text -}}</a>
</p>
{% else %}
<p class="product--text {{ block.settings.text_style }}" {{ block.shopify_attributes }}>
{{- block.settings.text -}}
</p>
{% endif %}
Hi. Can you please share your store url?
You want to link vendor to the vendor page or what?
i want it to link to a collection. different for each item
It is doable. Product page needed to be customized. Can you please share store credentials in the inbox so that I can fix the problem?
are you able to paste the code in here
The code varies with the theme. Let's give it a try.
1. Go to Online Store > Themes > Edit Code
2. Find product.liquid
3. Find <p>Vendor: {{ product.vendor }}</p>
4. Replace above code with the below one
{% assign vendorCollection = nil %}
{% for collection in collections.all %}
{% if collection.title == product.vendor %}
{% assign vendorCollection = collection %}
{% break %}
{% endif %}
{% endfor %}
{% if vendorCollection %}
<p><a href="{{ vendorCollection.url }}">{{ product.vendor }}</a></p>
{% else %}
<p>Vendor: {{ product.vendor }}</p>
{% endif %}
Please note that the above code assumes that each vendor's name corresponds to a collection with the same title. If you have a different setup, you'll need to adapt the code accordingly.
hi, i cannot find product.liquid or <p>Vendor: {{ product.vendor }}</p>
As I told before, it requires some technical knowledge. Not easy for some one to make changes without technical knowledge.
and where would i find someone to do it for me?
I may help you if you provide me access to the store. Go to settings > Users and Permissions and add me as a staff. My mail is in the footer of this message.
sent
Thanks, I now have access.
This is an accepted solution.
I have fixed the problem. Please mark this answer as accepted if it is working as desired.
{% assign vendorCollection = nil %}
{% for collection in product.collections %}
{% if collection.title == block.settings.text %}
{% assign vendorCollection = collection %}
{% break %}
{% endif %}
{% endfor %}
{% if vendorCollection %}
<p class="product--text {{ block.settings.text_style }}" {{ block.shopify_attributes }}>
<a href="{{ vendorCollection.url }}" title="{{ vendorCollection.title }}">{{- block.settings.text -}}</a>
</p>
{% else %}
<p class="product--text {{ block.settings.text_style }}" {{ block.shopify_attributes }}>
{{- block.settings.text -}}
</p>
{% endif %}
hi, that works yes thankyou very much! would you possbly be able to link it to the vendor button for items on the home screen too?
Aren't they already linked to vendor page?
Hi, yes they are but i want them to be linked to the collection with the same name instead
Sorry, I have tried it. They are linked with frontpage collections and hence we can't get url of other collections.
okay no worries, thankyou for the first part!
You're welcome.
Hey there, I have a similar problem.
I want my vendor button on the collection and product page linked to my different vendor collection, I created. I use the Molla Theme. Can someone help me out with this, too?
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