Skip to content

[Woo POS] Coupons: Present different views when discerning from no coupons in store vs empty search #15578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ struct PointOfSaleItemListEmptyViewModel {
return Localization.emptyProductsSearchSubtitle
case (.root, .products(search: false)):
return Localization.emptyProductsSubtitle
case (.root, .coupons):
case (.root, .coupons(search: false)):
return Localization.emptyCouponsSubtitle
case (.root, .coupons(search: true)):
return Localization.emptyCouponSearchSubtitle
case (.parent, .products):
return Localization.emptyVariableParentProductSubtitle
default:
Expand All @@ -160,7 +162,7 @@ struct PointOfSaleItemListEmptyViewModel {

var buttonTitle: String? {
switch itemListType {
case .coupons:
case .coupons(search: false):
return Localization.emptyCouponsButtonTitle
default:
return nil
Expand All @@ -183,7 +185,6 @@ struct PointOfSaleItemListEmptyViewModel {
value: "To add one, exit POS and go to Products.",
comment: "Text hinting the merchant to create a product."
)

static let emptyProductsSearchTitle = NSLocalizedString(
"pos.pointOfSaleItemListEmptyView.emptyProductsSearchTitle",
value: "No products found.",
Expand All @@ -199,7 +200,6 @@ struct PointOfSaleItemListEmptyViewModel {
value: "Variation names can't be searched, so use the parent product name.",
comment: "Text providing additional search tips when no products are found in the POS product search."
)

static let emptyVariableParentProductTitle = NSLocalizedString(
"pos.pointOfSaleItemListEmptyView.emptyVariableParentProductTitle",
value: "No supported variations found.",
Expand All @@ -215,7 +215,6 @@ struct PointOfSaleItemListEmptyViewModel {
value: "To add one, exit POS and edit this product in the Products tab.",
comment: "Text hinting the merchant to create a product."
)

static let emptyCouponsTitle = NSLocalizedString(
"pos.pointOfSaleItemListEmptyView.emptyCouponsTitle2",
value: "No coupons found",
Expand All @@ -231,5 +230,10 @@ struct PointOfSaleItemListEmptyViewModel {
value: "Create coupon",
comment: "Text for the button appearing on the coupons list screen when there's no coupons found."
)
static let emptyCouponSearchSubtitle = NSLocalizedString(
"pos.pointOfSaleItemListEmptyView.emptyCouponSearchSubtitle",
value: "Try adjusting your search term – searching part of a coupon name may help.",
comment: "Text appearing on the coupons list screen as subtitle when there's no coupons found."
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public final class PointOfSaleCouponService: PointOfSaleCouponServiceProtocol {
credentials: Credentials?,
storage: StorageManagerType) {
let network = AlamofireNetwork(credentials: credentials)
let remote = CouponsRemote(network: network)
self.init(siteID: siteID,
currencySettings: currencySettings,
settingStoreMethods: SettingStoreMethods(storageManager: storage, network: network),
Expand Down
Loading