Links

Understanding Product Settings

Introduction

Whilst it’s possible to configure product settings such as pack size, reserve stock quantity and minimum / maximum order quantities for all customers across your B2B store, you can also apply these product settings to specific customer groups, giving you a high degree of control over what product options are available to your customers.

Available product settings

Available product settings to apply to customer groups:
Name
Type
Description
customer_group
string
Customer Group - settings will be applied to this customer group
pack_size
integer or null
Only allow the product to be purchased in multiples of x
Default: 1
reserve_stock_quantity
integer or null
Reserve stock quantity - always ensure x amount of stock is left (generally used to ensure B2C has availability)
Default: null
min_order_quantity
integer or null
Only allow the product to be bought in a minimum of x
Default: null
max_order_quantity
integer or null
Only allow the product to be bought in a maximum of x Default: null
min_order_parent_quantity
integer or null
Only allow the product to be bought in a minimum of x across all variants
Default: null
max_order_parent_quantity
integer or null
Only allow the product to be bought in a maximum of x across all variants
Default: null
display
boolean or null
Allow the product to display on the frontend
Default: null
sell
boolean or null
Allow the product to be added to the cart
Default: null

Metafield Configuration

To configure these settings SparkLayer uses product metafields. You'll need to ensure your Shopify store is set up to capture metafields and our recommendation is to use a highly popular free Shopify app called Metafields Guru.
You can also set up metafields natively via Shopify by following their help guide here.
When configuring these settings, it’s important to note the following:
  • These settings are managed via product metafields; the easiest way to set this up is to install a third-party Shopify app (see above)
  • These settings are always added at a variant level even if the product only has a single variant
  • When setting up the metafield, the data should be set up as below
Item
Details
Metafield type
This must be set as an JSON string
Namespace
This must be set as sparklayer
Key
This must be set as settings
Value
This must be set up in this format​
[
{
"customer_group": "base",
"pack_size": 1,
"reserve_stock_quantity": 10,
"min_order_quantity": 5,
"max_order_quantity": 50,
"min_order_parent_quantity": 5,
"max_order_parent_quantity": 50,
"display": true,
"sell": true
}
]
It's important to note the following:
  • You can find the value for customer_group in your dashboard here in the "Name" column, e.g. Base
  • When setting a customer_group, always enter it as lowercase. E.g. Base becomes base
  • See table Available settings to apply to customer groups above for accepted inputs for each Value
  • In the metafield Value, you only need to include the settings that you actually want to set - you can either remove the unused settings, leaving only customer_group and the settings you wish to configure, or leave them set to null
  • Make sure that every line ends with a comma, except for the last line
For example, if you only wanted to configure minimum order quantity of 5 and a maximum order quantity of 50 for the customer group 'Gold tier', the Value would look like this:
Example metafield value
[
{
"customer_group": "gold-tier",
"min_order_quantity": 5,
"max_order_quantity": 50
}
]

Example use cases

Example 1: Exclusive products

Company X has two customer groups:
  1. 1.
    Base (standard B2B customers)
  2. 2.
    Gold tier (a group of preferred customers who have access to discounted pricing and exclusive products)
As part of their preferential terms, Gold tier customers have access to a range of exclusive products which are not available to Base customers.
Metafield value
[
{
"customer_group": "base",
"display": false,
"sell": false
}
]
Product variants that have this metafield applied will only be visible to Gold tier customers.
Because by default all products are visible to all customer groups, we do not need to explicitly make these products visible to Gold tier customers, instead we simply need to hide them from Base customers.
Example 2: Customer group specific pack sizes
Company X has two customer groups:
  1. 1.
    Wholesale customers (other businesses who stock their products)
  2. 2.
    Influencers (people who advertise their products on social media)
Their influencers only need to order single units to showcase their products on social media, whereas their wholesale customers need to order large quantities for their stock.
Company X wants to configure their products to be sold individually to the influencer customer group, and in pack sizes of 50 to the wholesale customer group.
Metafield value
[
{
"customer_group":"base",
"pack_size":50
},
{
"customer_group":"influencer",
"pack_size":1
}
]
When the customer group is set to “base”, this applies to all customer groups.
In the second array, we specify that the specific customer group “influencer” is set with a pack size of 1.