diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 9d2c85db378..9b7152f6cb1 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -6,6 +6,7 @@ - [*] Fix incorrect info banner color and signature option spacing on Carrier and Rates screen. [https://github.com/woocommerce/woocommerce-ios/pull/5144] - [x] Fix an error where merchants were unable to connect to valid stores when they have other stores with corrupted information https://github.com/woocommerce/woocommerce-ios/pull/5161 - [*] Shipping Labels: The shipping address now prefills the phone number from the billing address if a shipping phone number is not available. [https://github.com/woocommerce/woocommerce-ios/pull/5177] +- [*] Shipping Labels: now in Carrier and Rates we always display the discounted rate instead of the retail rate if available. [https://github.com/woocommerce/woocommerce-ios/pull/5188] 7.7 ----- diff --git a/WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/Create Shipping Label Form/Carriers and Rates/ShippingLabelCarrierRowViewModel.swift b/WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/Create Shipping Label Form/Carriers and Rates/ShippingLabelCarrierRowViewModel.swift index 0c9060b3c22..c338f1a62ac 100644 --- a/WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/Create Shipping Label Form/Carriers and Rates/ShippingLabelCarrierRowViewModel.swift +++ b/WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/Create Shipping Label Form/Carriers and Rates/ShippingLabelCarrierRowViewModel.swift @@ -58,12 +58,12 @@ struct ShippingLabelCarrierRowViewModel: Identifiable { price = { if signatureSelected, let signatureRate = signatureRate { - return currencyFormatter.formatAmount(Decimal(signatureRate.retailRate)) ?? "" + return currencyFormatter.formatAmount(Decimal(signatureRate.rate)) ?? "" } if adultSignatureSelected, let adultSignatureRate = adultSignatureRate { - return currencyFormatter.formatAmount(Decimal(adultSignatureRate.retailRate)) ?? "" + return currencyFormatter.formatAmount(Decimal(adultSignatureRate.rate)) ?? "" } - return currencyFormatter.formatAmount(Decimal(rate.retailRate)) ?? "" + return currencyFormatter.formatAmount(Decimal(rate.rate)) ?? "" }() carrierLogo = CarrierLogo(rawValue: rate.carrierID)?.image() @@ -92,14 +92,14 @@ struct ShippingLabelCarrierRowViewModel: Identifiable { displayAdultSignatureRequired = adultSignatureRate != nil if displaySignatureRequired, let signatureRate = signatureRate { - let amount = currencyFormatter.formatAmount(Decimal(signatureRate.retailRate - rate.retailRate)) ?? "" + let amount = currencyFormatter.formatAmount(Decimal(signatureRate.rate - rate.rate)) ?? "" signatureRequiredText = String(format: Localization.signatureRequired, amount) } else { signatureRequiredText = "" } if displayAdultSignatureRequired, let adultSignatureRate = adultSignatureRate { - let amount = currencyFormatter.formatAmount(Decimal(adultSignatureRate.retailRate - rate.retailRate)) ?? "" + let amount = currencyFormatter.formatAmount(Decimal(adultSignatureRate.rate - rate.rate)) ?? "" adultSignatureRequiredText = String(format: Localization.adultSignatureRequired, amount) } else { diff --git a/WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/Create Shipping Label Form/ShippingLabelFormViewModel.swift b/WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/Create Shipping Label Form/ShippingLabelFormViewModel.swift index becd56d5309..86c908b5716 100644 --- a/WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/Create Shipping Label Form/ShippingLabelFormViewModel.swift +++ b/WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/Create Shipping Label Form/ShippingLabelFormViewModel.swift @@ -352,7 +352,7 @@ final class ShippingLabelFormViewModel { if selectedRates.count == 1, let selectedRate = selectedRates.first { let currencyFormatter = CurrencyFormatter(currencySettings: ServiceLocator.currencySettings) - let price = currencyFormatter.formatAmount(Decimal(selectedRate.retailRate)) ?? "" + let price = currencyFormatter.formatAmount(Decimal(selectedRate.totalRate)) ?? "" let formatString = selectedRate.rate.deliveryDays == 1 ? Localization.businessDaySingular : Localization.businessDaysPlural @@ -365,7 +365,7 @@ final class ShippingLabelFormViewModel { } else { let ratesCount = String(format: Localization.selectedRatesCount, selectedRates.count) - let total = selectedRates.reduce(0, { $0 + $1.retailRate }) + let total = selectedRates.reduce(0, { $0 + $1.totalRate }) let currencyFormatter = CurrencyFormatter(currencySettings: ServiceLocator.currencySettings) let price = currencyFormatter.formatAmount(Decimal(total)) ?? "" let totalRate = String(format: Localization.totalRate, price) @@ -395,7 +395,7 @@ final class ShippingLabelFormViewModel { } let currencyFormatter = CurrencyFormatter(currencySettings: ServiceLocator.currencySettings) return selectedRates.map { rate in - currencyFormatter.formatAmount(Decimal(rate.retailRate)) ?? "" + currencyFormatter.formatAmount(Decimal(rate.totalRate)) ?? "" } }