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
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?
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.
User | RANK |
---|---|
163 | |
142 | |
74 | |
66 | |
56 |
Explore the 30-30-30 rule, a dynamic social media strategy for new businesses. Learn how t...
By Trevor Sep 20, 2023Discover how to leverage the often overlooked footer of your ecommerce site to gain custom...
By Skye Sep 15, 2023In this blog, we’ll be shining a light on Shopify Partners, Experts, and Affiliates. Who a...
By Imogen Sep 13, 2023