Skip to content

Commit f17383c

Browse files
Mayishadiegocurbelo
authored andcommitted
[ECE] fix fatal error "Uncaught Error: Call to a member function get_total() on null" (#3599)
1 parent fb49207 commit f17383c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

includes/payment-methods/class-wc-stripe-express-checkout-helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ public function should_show_express_checkout_button() {
578578

579579
// Don't show if the total price is 0.
580580
// ToDo: support free trials. Free trials should be supported if the product does not require shipping.
581-
if ( ( ! ( $this->is_pay_for_order_page() || $this->is_product() ) && 0.0 === (float) WC()->cart->get_total( false ) )
581+
if ( ( ! ( $this->is_pay_for_order_page() || $this->is_product() ) && isset( WC()->cart ) && 0.0 === (float) WC()->cart->get_total( false ) )
582582
|| ( $this->is_product() && 0.0 === (float) $this->get_product()->get_price() )
583583
) {
584584
return false;

0 commit comments

Comments
 (0)