Skip to content

Commit 256d494

Browse files
Merge pull request #3953 from Shopify/jh_fix-discount-classes-2026-01
Fix invalid enum for discount classes in 2026-01
2 parents f1803ad + 53e6e36 commit 256d494

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

.changeset/fast-llamas-press.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/ui-extensions': patch
3+
---
4+
5+
Wrong types for discount classes

packages/ui-extensions/src/surfaces/admin/api/discount-function-settings/launch-options.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,7 @@ interface Metafield {
2424
/**
2525
* The discount class that determines where the discount applies in the purchase flow. Use this to understand what type of discount the merchant is configuring (product-level, order-level, or shipping).
2626
*/
27-
export enum DiscountClass {
28-
/** The discount applies to specific products or product variants. Use this for discounts that reduce the price of individual line items (for example, "20% off selected products"). */
29-
Product = 'PRODUCT',
30-
/** The discount applies to the entire order total. Use this for cart-wide discounts that reduce the subtotal (for example, "$10 off orders over $50"). */
31-
Order = 'ORDER',
32-
/** The discount applies to shipping costs. Use this for free shipping or reduced shipping rate discounts (for example, "Free shipping on orders over $100"). */
33-
Shipping = 'SHIPPING',
34-
}
27+
export type DiscountClass = 'product' | 'order' | 'shipping';
3528

3629
/**
3730
* The method used to apply a discount. Use `'automatic'` for discounts that apply automatically at checkout, or `'code'` for discounts that require a code entered by the customer.

0 commit comments

Comments
 (0)