Solved

How can I show the SKU on the product page using Dawn theme?

adventmedia
Pathfinder
128 0 31

How do I display the SKU on the product page (using Dawn theme)? Isn't it already a metafield? Why doesn't SKU show up as a metafield when I got to edit metafields?

Accepted Solution (1)
Zworthkey
Shopify Partner
5581 642 1572

This is an accepted solution.

{% for variant in product.variants %}
{% if product.selected_or_first_available_variant.id == variant.id %}
<strong>SKU: {{ variant.sku }} </strong>
{% endif %}
{% endfor %}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($){
$(".no-js-hidden").on("click", function(){
var refreshint = setInterval(function(){
location.reload();
}, 1000);    });   });
</script>

@adventmedia 

Add this code where you want to show the SKU.

View solution in original post

Replies 14 (14)

Zworthkey
Shopify Partner
5581 642 1572

@adventmedia 
There is an already option to display and add the SKU from your Admin panel.
Let me know if you need help to add the Sku in your Product page.
We will happy to help you. 
Thank you.

adventmedia
Pathfinder
128 0 31

Where? Can the position of the SKU be moved on the product page? It does not appear in the customizer as far as I can see.

 

Zworthkey
Shopify Partner
5581 642 1572

Screenshot (24).png

adventmedia
Pathfinder
128 0 31

Yeah, I know where to input the SKU in the admin. What I want to know is how to make it display in the product page.

 

Zworthkey
Shopify Partner
5581 642 1572

@adventmedia 
Follow this link you will get it.
If you can't able to add it then you need to hire a developer,
https://help.shopify.com/en/manual/online-store/themes/themes-by-shopify/vintage-themes/customizing-...

 

thank you.

DelightCart
Shopify Partner
1238 82 157

@adventmedia May this help you. Click here

Delight Cart - It's time to turn your visitors into loyal shoppers! 

Delight Loyalty - Increase repeat sales quickly and build lifelong customers loyalty.
adventmedia
Pathfinder
128 0 31

NO that does not help. I already looked at it and it does not show anything for Shopify 2.0.

 

DelightCart
Shopify Partner
1238 82 157

Please refer this. Click here

 

The link show how to show the sku on product page.

Delight Cart - It's time to turn your visitors into loyal shoppers! 

Delight Loyalty - Increase repeat sales quickly and build lifelong customers loyalty.
adventmedia
Pathfinder
128 0 31

Why do you post the same link that is not a solution for Shopify 2.0?

Zworthkey
Shopify Partner
5581 642 1572

This is an accepted solution.

{% for variant in product.variants %}
{% if product.selected_or_first_available_variant.id == variant.id %}
<strong>SKU: {{ variant.sku }} </strong>
{% endif %}
{% endfor %}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($){
$(".no-js-hidden").on("click", function(){
var refreshint = setInterval(function(){
location.reload();
}, 1000);    });   });
</script>

@adventmedia 

Add this code where you want to show the SKU.

adventmedia
Pathfinder
128 0 31

Which template file? Dawn theme.

 

Zworthkey
Shopify Partner
5581 642 1572

@adventmedia 
Product.template.liquid or where you want to Show it,
Find the file and add it.

bumblebeelyfe
Tourist
5 0 3

@adventmedia @Zworthkey 

 

also you could customize the theme (Dawn 2.0 in this example) by adding a 'custom liquid' block on your product template page.  I added this exact code into the window and the sku popped up.

 

Please experts tell us if this is not efficient.

 

Screen Shot 2022-02-16 at 10.25.35 AM.png

 

 

Jdrake714
Shopify Partner
1 0 0

How do I implement this without it reloading the page every single time?