Predetermined Locations for delivery

I’m looking for an app or custom script that allows the shipping address to be populated. We deliver frequently to the same few hotels. Thai addresses are never easy, so we’d like it designed so there can be a check box or dropdown on the cart page saying “XYZ Hotel”, then when they go to the checkout page the address for that hotel is already populated in the shipping location. Possible?

If you’re on Shopify Plus, you can use checkout UI extensions to achieve this.

If you’re not on Shopify Plus, you can still do what you’re looking for. It requires a bit of custom theme work rather than an app. Shopify’s checkout is locked down, but you can pre-populate fields using URL parameters when redirecting to checkout.

The core idea is to add your dropdown or checkboxes to your cart page. When a user selects a hotel, you’ll use JavaScript to capture that selection. You’ll need to store the full address details for each hotel within your theme’s JavaScript (or in theme settings, to manage them outside of code, but JS is simpler for a few fixed locations).

When the user proceeds to checkout, instead of just linking to `/checkout`, your JavaScript would construct a checkout URL that includes the pre-filled shipping address parameters. For example:

`https://yourstore.myshopify.com/checkout?checkout\[shipping_address\]\[first_name\]=XYZ&checkout\[shipping_address\]\[last_name\]=Hotel&checkout\[shipping_address\]\[address1\]=123+Main+St&checkout\[shipping_address\]\[city\]=Bangkok&checkout\[shipping_address\]\[province\]=Bangkok&checkout\[shipping_address\]\[zip\]=10120&checkout\[shipping_address\]\[country\]=Thailand\`

You’d essentially have an object in your JavaScript like this:

```

const hotelAddresses = {

‘xyz_hotel’: {

first_name: 'XYZ Hotel',

address1: '123 Main St',

address2: 'Floor 10, Room 1001', // Optional

city: 'Bangkok',

province: 'Bangkok', // Or the correct province code

zip: '10120',

country: 'Thailand' // Use country name or code

},

// … other hotels

};

```

Then, when a selection is made, you’d pull the corresponding address, encode it, and append it to the `/checkout` URL before redirecting the user. This will land them on the checkout page with the shipping address fields already filled in.

If you’re in need of more help to get this going, feel free to DM me and I can work with you on this for free.

Hope this helps!