Attache an image to a product

Solved
Highlighted
New Member
2 0 0

I am creating an app that enables users to "draw" an image and then order its print.

Can someone please give me a general road-map how I can do it?

1. How do I create front-face?

2. How do I attache an image to a product in the cart?

3. How do I display the image along with the products in admin?

0 Likes
Highlighted
Shopify Partner
111 10 25

If you want to allow users to upload images on the product page you can add something like this: 

 

<div class="YOUR CUSTOM CLASSES">            
   <label for="custom_photo">Custom Image</label>
   <input required id="custom_photo" type="file" name="properties[custom_image]" class="product-form__input">           
</div>

Not sure if this is exactly what you are looking for but this snippet def allows you to upload files and store them as line items. 

Want to customize or make changes to a theme? Hire me.
If my answer was helpful please Like and Accept Solution.
Email: oscar@sobefy.com
Website: Sobefy.com
0 Likes
Highlighted
New Member
2 0 0

Where can I paste this? I need the customer to be able to upload the file to the product they're purchasing, not merchant. Where will Shopify store the file? Do I need to add some code to store the file?

0 Likes
Highlighted
Shopify Partner
111 10 25

This is an accepted solution.

Yes, you have to add that snippet on the product page wherever you want it to appear. Recommended right before the add to cart button. 

The file will be stored in the order as a new field. You will have to use some css to style it tho. 

 

Use this snippet: 

 

<p class="line-item-property__field">
  <label for="your-image">Upload your image</label>
  <input id="your-image" type="file" name="properties[Your Image]">
</p>

 

Want to customize or make changes to a theme? Hire me.
If my answer was helpful please Like and Accept Solution.
Email: oscar@sobefy.com
Website: Sobefy.com
1 Like