In custom app block, the selling_plan_allocations for variant does not have correct price

Topic summary

Issue: In a try-before-you-buy setup, the variant’s selling_plan_allocation showed the original price instead of the $0 due-at-checkout amount.

Context: A selling plan with $0 fixed due at checkout was assigned to a test product. The page was requested with both variant and selling_plan parameters. Debug showed:

  • current_variant.selected_selling_plan_allocation.price = 262995 (full price)
  • product.selected_selling_plan.checkout_charge.value = 0

Clarification: The selected_selling_plan_allocation.price represents the total amount the customer ultimately pays (full price), not the immediate charge for try-before-you-buy. For the amount due at checkout, the relevant field is selling_plan_allocation.checkout_charge_amount.

Key terms:

  • Try-before-you-buy: $0 (or reduced) charge at checkout, with full price charged later.
  • selling_plan_allocation: Variant-level object in Shopify Liquid linking a variant to a selling plan.
  • checkout_charge_amount: The amount due at checkout for the selected selling plan.

Outcome: Use selling_plan_allocation.checkout_charge_amount to display the immediate charge. The original concern was clarified; discussion resolved.

Summarized with AI on January 26. AI used: gpt-5.

Hi there,

I’m following this guide to create an app for try-before-you-buy.

In the example code under “The selling plan selector on the product page”, it mentions both “selected_selling_plan_allocation” and “selling_plan_allocations”. However, when I test this, the allocation object still had the original price, not the lower purchase option price.

Here’s how I’m testing it:

  1. I have a selling plan with $0 fixed due at checkout assigned to my test product.
  2. To make sure it’s a server-side request that Liquid processes, I call the URL with both the variant and selling_plan: /products/the-3p-fulfilled-snowboard?variant=45203469238594&selling_plan=689019388226
  3. I’m printing a few debug strings to see the values:
    1. current_variant.selected_selling_plan_allocation = SellingPlanAllocationDrop
    2. current_variant.selected_selling_plan_allocation.price = 262995 [this is where I expected $0]
    3. product.selected_selling_plan.checkout_charge.value = 0

So it seems like the product selling plan has the correct info, but the variant selling plan allocation does not. Based on the example code given in the docs, I expected the variant to have the necessary info to render the correct price.

Any ideas what I’m missing?

Hi!
There might be some confusion. The current_variant.selected_selling_plan_allocation.price refers to the amount that the customer is going to pay in the end. For try before you buy, this value equals to the full price.

I believe the value you are looking for in selling_plan_allocation should be the checkout_charge_amount: https://shopify.dev/docs/api/liquid/objects/selling_plan_allocation#selling_plan_allocation-checkout_charge_amount

Hope this helps!

Ah, that makes sense. I thought the example code in the docs would have already accounted for that.