How can I add the 'I agree to Terms and Conditions' check box?

FAQ: How can I add the 'I agree to Terms and Conditions' check box?

For the check box to be displayed on the Shopping Cart page:

1. Login to your Swifty platform, go to Manage Website > Edit Website

2. Select the Shopping Cart in the Website Map tree and switch to the Edit Page tab

3. Drag an HTML page section to the Shopping Cart page and place it after the Shopping Cart page section

 

4. Open the HTML section in the edit mode and add the following javascript code:

<script type="text/javascript">
if($(".wrapperShoppingCartDet .nofloat").length > 1){
    var checkboxBlock = $(".shoppingCartSection .nofloat")[2];
}
else{
    var checkboxBlock = $(".shoppingCartSection .nofloat")[1];
}
checkboxBlock.className=checkboxBlock.className + ' floatRight';
$(".shoppingCartSection .bigBtn[value='Checkout']").addClass("opacity checkoutButton");
$(".shoppingCartSection .checkoutBtn").addClass("opacity");
$(".shoppingCartSection .sep").addClass("opacity");
$(".shoppingCartSection .nofloat").css("font-size","100%");
$(".shoppingCartSection .bigBtn[value='Checkout']").css("margin-top","30px");
$(".shoppingCartSection .bigBtn[value='Checkout']").attr("disabled","disabled");
$(checkboxBlock).html("<input class='checkbox' type='checkbox' id='agreed'/><span class='text'>I agree to<a href='PAGE_URL' target='_blank'>Terms and Conditions</a></span>");
$(".shoppingCartSection .bigBtn[value='Checkout']").css("clear", "both");
$("#agreed").click(function(){
    var state = $(".shoppingCartSection .bigBtn[value='Checkout']").attr("disabled");
    if(state){
        $(".shoppingCartSection .bigBtn[value='Checkout']").removeAttr("disabled","disabled");
        $(".shoppingCartSection .bigBtn[value='Checkout']").removeClass("opacity");
        $(".shoppingCartSection .checkoutBtn").removeClass("opacity");
        $(".shoppingCartSection .sep").removeClass("opacity");
    }
    else{
        $(".shoppingCartSection .bigBtn[value='Checkout']").attr("disabled","disabled");
        $(".shoppingCartSection .bigBtn[value='Checkout']").addClass("opacity");
        $(".shoppingCartSection .checkoutBtn").addClass("opacity");
        $(".shoppingCartSection .sep").addClass("opacity");
    }

});
</script>



Where PAGE_URL is a full path to the corresponding Terms and Conditions page on the published site, e.g. http://domain.gplshops.com/page/Terms+and+Conditions


5. Click Done to save changes and publish the site for the changes to be applied online

Shopping Cart:

Checkbox is unticked:

 

Checkbox is ticked:

For the check box to be displayed on the Customer Registration page:

1. Go to Manage Website > Edit Website

2. Select the Customer Registration page (the Customer Account pages) in the Website Map tree and switch to the Edit Page tab

3. Drag an HTML page section to the Customer Registration page and place it after the Registration Form page section

4. Open the HTML section in the edit mode and add the following javascript code:

<script type="text/javascript">
var checkboxBlock = $(".form .nofloat")[0];
checkboxBlock.className=checkboxBlock.className + ' checkboxBlock';
$(".form .middleBtn").css("margin-top","10px");
$(".form .middleBtn").addClass("opacity");
$(".form .checkboxBlock").css("font-size","100%");
$(".form .middleBtn").attr("disabled","disabled");
$(checkboxBlock).html("<label>&nbsp;</label><input class='checkbox' type='checkbox' id='agreed'/><span class='text'>I agree to <a href='PAGE_URL' target='_blank'>Terms and Conditions</a></span>");
$("#agreed").click(function(){
    var state = $(".form .middleBtn").attr("disabled");
    if(state){
        $(".form .middleBtn").removeAttr("disabled","disabled");
        $(".form .middleBtn").removeClass("opacity");
    }
    else{
        $(".form .middleBtn").attr("disabled","disabled");
        $(".form .middleBtn").addClass("opacity");
    }
});
</script>



Where PAGE_URL is a full path to the corresponding Terms and Conditions page on the published site, e.g. 
http://domain.gplshops.com/page/Terms+and+Conditions

 

5. Click Done to save changes and publish the site for the changes to be applied online

Customer Registration:

Checkbox is unticked:

Checkbox is ticked:

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.