Search Bar Integration With External E-commerce

Hello everyone,

I’m trying to figure out how I can get the input that I receive from a Webflow search bar, to be integrated into an external URL that will link out to the e-commerce store of this Webflow site.
The idea is that the user could search up “T-shirts” and the (I assume needed) custom code would take that input, and replace the endpoint URL to link out to whatever the search query was.

Just wondering if anyone has done this before or knows the best way to go about it!
Thank you.