Skip to main content
Metafield configuration
Sammy Isseyegh avatar
Written by Sammy Isseyegh
Updated over a week ago

Discount Kit's 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
}


It can be used in two specific ways. The first, as a mechanism to group large numbers of variants together. Shopify collections are fantastic, but you can only group products, rather than variants.


Here, we can reference all variants that have the "tag" value of "foo", in a group called "GIFT CARDS".

Let's say you want to select all 'Large' variants of all t-shirts across your catalogue, tag them all with "large", and create a group right in your discount!

The second mechanism is as a store of discount messaging and discount values. We do this by specifying, optionally, a "discount_message", and either a "discount_value" or "discount_percentage":


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!


Did this answer your question?