<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>
Here's the link to view online: http://ift.tt/2b8vUu2
Select any city, click "add to cart" then click "checkout" to see the popup window.
If a button isn't possible maybe I can use a checkbox?
Aucun commentaire:
Enregistrer un commentaire