Have your say in Community Polls: What was/is your greatest motivation to start your own business?

How Can I Add A View Collection Button on Product Page?

Solved

How Can I Add A View Collection Button on Product Page?

Edith
Tourist
5 0 0

Can someone please help me place a back to collection button before the product description on product page in Kalles theme? Beside the product title or under the "buy button"

https://ibb.co/S3ZP6Mt 

Any ideas would be greatly appreciated. Thanks in advance!

Accepted Solution (1)

akshay_bhatt
Shopify Partner
115 10 13

This is an accepted solution.

Hi @Edith ,

To add a "Back to Collection" button before the product description in the Kalles theme:

  1. Log in to Shopify Admin and go to Online Store > Themes.

  2. Click Actions > Edit code on your Kalles theme.

  3. In Sections or Templates, find product-template.liquid

  4. Locate the product title or buy button section and add this code before the product description :

 

<a href="{{ collection.url }}" class="btn back-to-collection">Back to Collection</a>

 

Add the following to theme.scss.liquid for styling:

 

.back-to-collection {
    display: inline-block;
    margin: 10px 0;
    padding: 10px 20px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
}
​

 

Got it! If you found my suggestions helpful, please consider liking or marking it as a solution.
Your feedback is appreciated! If you have any more questions or need further assistance, just let me know.

Thanks & Regards
Akshay Bhatt

- Need a Shopify Specialist?
- Custom Design | Advanced Coding | Store Modifications
Email us

View solution in original post

Reply 1 (1)

akshay_bhatt
Shopify Partner
115 10 13

This is an accepted solution.

Hi @Edith ,

To add a "Back to Collection" button before the product description in the Kalles theme:

  1. Log in to Shopify Admin and go to Online Store > Themes.

  2. Click Actions > Edit code on your Kalles theme.

  3. In Sections or Templates, find product-template.liquid

  4. Locate the product title or buy button section and add this code before the product description :

 

<a href="{{ collection.url }}" class="btn back-to-collection">Back to Collection</a>

 

Add the following to theme.scss.liquid for styling:

 

.back-to-collection {
    display: inline-block;
    margin: 10px 0;
    padding: 10px 20px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
}
​

 

Got it! If you found my suggestions helpful, please consider liking or marking it as a solution.
Your feedback is appreciated! If you have any more questions or need further assistance, just let me know.

Thanks & Regards
Akshay Bhatt

- Need a Shopify Specialist?
- Custom Design | Advanced Coding | Store Modifications
Email us