Code for only specific product page in Focal Theme

Code for only specific product page in Focal Theme

eeputti
New Member
6 0 0

Hello All!

 

I want to make a few detailed changes to just one product on our Shopify page. This can't be done in the theme editor because of Focal Theme and needs coding.

 

I've now done a copy of the ''product-info.liquid'' and made the changes I wanted for the one product.

How can I now target this new ''product-info-staple-5-pack.liquid'' into just this one specific product? How can I find the product ID of that product or any other ideas?

 

Thank you so much.

Näyttökuva 2024-10-20 kello 11.45.45.png

 

Eelis

Reply 1 (1)

Olllie
Shopify Partner
121 11 23

Hey @eeputti 

 

What about something like this in your main product.liquid or product-info.liquid? It’s just a simple check to look for a specific product ID. You could then use the standard code for regular products while adding custom code for that specific product.

 

  <!-- Add your product ID here -->
{% assign specific_product_id = "123456789" %}

{% if product.id == specific_product_id %}
  <!-- Code to execute if the product ID matches -->
  <p>This is the specific product you are looking for!</p>
{% else %}
  <!-- Code to execute if the product ID does not match -->
  <p>This is not the specific product.</p>
{% endif %}

  

Ollie | Founder & Developer of autoBlogger and autoSchema

autoBlogger: Seamlessly scheduled, fully automated, AI-powered, and SEO-optimised blogging with FAQs, table of contents and other features! Start your 14-day free trial today!


autoSchema: Fully automated and continuously updated Google structured data, including duplicate data removal. Simple to install – try it now!


Discover more at autoBlogger.bot!