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?
Solved! Go to the solution
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.
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>