Unable to retrieve user uploaded image

Highlighted
New Member
2 0 0

Hellos, 

 

I have added the following the my theme (free to use theme)

{% form 'product', product, class:form_classes, novalidate: 'novalidate', data-product-form: '', enctype: 'multipart/form-data' %}
            <div class="product-form__controls-group">
              <div class="upload-btn-wrapper">
                <input name="properties[Uploaded image]" id="upload-input" type="file" accept="image/*" />
                <button id="upload-btn" class="btn">Upload a file</button>
              </div>
              <div class="image-preview-wrapper">
                <img id='upload-preview'>
              </div>
        	</div>
..... rest of the default items

And have also added a console.log() to the Theme.js file to see what data is being sent to the 'cart/add.js' and I get this:

form_type=product&utf8=%E2%9C%93&id=31439622930568&quantity=1

Nothing there says anything about the properties that I have added, is there an obvious mistake I have made? been looking and amending for a while and nothing seems to be fixing this.

 

EDIT:

Turns out, if you just set Ajax to false, it works, NVM!

 

0 Likes
Highlighted
Shopify Expert
2924 497 669

ok so is working now or still any problem?

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
1 Like
Highlighted
New Member
2 0 0

Thank you for the reply, I believe it is working now.

 

I initially got a lil confused as the add to cart was not working but the buy now button did work in the way to saw the properties input but didn't work in that the image was not uploaded.

 

I think I have got to a point that it works (after a few hours of trial and error), thank you

0 Likes