From 02b3f2fccc04c923b55ba8b3ce92a45a72957f21 Mon Sep 17 00:00:00 2001 From: Darren Ethier Date: Mon, 9 Mar 2020 08:52:25 -0400 Subject: [PATCH] add defaults for cart data totals object (https://github.com/woocommerce/woocommerce-blocks/pull/1896) --- .../assets/js/data/cart/reducers.js | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/plugins/woocommerce-blocks/assets/js/data/cart/reducers.js b/plugins/woocommerce-blocks/assets/js/data/cart/reducers.js index 616cf97c7ba..52fde20f145 100644 --- a/plugins/woocommerce-blocks/assets/js/data/cart/reducers.js +++ b/plugins/woocommerce-blocks/assets/js/data/cart/reducers.js @@ -51,7 +51,26 @@ const reducer = ( itemsCount: 0, itemsWeight: 0, needsShipping: true, - totals: {}, + totals: { + currency_code: '', + currency_symbol: '', + currency_minor_unit: 2, + currency_decimal_separator: '.', + currency_thousand_separator: ',', + currency_prefix: '', + currency_suffix: '', + total_items: 0, + total_items_tax: 0, + total_fees: 0, + total_fees_tax: 0, + total_discount: 0, + total_discount_tax: 0, + total_shipping: 0, + total_shipping_tax: 0, + total_price: 0, + total_tax: 0, + tax_lines: [], + }, }, metaData: {}, errors: [],