Auto-select Location based on selected location on Online Store

Hello,

We need for a user on our site to select a location before checking out. Once the user selects the location, during checkout we want to have that pickup location selected by default.

For example, there are two locations: Asheville and Charlotte.

  • A user select Charlotte and checkouts out.
  • Preselect Charlotte as the pickup location. (Currently it’s picking Asheville because it’s the first in the list.)

My question is, is this possible with the Checkout UI Extensions or Shopify Functions API or is this something that requires a custom checkout?

Any help would be appreciated!

Thanks!

Hi there :waving_hand:

I believe this is something that could be accomplished with Delivery Customization Shopify Functions.

I would recommend reviewing the tutorial on building a delivery customization.

You could save the pre-selected location as a cart attribute. You would then use that input in your function to move the selected location to the top of the list.

Hope this helps!

Amazing, thank you for the resources. I missed those API docs!