From bbdcdc923ad42689a3871f3660fb8ec77abfa2a6 Mon Sep 17 00:00:00 2001 From: Primoz Cigler Date: Sat, 18 Oct 2014 20:54:25 +0200 Subject: [PATCH] Added the filter for the ajax cart_hash, because in some cases (for example when using WPML) the empty string does not refresh the page fragments properly. --- includes/class-wc-ajax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-ajax.php b/includes/class-wc-ajax.php index 545d734b134..5fc2389c85d 100644 --- a/includes/class-wc-ajax.php +++ b/includes/class-wc-ajax.php @@ -96,7 +96,7 @@ class WC_AJAX { 'div.widget_shopping_cart_content' => '
' . $mini_cart . '
' ) ), - 'cart_hash' => WC()->cart->get_cart() ? md5( json_encode( WC()->cart->get_cart() ) ) : '' + 'cart_hash' => apply_filters( 'add_to_cart_cart_hash', WC()->cart->get_cart() ? md5( json_encode( WC()->cart->get_cart() ) ) : '', WC()->cart->get_cart() ) ); wp_send_json( $data );