Skip to main content

Metafield configuration

Sammy Isseyegh avatar
Written by Sammy Isseyegh
Updated over 2 weeks ago

Discount Kit's product and variant metafield 'Custom Data' configuration allows you to specify information that can be used inside the Custom Discount. It is structured as follows:

type CustomData = {
tag?: String // optional, and used only in the 'grouping' mechanism
discount_message?: String // optional, defaults to discount title
discount_percentage?: number, // optional, 1-100
discount_value?: number // optional, in cents unit, 100 = $1
discount_title?: String // only used with an array of configurations
}​


This configuration is wrapped by a discount. This means you get all of the other benefits of a Discount Kit discount (manual or automatic codes, scheduling, targeting specific customers, targeting specific markets), but can change the discounted variants, their values and their messaging at any time!

It's now also possible to specify different configurations, for different discounts. To do this, specify an array of configurations, each specifying the matching discount_title. If you specify multiple configurations for the same discount, only the first matching configuration will be used:

type CustomDatas = CustomData[]


Did this answer your question?