Commit ea005ea3e3 for woocommerce
commit ea005ea3e32528023c8ef31dd7b9a2524db7f7ca
Author: Luigi Teschio <gigitux@gmail.com>
Date: Thu Sep 18 09:05:11 2025 +0200
Refactor wcSettings assignment to handle multiple script loads (#60969)
Refactor wcSettings script initialization in AssetDataRegistry to simplify JSON parsing
diff --git a/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php b/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php
index 0a7dcde75e..c1c24c87b1 100644
--- a/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php
+++ b/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php
@@ -387,7 +387,7 @@ class AssetDataRegistry {
$this->execute_lazy_data();
$data = rawurlencode( wp_json_encode( $this->data ) );
- $wc_settings_script = "var wcSettings = wcSettings || JSON.parse( decodeURIComponent( '" . esc_js( $data ) . "' ) );";
+ $wc_settings_script = "var wcSettings = JSON.parse( decodeURIComponent( '" . esc_js( $data ) . "' ) );";
$preloaded_api_requests_script = '';
if ( count( $this->preloaded_api_requests ) > 0 ) {