Adding Image Upload / Line Item properties in 2.0 themes

I found a ton of useful info on how to add a file upload button to products that get linked to line item properties in the order, but all this only seems to work in older themes. For examples, see here and here.

I like how in 2.0, you can add custom liquid blocks, and I was able to use this to add in file upload buttons to my product pages (just by copying the liquid code from link 1 above into a custom liquid block), but the older tutorials all mention how you need to be able to disable the ajax cart options, and there’s no easy way to do this in Dawn, the default new 2.0 theme, like there was on Debut, the default pre-2.0 theme, and the result is that none of the images survive the ‘add to cart’ button click. So, I’m basically stuck using Debut, even though I really like these new 2.0 features and themes.

This seems like it’s going to be really easy to do using metafields once the order metafields update come (still says ‘coming soon’ in the metafields option screen), but does anyone know when that will be? Can I access them via liquid / API calls yet?

And has anyone been able to get an image upload button to work without using an App in 2.0? Specifically, solving the issue with disabling the ajax add to cart notification?

Note: I know there are apps out there for this, but frankly they all raise concerns to me regarding my customer’s privacy since every one I’ve tried requests blanket permission to access all my customer’s data, and after reading several of the app developer’s privacy policies, I just think there’s too much risk of one of them or their third party partners selling my customer’s information.

ok I might have found a workaround for anyone else struggling with this. I found this on the Dawn theme’s GitHub issue tracker. I haven’t tested this yet myself, but plan to soon.

a option is comment the product-form.js script
{% comment %}

{% endcomment %}

this is in sections/main-product.liquid line 11 aprox

nope… that fix, at least on its own still didn’t do it for me. Still having problems. Any insight would be much appreciated.

ok the timing here was freakish, but they just merged in a fix to the dawn theme so now we can add file uploads. See here: https://github.com/Shopify/dawn/pull/745. Follow the instructions in the thread to get it working. Hope this helps somebody…

3 Likes

Hi,

You can do this with few lines of code, no need to do a ajax. Image get pass on to the cart and even to the order. Check the video for more information

1 Like

First thank you for ur sharing

Sencond, how to upload multi-images?

I am in the same boat. I tried to add an image upload line and a text box for my customers to enter a short text but it seems like I can’t…I tried the steps in the link but it didn’t work well for me. I wonder if someone has a solution for it ?

Thanks!