What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Order Discount Function not shown on Thank you page

Order Discount Function not shown on Thank you page

delyanpeev
Shopify Partner
8 1 6

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)