Re: Add terms and conditions to my Paypal checkout
Daniels118
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Apr-14-2021
09:05 AM
If your button is generated by javascript you may add a transparent cover to intercept and block click events until the user accept the terms.
HTML
<div id="paypalButtonWrapper">
<div id="paypal-button"></div>
<div id="paypalButtonCover"></div>
</div>
<div id="paypal-accept">
<input type="checkbox" id="paypalAccept"/>
<label for="paypalAccept">I accept terms and conditions</label>
</div>
CSS
#paypalButtonWrapper {
position: relative;
}
#paypalButtonCover {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 999;
cursor: pointer;
}
Javascript
The following code uses jQuery, but it can be easily converted to pure js (this is left as an exercise):
$('#paypalButtonCover').click(function(e) {
alert("Please accept terms and conditions");
});
$('#paypalAccept').change(function() {
if ($(this).is(':checked')) {
$('#paypalButtonCover').hide();
} else {
$('#paypalButtonCover').show();
}
});
Regards
1 REPLY 1
Lydi229
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb-15-2023
06:24 AM
This is exactly what I need to do but I don't know how to put this information in my smart button code? Do you have an example of how the full smart button code would look like with the code provided on this page?
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
Related Content
- Simple easy Checkout integration for me website. in PayPal Payments Standard
- API approved order not forwarding to PayPal in Sandbox Environment
- Need help to integrate PayPal Advanced Checkout (PPCP) With Shift4Shop? in PayPal Upgrade Community
- How to style Paypal advanced checkout fields? in SDKs
- Need help to integrate PayPal Standard Checkout with Adyen? in PayPal Payments Standard