Top

Use an Agree to Terms Checkbox with Product Upsell

Warning!

This is an unsupported theme customization. If you need help setting it up, Email our Support Wizards.

If you would like to use an "agree to terms" checkbox in your cart along with Product Upsell, follow these steps:

  1. From "Shopify Admin", select Online Store.

    select online store 

  2. Select Actions.

    Select Actions 

  3. Select Edit code.

    Select Edit code 

  4. Under "Layout", select theme.liquid.

    select theme.liquid 

  5. Add this code above the </body> tag in the file: 
    <script>
    function termCheck(){
     if($('#agree').is(':checked')){
     return true
     } else {
     return false
     }
    }
    
    $('[name="checkout"], input[name="goto_pp"], input[name="goto_gc"]').click(function() {
    if($('#agree').is(':checked')){
    $(this).submit();
    }
    else{ alert("You must agree with the terms and conditions of sales to check out."); return false; } }); </script>

    add this code to the bottom of the file 

  6. Select Save.

    select save 

  7. From "Shopify Admin", select Apps.

    Select Apps 

  8. Select Product Upsell.

    Select Product Upsell 

  9. Select Settings.

    Select Settings 

  10. Select Upsell Settings.

    Select Upsell Settings 

  11. Scroll down to the "Advanced Page Settings" section.

    scroll down to advanced page settings 

  12. Under "Checkout Upsell Page", in the "Enter function to call before upsell" field enter: termCheck()

    enter the funtion 

  13. Select Save.

    select save 

That's it!