<script>
jQuery(function() {
var $ = jQuery;
$(document).on('touchstart mouseover', 'a#wsite-com-minicart-checkout-button', function(e) {
var totalCount = $( "span#wsite-nav-cart-num" ).text();
var totalNeeded = 12;
if (totalCount < totalNeeded) {
var totalItems = totalNeeded - totalCount;
$("a#wsite-com-minicart-checkout-button").click(function(event){
event.stopImmediatePropagation();
alert('Orders under ' + totalNeeded + ' packages are only available for pickup. Click "Order for Pickup" to proceed to checkout. If not, click "OK" and add ' + totalItems + ' more packages for us to ship your order.');
return false;
});
}
});
});
</script>
这是在线查看的链接:http: //poloniafoods.weebly.com/store/p10/kozackie
选择任何城市,点击“添加到购物车”,然后点击“结帐”即可看到弹出窗口。
如果一个按钮是不可能的,也许我可以使用一个复选框?