var ajaxurl = "https://soundlister.com/wp-admin/admin-ajax.php"; function sumo_add_woocommerce_coupon(code) { jQuery.post(ajaxurl, { action: 'sumo_add_woocommerce_coupon', code: code, }); } function sumo_remove_woocommerce_coupon(code) { jQuery.post(ajaxurl, { action: 'sumo_remove_woocommerce_coupon', code: code, }); } function sumo_get_woocommerce_cart_subtotal(callback) { jQuery.ajax({ method: 'POST', url: ajaxurl, dataType: 'html', data: { action: 'sumo_get_woocommerce_cart_subtotal', }, success: function(subtotal) { return callback(null, subtotal); }, error: function(err) { return callback(err, 0); } }); }