Min and Max Quantity for WooCommerce
By BeRocket
Min/Max Quantities (Paid)
Developed by WooCommerce
Define quantity rules for orders, products and variations
WooCommerce PDF Invoices & Packing Slips
By Ewout Fernhout
by dev
By BeRocket
Developed by WooCommerce
Define quantity rules for orders, products and variations
By Ewout Fernhout
/**
* Track external/affiliate link clicks snippet
*/
function candc_track_affiliate_clicks_script() {
?>
<script>
;
( function( $ ) {
"use strict";
// current page host
var baseURI = window.location.host;
// click event on body
$("p.cart").on("click", function(e) {
// abandon if link already aborted or analytics is not available
if (e.isDefaultPrevented() || typeof ga !== "function") return;
// abandon if no active link or link within domain
var link = $(e.target).closest("a");
if (link.length != 1 || baseURI == link[0].host) return;
// cancel event and record outbound link
e.preventDefault();
var href = link[0].href;
ga('send', {
'hitType': 'event',
'eventCategory': 'External Affiliate Link',
'eventAction': 'clicked',
'eventLabel': href,
'hitCallback': loadPage
});
// redirect after one second if recording takes too long
setTimeout(loadPage, 1000);
// redirect to outbound page
function loadPage() {
document.location = href;
}
});
// Close anon function.
}( jQuery ) );
</script>
<?php
}
add_action( 'wp_footer', 'candc_track_affiliate_clicks_script' );