a722c64 Jul 25, 2014
45 lines (38 sloc) 1.45 KB
<!DOCTYPE html>
<meta charset="utf-8" />
<form action="" method="post">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value="" />
<input type="hidden" name="item_name" value="Test Product" />
<input type="hidden" name="quantity" value="1" />
<input type="hidden" name="amount" value="1.00" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="shipping2" value="1.50">
<input type="hidden" name="shipping" value="2.50">
<strong>Test Product</strong>
<label><input type="checkbox" id="terms" name="terms" value="" /> I agree to the terms</label>
<input type="submit" name="submit" value="Add to cart" />
<script src="../dist/minicart.js"></script>
paypal.minicart.cart.on('checkout', function (evt) {
var hasAgreed = !!document.getElementById('terms').checked;
if (!hasAgreed) {
alert('You must agree to the terms!');