Skip to content

Commit eccd79a

Browse files
authored
Merge pull request #241 from woocommerce/fix/88-custom-payment
Order List: Improve custom payment labels
2 parents 37478fe + f9cd72b commit eccd79a

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

Networking/Networking/Model/OrderStatus.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ extension OrderStatus: RawRepresentable {
6464
extension OrderStatus: CustomStringConvertible {
6565

6666
/// Returns a string describing the current OrderStatus Instance
67+
/// Custom doesn't return a localized string because the payload arrives at runtime, not buildtime.
6768
///
6869
public var description: String {
6970
switch self {
@@ -74,7 +75,10 @@ extension OrderStatus: CustomStringConvertible {
7475
case .cancelled: return NSLocalizedString("Canceled", comment: "Cancelled Order Status")
7576
case .completed: return NSLocalizedString("Completed", comment: "Completed Order Status")
7677
case .refunded: return NSLocalizedString("Refunded", comment: "Refunded Order Status")
77-
case .custom(let payload): return NSLocalizedString("\(payload)", comment: "Custom Order Status")
78+
case .custom(let payload):
79+
return payload
80+
.replacingOccurrences(of: "-", with: " ")
81+
.capitalized
7882
}
7983
}
8084
}

WooCommerce/Classes/Model/Order+Woo.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ extension Order {
1515
return NSLocale(localeIdentifier: identifier).currencySymbol
1616
}
1717

18-
/// Determines if a shipping address exists.
19-
///
20-
var hasSeparateShippingDetail: Bool {
21-
return shippingAddress != nil
22-
}
23-
2418
/// FIXME: Creates an empty-string value Billing details, until i6 fix
2519
///
2620
func generateEmptyBillingAddress() -> Address {

0 commit comments

Comments
 (0)