The selling_plan_allocation object

A selling plan allocation represents how a particular selling plan affects a line item. A selling plan allocation associates a variant with a selling plan.

When a selling plan contains multiple deliveries, such as a 12-month prepaid subscription, the price and compare_at_price values are multiplied by the number of deliveries.

selling_plan_allocation.compare_at_price

The selling plan allocation's comparison price.

This value is set to the variant’s price without the selling plan applied. If the variant's price with the selling plan applied is the same, then this value is nil.

selling_plan_allocation.per_delivery_price

The price charged for each delivery included in a selling plan.

When a selling plan includes multiple deliveries, the per_delivery_price value will be the selling_plan_allocation.price divided by the number of deliveries.

Input

{{ selling_plan_allocation.price | money }}
{% if selling_plan_allocation.per_delivery_price != selling_plan_allocation.price %}
  ({{selling_plan_allocation.per_delivery_price }} each)
{% endif %}

Output

$1,200.00 ($100.00 each)

selling_plan_allocation.price

The price of the line item with the selling plan applied.

selling_plan_allocation.price_adjustments

An array of selling_plan_allocation_price_adjustment objects.

The maximum length of the array is 2. The array is empty when the selling plan doesn't create any price adjustments.

Each selling_plan_allocation_price_adjustment of the selling plan allocation maps to a selling_plan_price_adjustment in the selling_plan.price_adjustments array. The selling_plan.price_adjustments describes the intent of the selling plan, while selling_plan_allocation.price_adjustments contains the resulting money amounts.

Input

Pay {{ selling_plan_allocation.price_adjustments[0].price | money }} on
the first {{ selling_plan.price_adjustments[0].order_count }} orders.

Output

Pay $100.00 on the first 3 orders.

price_adjustment.position

The 1-based index of the price_adjustment in the selling_plan_allocation.price_adjustments array.

price_adjustment.price

The price that will be charged for the price_adjustment period.

selling_plan_allocation.selling_plan

The selling plan that created the allocation.

selling_plan_allocation.selling_plan_group_id

The ID of the selling_plan_group to which the allocation’s selling plan belongs.

selling_plan_allocation.unit_price

The unit price of the variant associated with the selling plan.

If the variant has no unit price, then this property returns nil.