I’m currently switching my shop to the new Dawn theme and my original theme was based on Debut. It seems that the Dawn theme uses an Ajax cart to submit an add to cart action, but I’m unable to add the chosen line item properties. Can anybody help me with the code I need to change, or add to the product-form.js file to achieve this?
Thanks for your rapid reply, but I’m looking for a solution that we can share here with others who face the same issue, so if you could post a fix for the Dawn theme to handle line item properties, it would be much appreciated.
Here’s the line item property I have added to the product template which works in the old Debut theme, but doesn’t work in the new Dawn theme, because the old Debut theme didn’t use Ajax and the new Dawn theme has a complete new way of handling the add to cart functionality:
Ok, here’s my working solution, it’s not pretty and I’m sure it could be done better, but it works and hopefully people that need it can adjust it to their needs:
This solution works fine but requires an update to product-form.js
Does anyone know how line item properties can be used by theme app extensions? In other words, how can a section on the product page contribute to the line item properties without modifying the theme files?
While I was launching a preorder app, the dawn theme came out, and of course upon testing, the add-to-cart js literately doesn’t support lineitem properties in the form.
Which means that any merchant using this theme can not have line-item properties added to their cart forms without customizing a main js asset file. Is this going to be fixed via Shopify, or is it what it is?
I found that the answer they gave was to take and modify the global.js file. Can you not modify this file or add attributes, because the original intention of the theme of 2.0 is not to operate on the theme of the customer’s store through application extension
If Pull request #391 (or something similar) is to be implemented, would that retroactively update every stores dawn theme, or, will this be a caveat for any merchant who would like to add lineitem properties in their forms going forward?
So all I had to do in the end was change 1 line in ‘product-form.js’ and all my line items work great. Even with different line items on different products.
However, I need to do this for MULTIPLE properties on the same product and not all products have the same properties.
Also, it appears to work only for the last property on the page. I actually have to remove from the JS file the other properties or add to cart just causes the cursor to spin.
SO, can anyone direct me on how to do this for multiple properties, please?