Shopify themes, liquid, logos, and UX
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
I've been able to add SKU as part of the display by adding this in the predictive-search.liquid for Dawn 2.0
<p> {%- assign current_variant = product.selected_or_first_available_variant -%}
<span>SKU: {{ current_variant.sku }}</span> </p>
There are two additional modifications I need,
1. Ability to search by SKU
2. After pressing enter on search, display SKU in the screen that appears from the 'Search'.
Please be specific about what code modifications are needed and where to include them.
Try adding variants.sku as a search parameter to search form behaviors.
i.e. ?q=variants.sku%1234abcd
The native shopify search for the online sales channel is very basic and introductory.
It isn't meant to meet increasingly specific demands. So it's all workarounds.
@greenonions wrote:Please be specific about what code modifications are needed and where to include them.
That feature is a large advanced customization beyond the scope of the forums.
Keep requests small and specific such as displaying/hiding some property, or styling.
Broadly you either need to:
If you need this customization explored and built then contact me by my email for services.
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.
Good Luck.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
Ability to search by SKU in Dawn V14.0 I had to edit assets/predictive-search.js
Look for the Fetch request and update as follows:
fetch(`${routes.predictive_search_url}?q=${encodeURIComponent(searchTerm)}&resources[type]=product&resources[options][unavailable_products]=hide&resources[options][fields]=title,variants.sku,product_type,variants.title§ion_id=predictive-search`,
{ signal: this.abortController.signal }
)
.then((response) => {
if (!response.ok) {
var error = new Error(response.status);
this.close();
throw error;
}
Hi, your code works, but I was wondering if it is possible to add something extra so that people can search a specific part of the SKU.
Let's say the item number SKU is: 99.5685.52.
I would like customer to search for 5685. and not the whole number beginning with 99.***
You think this is possible? Thx in advance
Thank you!