Adding Image Upload / Line Item properties in 2.0 themes

Solved
Slokie
Tourist
4 1 1

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. 

Accepted Solution (1)

Accepted Solutions
Slokie
Tourist
4 1 1

This is an accepted solution.

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...

View solution in original post

Replies 3 (3)
Slokie
Tourist
4 1 1

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 %}

<script src="{{ 'product-form.js' | asset_url }}" defer="defer"></script>
{% endcomment %}

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

 

Slokie
Tourist
4 1 1

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

Slokie
Tourist
4 1 1

This is an accepted solution.

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...

View solution in original post