How to add skus to all product descriptions using liquid snippet

How to add skus to all product descriptions using liquid snippet

michelleallpart
Shopify Partner
15 0 5

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_0-1738692076201.png

 

Replies 6 (6)

KetanKumar
Shopify Partner
37585 3668 12152

@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.

If helpful then please Like and Accept Solution. Partnership of your ️ Coffee Tips and my code can bring miracles.
Want to modify or custom changes on store Hire Me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
michelleallpart
Shopify Partner
15 0 5

As mentioned in the issue description above 😊, the URL is https://allparts.com

michelleallpart
Shopify Partner
15 0 5

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.

KetanKumar
Shopify Partner
37585 3668 12152

@michelleallpart oh wow that would be  great  

If helpful then please Like and Accept Solution. Partnership of your ️ Coffee Tips and my code can bring miracles.
Want to modify or custom changes on store Hire Me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
michelleallpart
Shopify Partner
15 0 5

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.  

michelleallpart
Shopify Partner
15 0 5

I did, twice. 😊