Reputation: 108
We have developed website using the shopify with timber.css. Now we have a requirement to connect external db to the website for some forms where customers can able to upload images. and that images should be saved in the external db. This should be done without using any apps. Which is the better way to achieve this?
Upvotes: 0
Views: 3559
Reputation: 11427
You can create a form that uses POST to send data to your DB. Of course you can. It is simple. Become a Shopify Partner. Create an App, with an App Proxy selected. Now use that Proxy as the endpoint that points to your server and DB. You'll be saving images, forms, whatever you want, securely and with whatever info you need.
You may want to store the customer ID, and the cart token for example, allowing you to connect any uploaded info to the customer and potential order.
Shopify is wicked for this, and very much capable of allowing you to hook up whatever you want.
Upvotes: 2
Reputation: 39399
Shopify is a hosted platform. If offers you theming and nothing more. You will not be able to do any server-side programming such as connecting to a website.
The only option you have is, to create a separate, externally-hosted application in front of your database, that exposes it via an API. Then, use AJAX to submit your form submissions.
The down side is your form will only function is your user is a browser with JavaScript enabled/available. But that’s the cost of using a hosted platform and not having total control.
Upvotes: 0