SKU search then Populate Product Widget

New to Wix and coding. I’m looking to add a Product SKU Search only. So I have a page with text box and button (search). When I enter the SKU number in the textbox and click Search, I can see that it works.

I’d like to simply get that info loaded into a Product Widget. Widget works if I manually (use the settings) link it to a sku from the store…but I’m looking for the search result to populate the widget.

Can that be done?

Here is the code I have for the search:
export function button1_click(event) {
let MySku = $w( ‘#input1’ ).value;
wixSearch.search(MySku)
.documentType( “Stores/Products” )
.eq( “sku” , MySku)
.find()
.then( (results) => {
console.log(results.documents);

//Do something here to load the data into the widget

} );

Thanks for the help

I really hope someone will help you because it’s maddening to not be able to find products in the search bar with SKU. I don’t unerstand why it isn’t a thing already…

Bump

Hi there

Unfortunately, Wix Stores widget cannot be manipulated with code, your only choice is to build a custom widget to display the matching products when you search using the SKU.