Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I need to add the SKU to the product description text. I already have the SKU showing via the product info section, but I need it to go in the text for the product description. To be clear, not in a different tab or a different section, I need it in the main product description.
Most of our customers know our SKU numbers and when they type in the SKU in the search box, the main SKU is usually not the first option that comes up, sometimes, it doesn't come up in the search results at all. I figured out, if the SKU is in the description, it will show as the first product in the search results. However, we have over 3000 products, so it isn't feasible to type in the SKU in every product description, therefore, I wanted to use a liquid snippet, like so:
<div>Allparts {% if product.selected_or_first_available_variant.sku != blank %}
product # {{ product.selected_or_first_available_variant.sku }} {% endif %} </div>
Or something similar, but it only renders it correctly when I add that liquid snippet to a custom liquid block, in which case, it is no longer in the description block. It only works when it's in the description block. My website is allparts.com and for reference, one of the products that has this problem is EP-0055.
For this particular product, this is happening because this SKU is mentioned in the description of several kits that we offer. In the search results, the kits are coming up before the EP-0055. However, there are also other random products that coming up before the EP-0055 as well, I don't know why.
@michelleallpart
Sorry you are facing this issue,
It would be my pleasure to help you.
Please share your site URL,
I will check out the issue and provide you with a solution here.
Ok, I figured out how to make it render correctly but the search results don't see it somehow... it still shows EP-0055 after all the other products. When I manually type in the sku its moved to the first item in the search results, which is what I want.
@michelleallpart oh wow that would be great
Did you have a chance to look at it yet? (https://allparts.com) We use the Woodstock theme. I figured out how to show the SKU in the descriptions so all I need help with now is making the SKU searched for come up as the first search result.
I did, twice. 😊
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025