Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit 9ffa14a

Browse files
committed
Do not skip items even if $_product is set to an unexpected value (less strict/more tolerant).
1 parent c4035a0 commit 9ffa14a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

templates/myaccount/subscription-totals-table.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
'entity_type' => gettype( $_product ),
3636
)
3737
);
38-
continue;
3938
}
4039

4140
if ( apply_filters( 'woocommerce_order_item_visible', true, $item ) ) {
@@ -51,7 +50,7 @@
5150
<?php endif; ?>
5251
<td class="product-name">
5352
<?php
54-
if ( $_product && ! $_product->is_visible() ) {
53+
if ( is_a( $_product, WC_Product::class ) && ! $_product->is_visible() ) {
5554
echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item['name'], $item, false ) );
5655
} else {
5756
echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', sprintf( '<a href="%s">%s</a>', get_permalink( $item['product_id'] ), $item['name'] ), $item, false ) );
@@ -89,7 +88,8 @@
8988
<?php
9089
}
9190

92-
$purchase_note = $_product->get_purchase_note();
91+
$purchase_note = is_a( $_product, WC_Product::class ) ? $_product->get_purchase_note() : false;
92+
9393
if ( $subscription->has_status( array( 'completed', 'processing' ) ) && $purchase_note ) {
9494
?>
9595
<tr class="product-purchase-note">

0 commit comments

Comments
 (0)