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.

Extension only apps - deployment process

Extension only apps - deployment process

Jacques_
Shopify Partner
1 0 0
Hi all,
The issue is with regards to deployment of the extension-only-app
 
This is the process I followed:
  • Create an extension-only app with: npm init @Shopify/app@latest
  • generated ( product discount ) extension: npm run shopify app generate extension
  • Testing store get everything working  ( run mutation to create discount app etc. )
  • npm run deploy
  • On shopify partners

- go to app and create a distribution

- copy link and install on store ( I am installing on a plus store )

 
On the store when click on create a discount code I see that there is and extra option. Which seems correct as it created the same on the test store.
Screenshot 2024-04-17 at 10.54.00.png


But products just are not discounted according to the conditions I setup in the product-discount function

 

I tried throwing an error in the shopify function, I assume it should show a notification in the store that a error is occuring with an app. But this is also unsuccessful 
 
Am missing something with regards to the deployment process?
 
Any help will be appreciated.
Reply 1 (1)

Schmidtc63
Shopify Partner
101 14 29

Did you register your function with GraphiQL? 

 

Get your functions:

query {
  shopifyFunctions(first: 25) {
    nodes {
      app {
        title
      }
      apiType
      title
      id
    }
  }
}

 

Register the function:

mutation {
  discountAutomaticAppCreate(automaticAppDiscount: {
    title: "Volume discount",
    functionId: "YOUR_FUNCTION_ID_HERE",
    startsAt: "2022-06-22T00:00:00"
  }) {
     automaticAppDiscount {
      discountId
     }
     userErrors {
      field
      message
     }
  }
}

 

Make sure GraphiQL has all the permissions it needs, including write_discounts.