parent
f0641a5c05
commit
d37435eaea
|
@ -53,7 +53,6 @@ jQuery(document).ready(function($) {
|
|||
|
||||
// Changes button classes
|
||||
if ( $thisbutton.parent().find('.added_to_cart').size() == 0 )
|
||||
$thisbutton.addClass('added');
|
||||
$( '<a href="' + woocommerce_params.cart_url + '" class="added_to_cart" title="' + woocommerce_params.i18n_view_cart + '">' + woocommerce_params.i18n_view_cart + '</a>' ).insertAfter( $thisbutton ).hide().fadeIn( 100 );
|
||||
|
||||
// Cart widget load
|
||||
|
|
|
@ -1 +1 @@
|
|||
jQuery(document).ready(function(e){e(".add_to_cart_button").live("click",function(){var t=e(this);if(t.is(".product_type_simple, .product_type_downloadable, .product_type_virtual")){if(!t.attr("data-product_id"))return!0;t.removeClass("added");t.addClass("loading");var n={action:"woocommerce_add_to_cart",product_id:t.attr("data-product_id"),security:woocommerce_params.add_to_cart_nonce};e("body").trigger("adding_to_cart");e.post(woocommerce_params.ajax_url,n,function(r){var i=window.location.toString();i=i.replace("add-to-cart","added-to-cart");t.removeClass("loading");n=e.parseJSON(r);if(n.error&&n.product_url){window.location=n.product_url;return}fragments=n;fragments&&e.each(fragments,function(t,n){e(t).addClass("updating")});e(".widget_shopping_cart, .shop_table.cart, .updating, .cart_totals").fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+woocommerce_params.ajax_loader_url+") no-repeat center",opacity:.6}});t.parent().find(".added_to_cart").size()==0&&t.addClass("added");e('<a href="'+woocommerce_params.cart_url+'" class="added_to_cart" title="'+woocommerce_params.i18n_view_cart+'">'+woocommerce_params.i18n_view_cart+"</a>").insertAfter(t).hide().fadeIn(100);if(e(".widget_shopping_cart").size()>0)e(".widget_shopping_cart:eq(0)").load(i+" .widget_shopping_cart:eq(0) > *",function(){fragments&&e.each(fragments,function(t,n){e(t).replaceWith(n)});e(".widget_shopping_cart, .updating").stop(!0).css("opacity","1").unblock();e("body").trigger("cart_widget_refreshed")});else{fragments&&e.each(fragments,function(t,n){e(t).replaceWith(n)});e(".widget_shopping_cart, .updating").stop(!0).css("opacity","1").unblock()}e(".shop_table.cart").load(i+" .shop_table.cart:eq(0) > *",function(){e("div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)").addClass("buttons_added").append('<input type="button" value="+" id="add1" class="plus" />').prepend('<input type="button" value="-" id="minus1" class="minus" />');e(".shop_table.cart").stop(!0).css("opacity","1").unblock();e("body").trigger("cart_page_refreshed")});e(".cart_totals").load(i+" .cart_totals:eq(0) > *",function(){e(".cart_totals").stop(!0).css("opacity","1").unblock()});e("body").trigger("added_to_cart")});return!1}return!0})});
|
||||
jQuery(document).ready(function(e){e(".add_to_cart_button").live("click",function(){var t=e(this);if(t.is(".product_type_simple, .product_type_downloadable, .product_type_virtual")){if(!t.attr("data-product_id"))return!0;t.removeClass("added");t.addClass("loading");var n={action:"woocommerce_add_to_cart",product_id:t.attr("data-product_id"),security:woocommerce_params.add_to_cart_nonce};e("body").trigger("adding_to_cart");e.post(woocommerce_params.ajax_url,n,function(r){var i=window.location.toString();i=i.replace("add-to-cart","added-to-cart");t.removeClass("loading");n=e.parseJSON(r);if(n.error&&n.product_url){window.location=n.product_url;return}fragments=n;fragments&&e.each(fragments,function(t,n){e(t).addClass("updating")});e(".widget_shopping_cart, .shop_table.cart, .updating, .cart_totals").fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+woocommerce_params.ajax_loader_url+") no-repeat center",opacity:.6}});t.parent().find(".added_to_cart").size()==0&&e('<a href="'+woocommerce_params.cart_url+'" class="added_to_cart" title="'+woocommerce_params.i18n_view_cart+'">'+woocommerce_params.i18n_view_cart+"</a>").insertAfter(t).hide().fadeIn(100);if(e(".widget_shopping_cart").size()>0)e(".widget_shopping_cart:eq(0)").load(i+" .widget_shopping_cart:eq(0) > *",function(){fragments&&e.each(fragments,function(t,n){e(t).replaceWith(n)});e(".widget_shopping_cart, .updating").stop(!0).css("opacity","1").unblock();e("body").trigger("cart_widget_refreshed")});else{fragments&&e.each(fragments,function(t,n){e(t).replaceWith(n)});e(".widget_shopping_cart, .updating").stop(!0).css("opacity","1").unblock()}e(".shop_table.cart").load(i+" .shop_table.cart:eq(0) > *",function(){e("div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)").addClass("buttons_added").append('<input type="button" value="+" id="add1" class="plus" />').prepend('<input type="button" value="-" id="minus1" class="minus" />');e(".shop_table.cart").stop(!0).css("opacity","1").unblock();e("body").trigger("cart_page_refreshed")});e(".cart_totals").load(i+" .cart_totals:eq(0) > *",function(){e(".cart_totals").stop(!0).css("opacity","1").unblock()});e("body").trigger("added_to_cart")});return!1}return!0})});
|
Loading…
Reference in New Issue