Our store uses a third party app for customers to select delivery/pickup dates and times from the Cartpage. We have cutoff times for these available date/time slots. The customer can select a delivery date/time, proceed to Checkout, keep the browser (and checkout session) open, then come back later and proceed and checkout successfully. The issue is the customer can successfully checkout after the cutoff times for delivery/pickup.
Is there a Shopify setting to prevent this? Or is there code I can write that can patch this loophole? The obvious solution I can think of is to start a timer once customer enters checkout process, and if it expires, then it kicks them out or rejects checkout when the customer submits order. Is this currently possible?
From what I understand (sometime in 2020 or so) Shopify changed its policies and restricted developers from making any changes to the checkout process.
Any help would be greatly appreciated. Thank you in advance!!
Currently for regular* shopify stores you mostly have control over this AFTER the order is placed once a customers entered checkout to validate an order you’ll want to look at using automation like shopify’s flow app to validate an order after it’s been placed to reject it.
A crude workaround at the shipping step is to create a custom carrierservice to block proceeding to the payment step after a certain point by not giving a shipping option.
Keeping in mind that the data a carrierservice has access to inside the checkout is incredibly limited so there’s a whole architecture that has to be thought out and tested. Though line item properties on items in the carrierservice api as of 2014 should be enough.
An alternative to test as I haven’t tested in awhile is generating a custom free product for that customers cart that represents a reservation and then when the time passes set it to out of stock, but it’s fuzzy if checkout will prevent the order or not at that point ; I’m pretty sure now it might give the option to just remove the offending item which makes this approach moot as then they can proceed to place the order for the other items.
If it doesn’t allow removal that would make users have to go back to cart to remove the prevention product. Tangentially related for the /cart step https://community.shopify.com/c/shopify-design/cart-prevent-orders-for-out-of-stock-items/td-p/614925
*Shopify Plus plans can have checkout.liquid enabled for customization, Shopify checkout extensions are currently only for PLUS enterprise plan stores, some shopify functions are only in developer preview.
@PaulNewton , thank you so much for your reply and suggested solutions and links!
I did not know about the Shopify Flow app, which seems useful in general. Unfortunately, it is only available for Advanced and Plus plans (we have Basic). However, I did find other apps that offer similar features e.g. React Flow. I was hoping I could set a trigger to start at the beginning of the Checkout Process with a delay timer and reject order if timer expired. But as you noted it seems the triggers are only after order has been placed. Perhaps I can at least reject orders based on tags or cart attributes for delivery or pickup times/dates.
I’m intrigued by your other suggestions. Will have to take some time to explore these as possible workarounds.
Thank you so much!
If flow isn’t available and you need advanced automation also see usemechanic which allows scripting much more complex scenarios. Though it is not a drag’n’drop paradigm it’s what i’d use for trying to bookend some sort of timer that auto reject orders thingy after checkout.
https://tasks.mechanic.dev/?q=time
Goodluck, no need to reply.