Shipping discount functions is not running

Bayarmagnai1
Shopify Partner
1 0 0

Hello,

I've set up a shipping discount function, but it seems like it's not working at all. There are no logs or error messages available in the partner dashboard -> app -> extension page, and there's no indication that the function has been invoked. Also, the discount is not being applied to my test orders and I didn't see any error messages when I deploy it.
Screenshot 2024-04-29 at 15.18.13.png
I'm testing this on fresh new app and store.

Here are the steps I followed to set up a new function:

1. Initialized a new Shopify app with the command: `npm init @Shopify/app@latest`.
2. Generated a shipping discount function extension by running: `npm run shopify app generate extension` and selecting 'shipping discount function' for version 2024-01.
3. Deployed the app using: `npm run deploy`.

I think if there's an issue with the code, it should be logging something. For now, I just want to see if this function is even running. Help please !

Reply 1 (1)

tobebuilds
Shopify Partner
265 13 74

Have you entered a shipping address at checkout when testing the discount?

 

If no shipping address is entered, then shipping rates can't be calculated, so discount functions aren't executed.