Prevent double add to cart with related products

This commit is contained in:
Mike Jolley 2012-06-05 00:53:04 +01:00
parent 7f6970c0ae
commit 439d21e395
3 changed files with 9 additions and 4 deletions

View File

@ -27,6 +27,10 @@ jQuery(document).ready(function($) {
// Ajax action
$.post( woocommerce_params.ajax_url, data, function(response) {
var this_page = window.location.toString();
this_page = this_page.split("?")[0];
$thisbutton.removeClass('loading');
// Get response
@ -54,7 +58,7 @@ jQuery(document).ready(function($) {
// Cart widget load
if ($('.widget_shopping_cart').size()>0) {
$('.widget_shopping_cart:eq(0)').load( window.location + ' .widget_shopping_cart:eq(0) > *', function() {
$('.widget_shopping_cart:eq(0)').load( this_page + ' .widget_shopping_cart:eq(0) > *', function() {
// Replace fragments
if (fragments) {
@ -81,7 +85,7 @@ jQuery(document).ready(function($) {
}
// Cart page elements
$('.shop_table.cart').load( window.location + ' .shop_table.cart:eq(0) > *', function() {
$('.shop_table.cart').load( this_page + ' .shop_table.cart:eq(0) > *', function() {
$("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" />');
@ -90,7 +94,7 @@ jQuery(document).ready(function($) {
$('body').trigger('cart_page_refreshed');
});
$('.cart_totals').load( window.location + ' .cart_totals:eq(0) > *', function() {
$('.cart_totals').load( this_page + ' .cart_totals:eq(0) > *', function() {
$('.cart_totals').css('opacity', '1').unblock();
});

File diff suppressed because one or more lines are too long

View File

@ -166,6 +166,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Fix - Cancelling adding an attribute blocks panel
* Fix - Variation duplication respects post status
* Fix - Minimum coupon amount check
* Fix - Prevent double add to cart with related products
* Localization - Updated localisations
= 1.5.6 - 17/05/2012 =