Commit 9b130c7d86 for woocommerce

commit 9b130c7d867eb6460883bab92bbf2cb6e29d445d
Author: Néstor Soriano <konamiman@konamiman.com>
Date:   Wed Dec 17 09:48:31 2025 +0100

    Fix 'using null as array index' warning in variable products data store (#62452)

    $opposite_price_hash was compared against
    $price_hash but was not checked for null first,
    causing '$transient_cached_prices_array[ $opposite_price_hash ]'
    to throw a notice.

diff --git a/plugins/woocommerce/changelog/pr-62452 b/plugins/woocommerce/changelog/pr-62452
new file mode 100644
index 0000000000..eab77298ed
--- /dev/null
+++ b/plugins/woocommerce/changelog/pr-62452
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Fix using null as array index warning in variable products data store
diff --git a/plugins/woocommerce/includes/data-stores/class-wc-product-variable-data-store-cpt.php b/plugins/woocommerce/includes/data-stores/class-wc-product-variable-data-store-cpt.php
index 84fed0693b..c366a14380 100644
--- a/plugins/woocommerce/includes/data-stores/class-wc-product-variable-data-store-cpt.php
+++ b/plugins/woocommerce/includes/data-stores/class-wc-product-variable-data-store-cpt.php
@@ -305,7 +305,7 @@ class WC_Product_Variable_Data_Store_CPT extends WC_Product_Data_Store_CPT imple
 			// If the prices are not stored for this hash, generate them and add to the transient.
 			// Check also the opposite price hash as it may have changed (see get_price_hash).
 			if ( empty( $transient_cached_prices_array[ $price_hash ] ) ||
-				( ( $opposite_price_hash !== $price_hash ) && empty( $transient_cached_prices_array[ $opposite_price_hash ] ) ) ) {
+				( ! is_null( $opposite_price_hash ) && ( $opposite_price_hash !== $price_hash ) && empty( $transient_cached_prices_array[ $opposite_price_hash ] ) ) ) {
 				$prices_array = array(
 					'price'         => array(),
 					'regular_price' => array(),