Delivery Customization Functionality

Delivery Customization Functionality

Shopify Partner
1 0 0
I am having an issue installing the Delivery Customization Function onto my app.

The main source of information I will refer to can be found here:
I am using an up-to-date NodeJS environment with all the relevant dependencies installed. I have completed Steps 1-3 with not much hassle, but when I get to the testing phase in Step 4, the provided source code and instructions begin to get a bit messy. 

Essentially, I have the app installed correctly on my development store, and it should be processing delivery options prior to the customer being able to see them, as shown in the image below. 



Provided the set-up for the app is correct, I will describe below where I think the issue may lie in the provided source code. Firstly, the developer is told to paste the following code into their run.js file:


image (1).png

Here, I have highlighted the RunInput parameter as I believe this is where the error is being created, because in the api.ts file provided by the delivery-customizations Shopify extension, there is no RunInput parameter exported, hence this whole flow is incomplete due to the source code typo. Below is a further explanation.


image (2).png

This image shows api.ts on the left and run.js (pasted from the URL at the beginning), as you can see in the Error Console, the parameter 'Input' is declared twice in api.ts, and the parameter RunInput is not declared at all, therefore causing no input to be passed into the run.js file. After digging further, I believe the second declaration of Input is supposed to be the RunInput parameter. I am unable to fix this myself because whenever I fix the mis-declared parameters and restart my app using the 'shopify app dev' command, the JS is re-bundled and the api.ts file reverts to that provided by the delivery-customization extension, making the RunInput typo fix go back to two Input declarations. Similarly, if I rename the parameter in run.js to become just Input, it still does not to as intended when I try to add a shipping profile to my basket. I have attached a full video below to try to make things clearer, *it is important to note I have removed the provinceCode == "NC" filter on the deliveryGroups array, this was just to make sure the flow was working on any address in the first place*. 

If anyone else has experienced this issue, or if a Shopify Dev could get and touch and let me know if perhaps I've set something up incorrectly, it would be greatly appreciated.

Replies 0 (0)