Commit 008b55c81c2 for woocommerce
commit 008b55c81c2486f6e0046e4f93005c2b92ba59ce
Author: TORANOSUKE TANIGAKI <155611269+Toraastrta@users.noreply.github.com>
Date: Mon Nov 16 18:40:21 2026 +0900
Remove unused interactivity state from Mini-Cart footer block (#70900)
* Remove unused interactivity state from Mini-Cart footer block
* Add changelog entry for Mini-Cart footer cleanup
* Remove unused cart getter and store namespace from Mini-Cart footer
* Add back get_cart_instance()
---------
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
diff --git a/plugins/woocommerce/changelog/fix-69026-mini-cart-footer-dead-state b/plugins/woocommerce/changelog/fix-69026-mini-cart-footer-dead-state
new file mode 100644
index 00000000000..cff014240d5
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-69026-mini-cart-footer-dead-state
@@ -0,0 +1,5 @@
+Significance: patch
+Type: dev
+Comment: Remove unused Interactivity API state from the Mini-Cart footer block; no merchant-facing change.
+
+
diff --git a/plugins/woocommerce/phpstan-baseline.neon b/plugins/woocommerce/phpstan-baseline.neon
index b7a6bd2044f..40024da958c 100644
--- a/plugins/woocommerce/phpstan-baseline.neon
+++ b/plugins/woocommerce/phpstan-baseline.neon
@@ -48363,18 +48363,6 @@ parameters:
count: 1
path: src/Blocks/BlockTypes/MiniCartFooterBlock.php
- -
- message: '#^Method Automattic\\WooCommerce\\Blocks\\BlockTypes\\MiniCartFooterBlock\:\:get_cart_instance\(\) should return WC_Cart but returns null\.$#'
- identifier: return.type
- count: 1
- path: src/Blocks/BlockTypes/MiniCartFooterBlock.php
-
- -
- message: '#^Parameter \#1 \$query of method WP_HTML_Tag_Processor\:\:next_tag\(\) expects array\{tag_name\?\: string\|null, match_offset\?\: int\|null, class_name\?\: string\|null, tag_closers\?\: string\|null\}\|null, ''bdi'' given\.$#'
- identifier: argument.type
- count: 1
- path: src/Blocks/BlockTypes/MiniCartFooterBlock.php
-
-
message: '#^Method Automattic\\WooCommerce\\Blocks\\BlockTypes\\MiniCartProductsTableBlock\:\:render\(\) should return string but returns string\|false\.$#'
identifier: return.type
diff --git a/plugins/woocommerce/src/Blocks/BlockTypes/MiniCartFooterBlock.php b/plugins/woocommerce/src/Blocks/BlockTypes/MiniCartFooterBlock.php
index 5825dde3e56..83a205b0b3e 100644
--- a/plugins/woocommerce/src/Blocks/BlockTypes/MiniCartFooterBlock.php
+++ b/plugins/woocommerce/src/Blocks/BlockTypes/MiniCartFooterBlock.php
@@ -1,9 +1,6 @@
<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;
-use Automattic\WooCommerce\Enums\TaxDisplayMode;
-
-
/**
* MiniCartFooterBlock class.
*/
@@ -40,33 +37,11 @@ class MiniCartFooterBlock extends AbstractInnerBlock {
*/
protected function render( $attributes, $content, $block ) {
ob_start();
-
- $cart = $this->get_cart_instance();
- $subtotal_label = __( 'Subtotal', 'woocommerce' );
- $other_costs_label = $this->get_totals_item_description();
- $display_cart_price_including_tax = get_option( 'woocommerce_tax_display_cart' ) === TaxDisplayMode::INCLUSIVE;
- $subtotal = $display_cart_price_including_tax ? $cart->get_subtotal_tax() : $cart->get_subtotal();
- $formatted_subtotal = '';
- $html = new \WP_HTML_Tag_Processor( wc_price( $subtotal ) );
- $wrapper_attributes = get_block_wrapper_attributes(
+ $subtotal_label = __( 'Subtotal', 'woocommerce' );
+ $other_costs_label = $this->get_totals_item_description();
+ $wrapper_attributes = get_block_wrapper_attributes(
array(
- 'data-wp-interactive' => 'woocommerce/mini-cart-footer-block',
- 'class' => 'wc-block-mini-cart__footer',
- )
- );
-
- if ( $html->next_tag( 'bdi' ) ) {
- while ( $html->next_token() ) {
- if ( '#text' === $html->get_token_name() ) {
- $formatted_subtotal .= $html->get_modifiable_text();
- }
- }
- }
-
- wp_interactivity_state(
- $this->get_full_block_name(),
- array(
- 'formattedSubtotal' => $formatted_subtotal,
+ 'class' => 'wc-block-mini-cart__footer',
)
);
@@ -104,9 +79,12 @@ class MiniCartFooterBlock extends AbstractInnerBlock {
/**
* Return the main instance of WC_Cart class.
*
- * @return \WC_Cart CartController class instance.
+ * @deprecated 11.4.0 Use WC()->cart instead.
+ * @return \WC_Cart|null
*/
protected function get_cart_instance() {
+ wc_deprecated_function( __METHOD__, '11.4.0', 'WC()->cart' );
+
$cart = WC()->cart;
if ( $cart && $cart instanceof \WC_Cart ) {