Skip to content

Commit b300692

Browse files
committed
Merge branch 'develop' into release/v2.0.5
2 parents 1019bf0 + a361808 commit b300692

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

modules/upsell-order-bump/includes/OrderBump.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ public function bump_product_frontend_view() {
108108
}
109109

110110
$_product = wc_get_product( $offer_product_id );
111+
112+
// FIX: If the offer product doesn't exist (deleted or invalid ID), skip it to avoid a fatal error.
113+
if ( ! $_product ) {
114+
continue;
115+
}
116+
111117
$regular_price = $_product->get_regular_price();
112118
// Use sale price if available, otherwise use regular price for discount calculation
113119
$current_price = $_product->get_sale_price() ? $_product->get_sale_price() : $regular_price;

0 commit comments

Comments
 (0)