Introduction:
The Quantity band from parent calculator is a calculator that takes a specific amount of the quantity of a parent product and puts that in the quantity of the child product.
This calculator can be used to calculate different prices for different quantity bands/ranges (tiers). For example, the first 1000 Liters of fuel are charged with a higher price than the liters above 1000.
Configuration
To use this calculator, different child products per quantity band must be created, and use the QuantityBetween setting to determine their quantity with respect to the parent service.
In the above example:
- Two child products would need to be created, one for the first 1000 liters and one for the next and one group product.
- The total amount of fuel has to be filled in in the group product only when using the product on an order.
- The calculator automatically assigns the correct quantities to the applicable child products.
When creating the child products, the setting 'Take quantity from group' must be set to 'Quantity from group' instead of the default 'None'.
In the parent product the options 'Is group' and 'Is group with quantity and supplier' must be checked.
Price calculator setting
- QuantityBetween (int, no default) mandatory
Defines the quantity band interval for this child product. Format: QuantityBetween=startValue AND endValue. The calculator compares the parent quantity with this band and returns the overlapping quantity. If the parent quantity is less than or equal to the start value, returns 0. If the parent quantity is within the band, returns the overlapping range. If the parent quantity exceeds the end value, returns the full band length. Both values must be numeric and cannot exceed 9999999. The start value cannot be greater than the end value.
For a group of products, from the second product onward, the QuantityBetween setting should start with the value of the previous end interval such that when adding up all the calculated intervals, they will match the parent quantity.
The calculator formula is: result = Minimum(ParentQuantity, Value2) - Value1, when ParentQuantity > Value1, otherwise result = 0;
In the case of the example mentioned above the two price calculator settings would look like this: 'QuantityBetween=0 and 1000 and 'QuantityBetween=1000 and 9999999'.
The end result of the example mentioned above will look like this. The total quantity of the fuel sold is 2000 liters. The price for the first 1000 liters is 0.80. Everything after that is 0.70.
- RoundingMethod (string; default="Floor")
The rounding method applied to the calculated quantity. Options: Floor, Ceiling, NearestInteger, None. Default is Floor.
How to Example:
In this example:
- The first 2 units of a product are provided for free.
- Additional units of the product have a per-unit fee of $40.
1) Create a parent product that will be the main product added to an order.
- 'Is group with quantity and supplier' must be checked.
- Take quantity from group should be set to None (quantity from self).
2) Create a child product to use for the first tier of pricing.
- In this example, the first tier of pricing is 2 items for free.
- Take quantity from group should be set to Quantity from from group.
Scroll down to the Special price calculation section.
- Price calculator should be set to Quantity Band From Parent.
- Price calculator settings is a field that requires that you enter a simple formula. In this example, the formula QuantityBetween=0 and 2 is entered, since the first tier of pricing is 2 units for free
3) Create a child product to use for the second tier of pricing.
- In this example, the second tier of pricing is 3 or more items at a per unit fee of $40.
- Take quantity from group should be set to Quantity from from group.
Scroll down to the Special price calculation section.
- Price calculator should be set to Quantity Band From Parent.
Price calculator settings is a field that requires that you enter a simple formula.
- In this example, the formula QuantityBetween=2 and 100 is entered, since the second tier of pricing is 3 or more items at a per unit fee of $40.
4) Once the parent and two child products have been created, connect the child products to the parent product.
- Be sure to check the Auto-add option so the child products will automatically be listed under the parent product on orders.
5) Create price agreements for the child products.
- In this example, the first tier child product (quantity 0 – 2) is free.
The second tier child product (quantity 3 - 100) is charged at $40 per item.
6) The parent product is added to an order.
7) The total quantity is entered in the parent product. In this example, total quantity is 9.
8) Configuration of the Quantity Band from the Parent Calculator ensures the pricing based on quantity tiers is accurate.
- The quantity of 9 automatically splits between the first 2 items at $0 rate, and following 7 items at $40 rate.
Examples
Settings for tiered fuel pricing:
- Child Product 1: QuantityBetween=0 AND 1000
- Child Product 2: QuantityBetween=1000 AND 5000
- Child Product 3: QuantityBetween=5000 AND 9999999
Scenario 1: Parent quantity within first band
- Parent quantity: 750 liters
- Child 1 (0-1000): 750 (overlapping range)
- Child 2 (1000-5000): 0 (no overlap)
- Child 3 (5000+): 0 (no overlap)
Scenario 2: Parent quantity spans multiple bands
- Parent quantity: 2500 liters
- Child 1 (0-1000): 1000 (full band length)
- Child 2 (1000-5000): 1500 (overlapping range: 2500 - 1000)
- Child 3 (5000+): 0 (no overlap)
Scenario 3: Parent quantity equals band start
- Parent quantity: 1000 liters
- Child 1 (0-1000): 1000 (full band length)
- Child 2 (1000-5000): 0 (quantity equals start, so no overlap)
- Child 3 (5000+): 0 (no overlap)
Scenario 4: Parent quantity exceeds all bands
- Parent quantity: 10000 liters
- Child 1 (0-1000): 1000 (full band length)
- Child 2 (1000-5000): 4000 (full band length: 5000 - 1000)
Child 3 (5000-9999999): 5000 (overlapping range: 10000 - 5000)
Notes
- This calculator requires the product to be configured with "Take quantity from group" enabled. If not enabled, an error is thrown.
- The parent quantity is extracted from the order line group (typically the parent order line).
- Use this calculator to create tiered pricing structures where different price bands apply to different quantity ranges of the same parent service.
- Create separate child products for each quantity band, each with its own QuantityBetween setting.
- The bands can be consecutive (e.g., 0-1000, 1000-2000, 2000-3000) or have gaps between them.
Comments
0 comments
Please sign in to leave a comment.