If the user enters a specific region in the shipment address then show an alert. I managed to do this successfully using the zip code property in useShipmentAddress.
One more thing I want to do is to add an additional fee in the order summary if the user is from a specific region. How can I do this? Can I use the graphql admin API to update the order or what is the best way to achieve this?
Honetly can’t remember why, but I ended up creating a $0 product that was automatically added the to checkout based off some custom rules – in your case the region – via Checkout UI extensions, and then a separate Function that calculates the free price and then uses CartTransform to set the $0-product price.
If the fee is static you obviously wont need the Function. My case just had a dynamic fee.
hey @curzey thanks for taking the time to reply. Yes, it is a valid approach and I also considered it first but the client specifically requires that the fee should not show as an extra item but as an additional fee or an extra shipment fee with the title “Shipment Surcharge”. I was looking into the graphql API and there is an additionalFee property on order I was just wondering whether you can update it by updating the order or not
If I remember correct I added/removed the “free product” based off if a payment method was chosen. So it was actually removed when leaving the checkout.
Otherwise you could always just not render the line item in the cart. Skip it with liquid or hide it with CSS.
Thanks for replying @curzey . Is there any tutorial for beginners to implement this? i want the price to be 0.3% of the total cart amount. I created the app and added the extension but it just doesn’t show on checkout.