From bda186338cc2af44acb01bf331668ee3610acd35 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Mon, 30 Apr 2018 11:28:51 +0100 Subject: [PATCH] Adds the template to the fragment name so that switching themes invalidates any fragments created under the previous theme --- includes/class-wc-frontend-scripts.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/class-wc-frontend-scripts.php b/includes/class-wc-frontend-scripts.php index 1cd103ec400..ac2dab80ca8 100644 --- a/includes/class-wc-frontend-scripts.php +++ b/includes/class-wc-frontend-scripts.php @@ -535,8 +535,8 @@ class WC_Frontend_Scripts { $params = array( 'ajax_url' => WC()->ajax_url(), 'wc_ajax_url' => WC_AJAX::get_endpoint( '%%endpoint%%' ), - 'cart_hash_key' => apply_filters( 'woocommerce_cart_hash_key', 'wc_cart_hash_' . md5( get_current_blog_id() . '_' . get_site_url( get_current_blog_id(), '/' ) ) ), - 'fragment_name' => apply_filters( 'woocommerce_cart_fragment_name', 'wc_fragments_' . md5( get_current_blog_id() . '_' . get_site_url( get_current_blog_id(), '/' ) ) ), + 'cart_hash_key' => apply_filters( 'woocommerce_cart_hash_key', 'wc_cart_hash_' . md5( get_current_blog_id() . '_' . get_site_url( get_current_blog_id(), '/' ) . get_template() ) ), + 'fragment_name' => apply_filters( 'woocommerce_cart_fragment_name', 'wc_fragments_' . md5( get_current_blog_id() . '_' . get_site_url( get_current_blog_id(), '/' ) . get_template() ) ), ); break; case 'wc-add-to-cart':