Append query string when removing item from cart to bust cache

Closes #6544
This commit is contained in:
Mike Jolley 2014-11-26 10:56:51 +00:00
parent 67d899da3a
commit c3fb83d443
2 changed files with 1 additions and 2 deletions

View File

@ -388,7 +388,7 @@ class WC_Form_Handler {
}
wc_add_notice( sprintf( __( '%s removed. %sUndo?%s', 'woocommerce' ), $product->get_title(), '<a href="' . $undo . '">', '</a>' ) );
$referer = wp_get_referer() ? remove_query_arg( array( 'remove_item' ), wp_get_referer() ) : WC()->cart->get_cart_url();
$referer = wp_get_referer() ? remove_query_arg( array( 'remove_item', 'add-to-cart', 'added-to-cart' ), add_query_arg( 'removed_item', '1', wp_get_referer() ) ) : WC()->cart->get_cart_url();
wp_safe_redirect( $referer );
exit;

View File

@ -31,7 +31,6 @@ if ( ! defined( 'ABSPATH' ) ) {
$product_name = apply_filters( 'woocommerce_cart_item_name', $_product->get_title(), $cart_item, $cart_item_key );
$thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key );
$product_price = apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key );
?>
<li>
<?php echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf( '<a href="%s" class="remove" title="%s">&times;</a>', esc_url( WC()->cart->get_remove_url( $cart_item_key ) ), __( 'Remove this item', 'woocommerce' ) ), $cart_item_key ); ?>