Adding SKU to Search Results

gina-gregory
Shopify Expert
710 48 181

Is it possible to update your data source for the product handles in your constructed spreadsheet so that it uses the new handleized title version?

0 Likes
Raphael_S_
Tourist
25 0 0

I'm afraid to not understand. Yes I could update my Spreasheet.

My process:

We migrated from an old site that worked with a Google Spreadsheet that contains all our datas of our catalog (titles, tags, artists, stock, ..) and that makes the final sheet for export in csv to shopify.

In this csv structure I didn't find a place to inform the url handle. So I changed it manually. I have to keep this Google Spreadsheet structure for further imports and updates of our stock that is handle in an other system.

I guess I undestand what the import do. Does it has a place to change the handle in the csv structure?

0 Likes
gina-gregory
Shopify Expert
710 48 181

The product handle should be the very first column in the CSV. Did you download the sample CSV template?

0 Likes
Raphael_S_
Tourist
25 0 0

Yes, I used it for almost two year with our shop :)

0 Likes
Raphael_S_
Tourist
25 0 0

Ok ok I guess I understood, thank you !

I usually used the handle column to display our catalog number in our Spreadsheet whitout thinking more, and though that the url are created with type+sku, but I was wrong:

Handles and urls are created by: Handle column and sku is linked to products & variants. Sorry, I finally ( I guess ) right understand these differents terms :)

I need to try. But If I'm right, I could add the new handle in the CSV file with the title.handle of Shopify and that won't create doubles cause that will be the same handles (need to be changed in the both locations for all modifications of course).

I mixed differents things !

Thank you !

0 Likes
Raphael_S_
Tourist
25 0 0

Gina merci !

Just one more thing:

If I changed the handles in the CSV file, did they automatically create url-redirect like proposed in the product admin page? Or I have to do it one by one ?

0 Likes
Raphael_S_
Tourist
25 0 0

Obviously not.. cause it will think that it's a new handle and will keep the old one too.

If I knew this before setting our website I would start with the product titles in handles but now we work with CD Number as an handle, and I have to modify each one manually to create url redirects to old urls. It's like that we learn :)

Thank you for your precious help, you could close this topic !

Best,

0 Likes
Thomas_Larsen
Tourist
11 0 1

Hi Raphael

I know this post is old - but I want to know how you added SKU to the search?

I tried alot of things, but nothing worked like your search(Which is awesome BTW)


Thanks in advance
/Thomas

- Thomas
0 Likes
Raphael_S_
Tourist
25 0 0

Hi Thomas,

I did it like this: {{ item.variants.first.sku }}

         <div class="search-result">
            
            <h3>{{ item.title | highlight: search.terms | link_to: item.url | within: collection }}</h3>
            {{ item.content | strip_html | truncatewords: 40 | highlight: search.terms }}
             
          </div>
          <br>
          <hr>
          {% if item.url contains "pages" %}
          
          <a href="{{ item.url | within: collection }}">Page: {{ item.handle | replace_first: '-', ' ' | upcase }}</a>
         
          {% else %}
          	{% if item.url contains "blogs" %}
         	 <a href="{{ item.url | within: collection }}">Press & review</a>
          
         	 {% else %}
          	<div class="search-result">
              
              <a href="{{ item.url | within: collection }}">Album</a>
              <br>
              Catalog N°: <a href="{{ item.url | within: collection }}">{{ item.type }} {{ item.variants.first.sku }} </a> / From collection: <a href="/collections/{{ item.collections.last.title | handle }}">{{ item.collections.last.title }}</a>

          
          </div>

If it could help.

 

0 Likes