Liquid, JavaScript, themes, sales channels
Hi, feeling defeated so giving this forum a try.
Can anyone point me in the right direction to pull in the SKU code for title tag, please? I've found how to do this on product pages etc, but can't find anywhere that references how to include within title tag for SEO purposes.
Solved! Go to the solution
This is an accepted solution.
How exactly do you want it to be output? What if no sku exists? What if some variants have it but others don't?
General approach will be to find the title tag liquid usially in theme.liquid and then use some of this in it:
{%- assign current_variant = product.selected_or_first_available_variant -%} <span>{{ current_variant.sku }}</span>
This is an accepted solution.
How exactly do you want it to be output? What if no sku exists? What if some variants have it but others don't?
General approach will be to find the title tag liquid usially in theme.liquid and then use some of this in it:
{%- assign current_variant = product.selected_or_first_available_variant -%} <span>{{ current_variant.sku }}</span>
Thank you Kieran, worked a treat!
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024