Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

Order Discount Function not shown on Thank you page

delyanpeev
Shopify Partner
5 1 0

Hello there,

 

I've created an Order Discount function that, for testing purposes, always returns a discount. Here's the code:

 

 

 

export function run(input: RunInput): FunctionRunResult {
  return {
    discountApplicationStrategy: DiscountApplicationStrategy.First,
    discounts: [
      {
        targets: [
          {
            orderSubtotal: {
              excludedVariantIds: [],
            },
          },
        ],
        value: {
          fixedAmount: {
            amount: 7
          },
        },
      },
    ],
  };
}

 

 

 

All seems fine as it is applied in cart/checkout pages and is subtracted from the order's subtotal. Unfortunately, it is not visible in the Thank You page. The displayed Total is correct (discounted), but there is no indication that it is from my discount. Images shared below. Am I doing something wrong, or is this the expected behavior?

 

Checkout (all good here):

delyanpeev_0-1701352976811.png

 

Thank you page (missing discount line)

delyanpeev_1-1701353025653.png

 

Thanks in advance!

 

Regards,

Delyan

Replies 0 (0)