-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Description
EXPLANATION OF THE ISSUE
When I have a few stores created as a multisite with woocommerce installed, after adding product to cart AJAX request is initiated (wc-ajax=get_refreshed_fragments). If I have another tab opened (using google chrome) with the other store (from my multisite) another request starts inside this tab. So if I have two or more tabs with different stores opened in google chrome these requests are calling infinetely. I have tested with Storfront theme too. You can check how it works on this theme on themeforest (it has multisite). Just open two versions in different tabs and inspect it's requests after adding something to cart.
http://woodstock.temashdesign.com/electronics/
http://woodstock.temashdesign.com/watch/
Here is a screenshots of how it looks like
https://gyazo.com/1a6e53416603bd0a1b60359a363bec71
I guess it is because of this part of code
// Refresh when storage changes in another tab $( window ).on( 'storage onstorage', function ( e ) { if ( 'wc_cart_hash' === e.originalEvent.key && localStorage.getItem( 'wc_cart_hash' ) !== sessionStorage.getItem( 'wc_cart_hash' ) ) { $.ajax( $fragment_refresh ); } });
Because cart hashs are not equal between these two multisite.
Please give me some respond about this, maybe I do something wrong? If it is really a plugin issue I can try to prepare PR to fix this.
STEPS TO REPRODUCE THE ISSUE
- Create a multisite store
- Open two sites in different tabs
- Add something to cart
- Inspect AJAX requests
SYSTEM STATUS REPORT
`
### WordPress Environment ###
WC Version: 2.5.5
Log Directory Writable: ✔
WP Version: 4.5.2
WP Multisite: ✔
WP Memory Limit: 256 MB
WP Debug Mode: ✔
Language: en_US
### Server Environment ###
Server Info: Apache
PHP Version: 5.5.35
PHP Post Max Size: 800 MB
PHP Time Limit: 3000
PHP Max Input Vars: 5000
SUHOSIN Installed: –
MySQL Version: 5.5.49
Max Upload Size: 17 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔
### Database ###
WC Database Version: 2.5.5
:
woocommerce_sessions: ✔
woocommerce_api_keys: ✔
woocommerce_attribute_taxonomies: ✔
woocommerce_termmeta: ✔
woocommerce_downloadable_product_permissions: ✔
woocommerce_order_items: ✔
woocommerce_order_itemmeta: ✔
woocommerce_tax_rates: ✔
woocommerce_tax_rate_locations: ✔
### Active Plugins (18) ###
Menu Management Enhancer (WebStyle.Me - All For WebMasters...): by Chris Mavricos
SevenSpark – 1.1
Contact Form 7: by Takayuki Miyoshi – 4.4.2
Cookie Notice: by dFactory – 1.2.35
Plugin for showcase of elements: by Serg – 1.0.0
WPBakery Visual Composer: by Michael M - WPBakery.com – 4.11.2
Kraken Image Optimizer: by Karim Salman – 2.5.1
MailChimp for WordPress Lite: by ibericode – 2.3.15
Monster Widget: by Automattic – 0.3
Open Swatch - Woocommerce Color Swatch: by anhvnit@gmail.com – 1.0
Regenerate Thumbnails: by Alex Mills (Viper007Bond) – 2.2.6
Slider Revolution: by ThemePunch – 5.2.5.1
Woocommerce Monster Widget: by Alispx – 1.0.2
WooCommerce: by WooThemes – 2.5.5
WordPress Importer: by wordpressdotorg – 0.6.1
YITH WooCommerce Wishlist: by YITHEMES – 2.0.15
Regenerate Thumbnails: by Alex Mills (Viper007Bond) – 2.2.6
Transients Manager: by Pippin Williamson – 1.7.2
Yoast SEO: by Team Yoast – 3.2.5
W3 Total Cache: by Frederick Townes – 0.9.4.1
Widget Importer & Exporter: by Steven Gliebe – 1.2.4
SrcSet Responsive Images for Wordpress: by Benjamin Moody
Eric Holmes – 1.4
Menu Exporter: by Joe Hoyle - Human Made Limited – 1
### Settings ###
Force SSL: –
Currency: GBP (£)
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Number of Decimals: 2
### API ###
API Enabled: ✔
API Version: 3.1.0
### WC Pages ###
Shop Base: #4 - /shop/
Cart: #5 - /cart/
Checkout: #6 - /checkout/
My Account: #7 - /my-account/
### Taxonomies ###
Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable)
### Theme ###
Name: Storefront
Version: 1.6.1 – 2.0.1 is available
Author URL: http://www.woothemes.com
Child Theme: ✕ – If you're modifying WooCommerce on a parent theme you didn't build personally
then we recommend using a child theme. See: How to create a child theme
WooCommerce Support: ✔
### Templates ###
Overrides: –
`