Shopify themes, liquid, logos, and UX
You can add an I agree with the terms and conditions checkbox to your cart page that customers must check before continuing to the checkout. If a customer doesn't check the checkbox before clicking the checkout button, an alert pop up will prevent them from continuing.
Tip: It's not possible to add the checkbox to the checkout pages. It can be added only to the cart page that exists at http://www.your-shop-URL.com/cart.
The steps for this tutorial differ depending on whether you are using a sectioned or a non-sectioned theme. A sectioned theme is a newer theme that lets you drag and drop to arrange the layout of your store's pages.
To figure out whether your theme supports sections, go to the theme's Edit code page. If there are files in the Sections directory, you are using a sectioned theme. Non-sectioned themes were released before October 2016, and do not have files in the Sections directory.
If you are using a sectioned theme, then click the Sectioned themes button and follow the instructions. If you are using an older, non-sectioned theme, then click the Non-sectioned themes button and follow the instructions.
TyW | Online Community Manager @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
Hi Ty,
thank oyu so much - this is soooo helpful for no-coders like me 🙂 thanks a million!
may I add one non-coder question? How do I manage to translate the now showing texts? I have been foolishly trying to add the "agree" id to the language json files, but (of course) I failed 🙂
Could you give me a hint?
Thank you so much and best
Romy
Hi I did this for the Brooklyn theme and some how I deleted something where now I on my site you can't even check out. I followed your directions but seemed to have deleted the wrong thing PLEASE HELP!
This is what it is currently on the Assets- Theme.js.liquid currently;
// theme.checkoutIndicator();
// Add a loading indicator on the cart checkout button (/cart and drawer)
theme.cache.$body.on('click', '.cart__checkout', function() {
$(this).addClass('btn--loading');
});
This was extremely helpful thank you.
I have followed the exact steps and successfully have my checkbox.
Is it also possible to add the refund policy to this statement so it would instead say I agree with the Terms and conditions and Refund policy
Many thanks
Super easy and straightforward
Are we able to view the Terms & Conditions Checkbox after the cart page? Is there an overview order page that shows the customer selected the Terms & Condition box? I am looking for evidence the customer selected this box on the order page or elsewhere to provide in the event of chargebacks.
I added the code you have posted on your comment, the box is there and able to be checked... I am not getting the prompt when the box is left uncheck and I then click check out.
Hi,
Please can you advise what needs to be done to the new Dawn theme for this to work ie add the checkbox and restrict the customer from continuing unless they have "checked" the box. Many thanks 🙂
Hi there. Followed all the steps to do so but hit an issue with the dialog warning not popping up if the checkbox isn't checked-off.
Any recommendations on how to solve?
I added the codes to my my Dawn Theme and able to see the terms and conditions box, but it is not alligned properly, how to allign it? Also the Check out Box became more height
Please help me
this tutorial was extremely helpful. My only question is how do we get the "Agreed to terms & conditions" to show up on the order confirmation and our notification of order. unfortunately sometimes we need to provide proof to them that they agreed .
I also want to know the same:
1. How can we show proof/confirmation that the terms are checked?
2. Can we ensure that customer cannot proceed to checkout until the checkbox is ticked?
@TyW Hello! I have inserted the two code snippets for the sectioned theme, the checkbox is there, however you can still go to the checkout without checking the box. I tried the js version script edit but could not find it within theme.liquid. This is on the Prestige theme, do you happen to have further insight on this solution for this particular theme? Thank you!
I am using Crave theme. So that I am following steps for sectioned themes. However, I can't find theme.js or theme.js.liquid under the my code. I am able to input the check box but not function. Please help.
Worked like a charm in the Clean Canvas Symmetry (Shopify 2.0) theme. Thank you!
Hello!
This worked great for me on the Dawn theme!
Just one thing, the box shows a check mark by default. Anyway to remove it so that a customer has to manually check the check box by clicking on it with their mouse?
This worked really well. Thank you! I used the first set of codes on your list. I do not see the added terms and conditions on mobile or iPads. Is there a solution for this?
Hello. I've added this code to my Narrative with Installments message Theme but the Terms and Conditions are still not showing up. What did I do wrong? Website is www.bisontrack.com
Used the sectioned Theme instructions and everything worked, except for the warning doesn't pop up. You can still check out without selecting you agree. Any advice on this? I'm using the Block Shop Theme. This is what I found.
//<script type="text/javascript">
window.lazySizesConfig = window.lazySizesConfig || {};
window.lazySizesConfig.expand = 1200;
window.lazySizesConfig.loadMode = 3;
window.lazySizesConfig.ricTimeout = 50;
</script>
{{ 'lazysizes.min.js' | asset_url | script_tag }}
{{ '//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js' | script_tag }}
{{ '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js' | script_tag }}
{{ 'api.jquery.js' | shopify_asset_url | script_tag }}
{{ 'option_selection.js' | shopify_asset_url | script_tag }}
{% if template contains 'customers' %}
{{ 'shopify_common.js' | shopify_asset_url | script_tag }}
{{ 'customer_area.js' | shopify_asset_url | script_tag }}
{% endif %}
<script>//
thank you for this helpful tutorial 🙂
Hi dclopez, I am using Blockshop as well did this work for you end the end?
Hi, the info for the Brooklin theme does not match to the code. Why is it so ? I need a solution to this subject. I can not edit the code due to this problem.
Can you add the 2 sections here?
What if there is no theme.js or theme.js.liquid file and only a theme.min.js file?
Please can I have some assistance with this.
Hi, I followed the tutorial and everything is great, except for one thing. If I use internet explorer to reach the shop, in the shopping cart page the checkout button vanishes and doesn't work properly. The popup for consent doesn't come out and you can't finalize the payment
Tip: It's not possible to add the checkbox to the checkout pages. It can be added only to the cart page that exists at http://www.your-shop-URL.com/cart.
And this is exactly the kind of restrictions that make me move to another solution as soon as I can, because -aside of the fact that I don't feel free to do what I want with my shop- the checkbox is a mandatory thing in some countries, and having it in the cart before payment pages is a very bad choice as it hurts conversions.
It's a shame that shopify don't offer the possibility to add this checkbox........
Nice tutorial, pretty easy to implement BUT... Is there a way to translate the text shown on the page and the popup that appears if the box is not checked ?
Thanks, I got this working fine on Debut theme. However it's not immediately obvious that you have to click the text to proceed, see screenshot.
Debut theme does not allow a different colour for links only. Anyway to underline the text to make it more obvious to at least have the hover colour different?
Thanks
Hi, this works great for me with only one issue. The text and checkbox appear next to the "checkout" button instead of right above. Is there a way to do it as it's pictured in the screenshot? Thank you!
I can see that the checkbox has been added to the "cart page" in the editor:
However, when the cart icon is clicked on the home page and the "quick view" is used it does not appear and can be bypassed:
I am using the Narrative theme, hoping someone can help me with a fix. Thanks!
Hi TyW and thank you . I have followed your tuto to the letter and magic : the checkbox is there in my cart but the link does not work. Either something wrong with the URL I entered or maybe it comes from the fact that I created the page which was automatically integrated to the footer menu "Link". I tried several combinations of the url without success . Can you help me further ? The last one I entered is href= "/policies/terms-of-service" ... The theme is Minimal. Should I create a separate page ? Cheers
Hi,
Is it possible to make another type of warning? Just like on contact forms where the text goes red or something..
Can I add a second one to my contact form?
Don't understand why shopify don't add this option on the checkout page..
Hi,
My store is multilanguage (2 languages). I managed to add this checkbox to my store and even got text next to it displayed in correct language, but cannot figure out how to fix text in alert popup window so it is displayed in correct (user chosen) language. Any tips on this?
Hello,
I would like to ask if it is possible to add this checkbox to the checkout page right above the continue to shipping button
I do not have enough expertise to do it of the top of my head and I am seeking help.
@Anthonymikha
Hey Anthony,
No, it is not. The checkout page is not customizable unless you're using the Pro plan (the one that starts at $2.000 USD/month).
Kind regards,
Diego
@Anthonymikha
Yep, in this case it surely would be possible. Would require custom coding though, a solution developed by a programmer. There is not a copy/paste solution for this.
If it's of your interest feel free to reach me out via email,
diego.boarutto.fortes@gmail.com
Kind regards,
Diego
Hello,
I Use the Brooklyn theme and unfortunately I Have a problem with the first step. When I add the code in the end, my shop looks messed up. Is there another solution?
Kind regards
Fatih
..........
I am using the Debut theme and I have everything in the code but it isn't making it mandatory. Any idea what I am doing wrong?
Never mind, I figured it out. Thanks!
I am having the same issue.
can you tell me how you figured it out?
For the debut theme there was an extra step in the instructions!
What is the extra step, can you not tell us what it is instead of not providing the answer? I am using debut and cannot get it working either and have tried everything.
Hi there everybody so i've figured it out myself and instead of telling you I figured it out, I am actually going to reveal to you how to do it.
I am using debut theme, yet I wonder if this is the reason why most people cannot get it to work in the other themes.
The trick is adding this code in a new custom.js file, as debut theme preloads theme.js and I think this is why as most people will add jquery below this file, so it loads before jquery causing it not to work. So creating a new file and keeping it separate works better:
$(document).ready(function() {
$('body').on('click', '[name="checkout"], [name="goto_pp"], [name="goto_gc"]', function() {
if ($('#agree').is(':checked')) {
$(this).submit();
}
else {
alert("You must agree with the terms and conditions of sales to check out.");
return false;
}
});
});
So find where you added your jquery and make sure this new custom.js file is in the code below it.
So where I have jqeury loading in theme.liquid in the header:
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> : I added my new custom.s file with the code in it right below. Just like this, on a new line right below.
{{ 'custom.js' | asset_url | script_tag }}
Hopefully this helps. 🙂
Hi Idwithin,
Just to thank you for the trick, it worked for me.
My problem was that it was possible to click on the Checkout button and continue even if the "Agree to terms" checkbox was not selected.
I noticed that the popup windows appears very near the top of the screen, do you know by any chance how to make it show in the center of the screen?
Thank you,
Mike
I told you how to figure it out so the snark is not necessary. I was busy at the time and didn’t see your response until now. Had you read the instructions like I said you would have seen it.
✌🏻
How did you fix? Same issue.
The year-end shopping spree is around the corner! Is your online store ready for the ...
By JasonH Nov 10, 2024We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024