I have created a shipping script (free shipping for an item if it is the only item present in the cart.) The script works as expected when testing from within the Script Editor. The script also works as expected in the online store if I go through a "normal" flow - adding items to the cart, and then checking out.
However, if I add items to the cart, then go back into the shop and modify the cart contents, then go back to checkout, the script does not seem to re-fire. It keeps the original result from the last execution of the script in the cart. In that case, if I step back to the Shipping Method step, at that point, the script seems to re-fire.
Is there a setting that I am missing or some way to get the script to fire on the checkout page every time the cart contents are modified?
I note that when not using the script editor, the default behavior if the cart contents are changed after a shipping method has been applied, and the customer attempts to come back to the checkout, it goes back to the shipping method page where the customer has to re-select a shipping method. Shouldn't something similar happen if the shipping scripts are not going to re-fire?
Thanks for any advise -
Thanks, Elliot. I've abandoned that script, so I do not have a version I can post any longer. However, every shipping script I've developed for the Script Editor has the same issue - if the customer goes back and modifies cart contents, and is directed to the cart page, the scripts do not re-fire unless they step back to the shipping method step. (I have mostly used the Shopify Script Creator - https://jgodson.github.io/shopify-script-creator/ to get started)
I plan on making a very simple script when I have time to demonstrate this problem, hopefully soon.
I was just hoping to get verification from the community that shipping scripts do indeed get re-executed after the cart contents get updated, and the user is directed to the cart page. It seemed more an issue with the execution of the script itself, rather than the script contents, but I could be missing something.
Thank you, Elliot and Duncan.
I'll make a test case and report to Shopify to get their input & update this thread.
The shipping script needs to re-fire on cart and all checkout pages/steps. Otherwise, customers can go back and change cart contents to qualify for free shipping, and it is not applied, or, after getting free shipping, go back and modify cart contents to not qualify, and still get free shipping.
|05-16-2019 10:37 PM|
|05-14-2019 10:39 AM|
|05-14-2019 07:10 AM|
|05-13-2019 01:49 AM|
|05-10-2019 07:08 PM|