Related Topics.

How to control the quantity on the checkout page?

Can I make sure the quantity is set in specific multiples?


Summary


If you have a pricing model where customers buy in multiples of a unit, for example, you sell in multiples of 10, where a customer can purchase a minimum of 10, 20 30......100.... so on.

This can be implemented with the plan level Meta Data, where the customer can only select a value with the range specified.

 

Solution.


You will first need to enable the metadata plan customization option.

Go to Settings » Configure Chargebee » Checkout & Self-Serve Portal » Advance Settings » Customize plan/addon quantity based on meta configuration.

Once you have enabled this, you can go to your plan configuration to input the Metadata.

Go to Product Catalog  » Plans » Select the Specific Plan(s) » Click Add/Edit and input the Metadata config (JSON)

Note: 

You need to have the plan created to see the Metadata option.

This is Applicable for V3 or InApp Checkout pages only.


Sample metadata JSON;

{

  "quantity_meta": {

    "min": 5,

    "max": 100,

    "step": 5,

    "type": "range"

  }

}


{

  "quantity_meta": {

    "type": "fixed",

    "values": [

      5,

      6,

      7,

      8,

      9,

      10

    ]

  }

}


Based on your use-case, you can create a Per-Unit pricing plan or any of the other pricing type if unit price changes based on the quantity. Here's a video tutorial simulating a simple per-unit price use-case. 



Refer here, to know more about customizing your plan/addon metadata.