Use an Agree to Terms Checkbox with Bold Upsell

Follow

Warning!

This is an unsupported theme customization. Please contact our Merchant Success team if you require further assistance.

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

  1. From Shopify's admin, select Online Store.

    select online store

  2. Select Actions.

    Actions

  3. Select Edit code.

    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's admin, select Apps.

    Select Apps

  8. Select Product Upsell.

    Select Product Upsell

  9. Select Settings, then Upsell Settings.

    Select Settings/Upsell Settings

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

    scroll down to advanced page settings

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

    enter the funtion

  12. Select Save.

    select save

That's it!

Next Steps:

Blog Posts:

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.