From 1fd1699bcdea477f4f47b326ce4224dd1530c311 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Thu, 10 Aug 2017 11:25:08 +0100 Subject: [PATCH] Ensure isset --- includes/class-wc-cart-totals.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-cart-totals.php b/includes/class-wc-cart-totals.php index 2362e1555b5..d3afd8a02d2 100644 --- a/includes/class-wc-cart-totals.php +++ b/includes/class-wc-cart-totals.php @@ -311,7 +311,7 @@ final class WC_Cart_Totals { */ protected function get_discounted_price_in_cents( $item_key ) { $item = $this->items[ $item_key ]; - $price = $item->subtotal - $this->discount_totals[ $item_key ]; + $price = isset( $this->discount_totals[ $item_key ] ) ? $item->subtotal - $this->discount_totals[ $item_key ] : $item->subtotal; if ( $item->price_includes_tax ) { $price += $item->subtotal_tax;