In my shopify store I make custom arts based on customer's image. I need to add an image uploader where user selects the image and when they hit continue I should take them to checkout. I am using the debut theme. How can I make this happen?
-
Welcome to StackOverflow! We need to see what have you tried on your own in order to provide any help on the matter. Text only questions without any code and what was tried from the individual asking the question are usually ignored. – drip May 13 '20 at 08:47
-
Possible duplicate of https://stackoverflow.com/questions/58260731/upload-image-field-on-product-page-of-shopify-theme :) – Dave B May 13 '20 at 18:54
1 Answers
You can add additional details to a product by including an input field with a name
of properties[some-property-name]
, and this also works for input fields with a type
of file
.
For example, you could add the following to your product form to create an image upload field. (Note: Make sure your form has enctype="multipart/form-data"
set so that browsers submit the form correctly)
<input type="file" name="properties[Uploaded Image]" class="custom-upload" />
The resulting file will be uploaded to Shopify and will be accessible to you through the order in the Shopify admin. Your customers will be bound by whatever limits Shopify enforces regarding file sizes, which from a quick Google search looks to be set at 20MB currently.
NB: If your theme uses Javascript to submit your product form, it may or may not be compatible with file
inputs out-of-the-box. Many simple stay-on-page features assume that all of the form data can be treated as text, so would ignore your file field. Here's an answer to a similar question where I tried to provide some ideas on how you could get around this problem: https://stackoverflow.com/a/58271610/2592369

- 3,038
- 1
- 13
- 18