Hi,
NOTE I had to copy/paste the entire article due to a shopify posting requirement.
PROBLEM:
I am needing help applying/integrating the directions from this article into Dawn theme for shopify. Shopify no longer gives access to the cart.liquid file and in trying to following the directions of the article, realize that the application of the necessary code is actually split between two files now, main-cart-items.liquid and main-cart-footer.liquid (that’s where the code for the button is).
I’m not a seasoned coder and whatever I’m doing isn’t working. My guess is that the original article was written to be implemented on one page/file (cart.liquid) and now the necessary info, etc. is split between the two .liquid files listed above.
Any help here would be great! THANK YOU!
Below is the article of reference:
Ask customer for additional information with jotForm
So you’re not a coder and you need to ask your customers for additional information on the cart page. The form you want to build is quite complex and the information you will collect will be applicable to ‘custom’ products. If you need to collect specific information per line item or per item, you will need to apply the solution outlined here instead. The solution described below is for those situations where the customization information is applicable to the entire order.
Add a special tag to your custom products
You’ll begin with adding a special tag to all your products that require you to present your customization form on the cart page.
Go to each product details page and click on the Edit link near the top of the page:
Type in your tag, or click on it, then click on the Update button.
Create a new snippet
Here, you’ll be creating a new Liquid snippet called ‘custom’.
Before you proceed, do backup your theme by downloading it on your Assets page.
Once you’ve created a backup of your theme, go to Assets then click on the Theme Editor link or tab.
On the Theme Editor page, click on the Add a new snippet link:
Type in ‘custom’ to create a custom.liquid snippet, then click on Create snippet.
Get the embed code for your JotForm
We won’t show here how to create your custom form in jotForm, we’ll simply show how to grab the code to embed the form on your website.
Look under the Setup & Share tab:
Click on the Share Form button:
Grab the code by selecting it and copying it to your clipboard using Ctrl-c:
Paste the jotForm in your snippet
Now go back to your Theme Editor page in Shopify and paste the jotForm code into the Liquid snippet.
Save.
Edit the Thank you setting on the jotForm website
Back to jotForm, we’ll edit where jotForm sends your customers upon submission of the form.
Look under the Setup & Share tab:
Click on the Thank You button:
Select Custom URL then click on Next.
Type in this URL:
http://shopname.myshopify.com/checkout
Replace the shopname.myshopify.com part with your shop URL.
Click on Finish.
Edit your cart.liquid template
Go to your Theme Editor page, and click on ‘cart’ under Templates to open the template cart.liquid in the online code editor.
At the top of the file, add this code:
{% assign needs_form = false %}
Then locate this code:
{% for item in cart.items %}
On the next line (after the above code), add this code:
{% if item.product.tags contains "custom" %}
{% assign needs_form = true %}
{% endif %}
Then, locate the code for your checkout button. The code will look like this:
<input type="submit" id="getout" name="checkout" value="PROCEED TO CHECKOUT" />
Replace the above code with that one:
{% if needs_form %}
{% include 'custom' %}
{% else %}
<input type="submit" id="getout" name="checkout" value="PROCEED TO CHECKOUT" />
{% endif %}
Save.
The modifications we made to cart.liquid have this effect: if any item in the cart is tagged with ‘custom’ (is a to-be-customized product), then we show the jotForm form instead of the checkout button.