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!
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024