Hi, I’ve developed a post purchase checkout extension that makes a call to the backend of the app to determine whether or not shouldRender should render. It works fine locally but doesn’t work in production.
It seems like sometimes the API endpoint will be called and sometimes it will not.
In either case, the shouldRender return does not seem to work at all. I’ve tried removing the API call and directly calling:
return { render: true }
but even this does not work.
Here’s the code I’m working with. Am I missing something about the admin settings or something?
extend("Checkout::PostPurchase::ShouldRender", async ({ inputData, storage }) => {
let shouldRender = false
let bundles = await getRenderData(inputData).then( bundlesArr => bundlesArr )
if ( bundles.length ) {
shouldRender = true
await storage.update({ bundles, orderTime: Date.now() });
}
return { render: shouldRender };
});
I was able to verify that the bundles variable is being populated with an array of objects, and like I said, it does work locally. Any help would be very much appreciated!