how to add Collection title to product page (prestige theme)

Solved

how to add Collection title to product page (prestige theme)

Chriselle
Visitor
2 0 0

Hi there,

 

can anyone please let me know how to add collection title to my product page so that my products will display what collection they are under.

so below image, I want to add collection title in for each of my product on top of the product title 

Chriselle_0-1719919318978.png

greatly appreciated if anyone can help 

Accepted Solution (1)

Anshul_arora
Navigator
450 128 93

This is an accepted solution.

Hello @Chriselle ,

I understand you are looking to display Collection title above the Product title in the Product Detail Page.

For implementing this change you have to add small piece of code in your main-product.liquid file.

Please follow the steps for the desired change -:

1. Online Store -> Themes -> Click On three Dots (Action) -> Edit Code

2. Open main-product.liquid file and add the below shared code at the right place

3.

Anshul_arora_0-1720008923675.png

{% for collection in product.collections %}
<p class="collection-title">{{ collection.title }}</p>
{% endfor %}

 

I hope the solution helps you.

Thank you.

Please remember to like and accept the solution to help other store owners.

For Shopify Design & Development | Custom Coding -Visit Here

View solution in original post

Replies 2 (2)

ProtoMan44
Shopify Partner
506 43 80

@Chriselle Hey, thanks for posting here.
use this concept, hope it will work:

<div class="product">
  {% for collection in product.collections %}
    <h2>{{ collection.title }}</h2>
  {% endfor %}
  <h1>{{ product.title }}</h1>
  <!-- Other product details and markup -->
</div>
- A thirsty developer passionate about supporting the community. If you'd like to, you can  

Buy me a Coffee.


- Your Shopify Solution Specialist Get a Quote at

ProtoMan44

 - 

Chat On Whatsapp


Crafting exceptional e-commerce experiences to elevate your online presence. Let's build your success story together!

Anshul_arora
Navigator
450 128 93

This is an accepted solution.

Hello @Chriselle ,

I understand you are looking to display Collection title above the Product title in the Product Detail Page.

For implementing this change you have to add small piece of code in your main-product.liquid file.

Please follow the steps for the desired change -:

1. Online Store -> Themes -> Click On three Dots (Action) -> Edit Code

2. Open main-product.liquid file and add the below shared code at the right place

3.

Anshul_arora_0-1720008923675.png

{% for collection in product.collections %}
<p class="collection-title">{{ collection.title }}</p>
{% endfor %}

 

I hope the solution helps you.

Thank you.

Please remember to like and accept the solution to help other store owners.

For Shopify Design & Development | Custom Coding -Visit Here