Import Python script that requires user input into shopify store

tempestcards
New Member
2 0 0

Hello, I have been searching forums about this but have really only had basic answers or advice regarding it.

Here is a comprehensive idea from another poster, Jason: "The python code would need to be created as middleware (an app) that sits between Shopify and Spotify. Once that’s live and accessible you could add JavaScript on the Shopify page that sends info to your app, that then queries Spotify. The AJAX response could then be used to inject items in the DOM. Not the only approach but the path that feels the most likely for you to follow."

I have a python program that I have hosted on my web server, and it is a simple text box with a submit button that calls a 3rd-party API based on the user input into the text box. The user input is the issue I cannot find an answer to in many forum posts and google searches I have done. I don't know how to implement this into my shopify store, nor how I would take the user input from the shopify store and send it to my python script

All in all I need a few things:

1) stylized textbox and submit button to show on a shopify page in my store

2) user inputs text, then presses button -> sends info to web server/app -> python script runs using user input -> returns data


3) Data is returned as a clickable url (or more preferred is it sends the user straight to the url after it finishes the api call)

So my question is, what is the easiest way I can get this to work, as I tried tinkering with the application extension proxy but that wasn't getting me anywhere.

0 Likes
Jason
Shopify Expert
10196 137 1923

Where are you trying to run this code?
Would have expected an AJAX request to your middlware to be a viable path, though there would be some privacy issues to consider depending on what the data is.

I jump on these forums to help and share some insights. Not looking to be hired, and not looking for work.

Don't hand out staff invites or give admin password to forum members unless absolutely needed. In most cases the help you need can be handled without that.


★ http://freakdesign.com.au ★
0 Likes
tempestcards
New Member
2 0 0

The code is run on my local server for now, publicly accessible via ngrock-flask. 

I’m aware of the privacy issues so I’m looking into a proxy solution. However to answer your point about Ajax, I might just not be skilled enough but I have no idea how to get the user input from the shopify storefront in order to make this a solution. 

If the program didn’t require input I can see why that would work.

0 Likes