Link image and title on home page to a product

isabellemaria
Trailblazer
195 1 24

Hi there,

 

I would like to link the title and image of my product "Peeling Handschuh" on my website www.taneraskin.com to the page https://taneraskin.com/products/peeling-handschuh .

 

In this section: So that when you click on the title or image, it leads you to the product.

Bildschirmfoto 2024-05-27 um 17.41.35.png

 

 

What code do I have to add and where?

 

Thank you for your help.

 

Best regards,

 

Isabelle

Reply 1 (1)

Liqiud_xPert_SJ
Shopify Partner
978 117 151

@isabellemaria 

 

For this purpose you need to customize the theme files like featured-product.liquid like something i did below.

 

Online Store > Theme Edit > Edit Code > Section > featured-product.liquid

{%- when 'title' -%}
                <h2 class="product__title {{ block.settings.heading_size }}" {{ block.shopify_attributes }}>
                  {%- if product.title != blank -%}
                    {{ product.title | escape }}
                  {%- else -%}
                    {{ 'onboarding.product_title' | t }}
                  {%- endif -%}
                </h2>

////////////////to this

{%- when 'title' -%}
                <h2 class="product__title {{ block.settings.heading_size }}" {{ block.shopify_attributes }}>
		<a href="{{ product.url}}">	
                  {%- if product.title != blank -%}
                    {{ product.title | escape }}
                  {%- else -%}
                    {{ 'onboarding.product_title' | t }}
                  {%- endif -%}
		</a>
                </h2>

 

2024-05-28 10_13_19-Window.png

- If you need any technical assistance, feel free to send me a DM. You no longer have to search for answers without getting a response.
- Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
- Your Shopify Solution Specialist For further discussion contact: Email ID- Liqud_3xPert_SJ OR Whatsapp
- Buy a Coffee for me to get more frequently help 🙂
- Hire Me to unlock the full potential of your e-commerce store Now 🙂- If you need any technical assistance, feel free to send me a DM. You no longer have to search for answers without getting a response.
- Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
- Your Shopify Solution Specialist For further discussion contact: Email ID- Liqud_3xPert_SJ OR Whatsapp
- Buy a Coffee for me to get more frequently help 🙂
- Hire Me to unlock the full potential of your e-commerce store Now 🙂