Skip to main content
All CollectionsDocumentation
Storefront data sources
Storefront data sources

Details on available discount information on the storefront

Gavyn Leavitt avatar
Written by Gavyn Leavitt
Updated over a month ago

Liquid metafields

Discount data in liquid is stored in metafields saved on the shop object.

Discount summaries - shop.metafields.discount_kit.discount_information

Contains only the information necessary to determine if a discount is valid for the current customer.
​

.value {
lastRefreshedAt: Date
discounts: {
id: string
discountTitle: string
discountType: 'GWP' | 'ORDER_GOAL' | 'PRODUCT_VOLUME'
discountStatus: string
startsAt: Date
endsAt: Date | null
customerTags: string[]
marketHandles: string[]
currencyCode: string
}
}

Discount configuration - shop.metafields.discount_kit.discount_{{ discount_id }}

Contains individual discount information

.value {
discountTitle: string
discountType: 'GWP' | 'ORDER_GOAL' | 'PRODUCT_VOLUME'
discountStatus: string
discountNode: {
config: {
value
}
}
endsAt: Date | null
id: string
startsAt: Date
}

GWP discount products - shop.metafields.discount_kit.{{ discount_id }}_products

Contains an array of product drops for gift products related to a specific gift with purchase discount.

.value: Product[]

Currency conversion rate - shop.metafields.discount_kit.shop_currency_unit

Used for calculating an accurate conversion rate between the base shop currency and the cart currency.

.value: number

Javascript events

discount_kit:ready

This event is fired once after a page is loaded while the Core app embed is active. It provides an array of valid, available discounts.

details: {
discounts: {
config: DiscountConfig
discountId: string
discountTitle: string
discountType: 'GWP' | 'ORDER_GOAL' | 'PRODUCT_VOLUME'
endsAt: Date
startsAt: Date
}
}

Gift with purchase config

config: {
allowB2b: boolean
appliesOncePerCustomer: boolean
currencyCode: string
customerTags: string[]
discountTitle: string
discountType: 'GWP' | 'ORDER_GOAL' | 'PRODUCT_VOLUME'
marketHandles: string[]
matchRule: {
all: boolean
exclude: string[]
excludeSale: boolean
include: string[]
purchaseType: 'both' | 'oneTime' | 'subscription'
selection: {
id: string
variants: string[]
}[]
type: 'productSelection' | 'collection'
}
tiers: {
buys: {
type: 'minimumQuantity' : 'minimumSubtotal'
value: number
}
gets: {
matchRule: {
all: boolean
exclude: string[]
excludeSale: boolean
include: string[]
selection: {
id: string
variants: string[]
}[]
type: 'productSelection'
}
targetQuantity: number
type: 'fixedAmount' | 'percentage'
value: number
}
}
}

Order goal config

config: {
allowB2b: boolean
appliesOncePerCustomer: boolean
currencyCode: string
customerTags: string[]
discountTitle: string
discountType: 'GWP' | 'ORDER_GOAL' | 'PRODUCT_VOLUME'
marketHandles: string[]
tiers: {
buys: {
type: 'minimumSubtotal'
value: number
}
gets: {
type: 'fixedAmount' | 'percentage'
value: number
}
message: string | null
}[]
}

Product volume config

config: {
allowB2b: boolean
appliesOncePerCustomer: boolean
currencyCode: string
customerTags: string[]
discountTitle: string
discountType: 'GWP' | 'ORDER_GOAL' | 'PRODUCT_VOLUME'
marketHandles: string[]
matchRule: {
all: boolean
exclude: string[]
excludeSale: boolean
include: string[]
purchaseType: 'both' | 'oneTime' | 'subscription'
selection: {
id: string
variants: string[]
}[]
type: 'productSelection' | 'collection'
}
tiers: {
buys: {
type: 'minimumQuantity' : 'minimumSubtotal'
value: number
}
gets: {
type: 'fixedAmount' | 'percentage'
value: number
}
message: string | null
}
volumeType: 'mixAndMatch' | 'product' | 'productVariant'
}

discount_kit:gift_adjustments

Provides a list of gift products to add to, and cart lines to remove from, the cart as a result of changes to the cart.

add: {
discountId: string,
discountTitle: string
quantity: number
options: {
id: string
image: string,
priceRange: {
min: number
max: number
}
title: string
variants: {
available: boolean
id: string
title: string
image: string | null
price: number
}[]
}[]
}
remove: {
[lineKey]: 0
}

Did this answer your question?