Headless store - checkout on primary domain

Solved
nathangaw
Shopify Partner
4 1 2

Hi - we have a headless Shopify store, with the checkout on the store's myshopify.com domain. I've switched the primary domain of the online store to a custom domain and the 'online store' channel and checkout successfully appear on the custom domain. But, when a customer is sent to the same checkout from the headless store the checkout domain is still myshopify.com. Can custom domains be applied to the checkout for headless channel customers?

Accepted Solution (1)
nathangaw
Shopify Partner
4 1 2

This is an accepted solution.

H - we're using the JS Buy SDK (https://shopify.github.io/js-buy-sdk/#creating-a-checkout). The client is initialised with the store's myshopify.com address, but I don't believe it'll accept a custom domain. Shopify support have confirmed that the myshopify.com URL should redirect to the primary domain, but don't know why it isn't. In the end I've had to manually rewrite the checkout URL, replacing myshopify.com with the primary domain, before the customer navigates to the checkout which is working fine. Thanks very much for your thoughts.

View solution in original post

Replies 6 (6)
Dan-From-Ryviu
Shopify Partner
5572 1024 1055

Did you try to use another browser to checkout after connect your 3rd party domain in Shopify and mark it as the main domain in your store?

 

- Helpful? Like and Accept a solution. - Donate: Buy coffee - or Paypal me ❤️
- Ryviu - Product Reviews app, collect consumer photo reviews, import reviews from AliExpress, Amazon, Etsy, Shoppe and Walmart and CSV.
- Lookfy app: Create Image Lookbook, Photo Gallery with product hotspots
- Enjoy 3 months of Shopify for $1/month. Sign up now

nathangaw
Shopify Partner
4 1 2

Thanks - yes, I've tried different browsers, incognito mode, completely new devices and cleared cookies/cache, but it still appears on myshopify.com when accessed via the headless channel.

Stacy_Zhuk
Shopify Partner
339 17 45

Hello @nathangaw,

 

Can you please clarify - you actually use 2 websites: one on the main domain where some customers sell everything natively inside Shopify and another one on a separate domain where you are using a headless Shopify installed cart and then want to direct a customer to a first mentioned instance's domain?

 

Best regards,
Anastasia  

Co-founder at Whidegroup, e-commerce development company from Ukraine
- 10+ years of experience with SMBs
- Deep expertise in custom development & optimization
E-mail: anastasia@whidegroup.com
nathangaw
Shopify Partner
4 1 2

Hi - we have a Shopify instance with a primary domain of store-checkout.clientdomain.com. We don't use the online store, but the online store loads fine on the primary domain. The checkout also loads on the primary domain if accessed from the online store.

The store we actually use is a Next.js build, using the Shopify SDK, on store.clientdomain.com. The SDK generates checkout links, but when the checkout is accessed from the headless store it renders on myshopify.com. The myshopify.com domain is set to redirect to the primary domain, which works fine everywhere, unless the checkout is accessed from the headless store.

I'm trying to resolve with Shopify support, but their first question was 'what's a headless store' which doesn't fill me with confidence!

Many thanks

Nathan

Stacy_Zhuk
Shopify Partner
339 17 45

Hello @nathangaw,

 

I suppose you are using a method/function ShopifyBuyInit().
Are you passing the domain variable inside so it looks like next:

function ShopifyBuyInit() {
var client = ShopifyBuy.buildClient({
domain: "checkout.domain.com",

 

Best regards,
Anastasia 

Co-founder at Whidegroup, e-commerce development company from Ukraine
- 10+ years of experience with SMBs
- Deep expertise in custom development & optimization
E-mail: anastasia@whidegroup.com
nathangaw
Shopify Partner
4 1 2

This is an accepted solution.

H - we're using the JS Buy SDK (https://shopify.github.io/js-buy-sdk/#creating-a-checkout). The client is initialised with the store's myshopify.com address, but I don't believe it'll accept a custom domain. Shopify support have confirmed that the myshopify.com URL should redirect to the primary domain, but don't know why it isn't. In the end I've had to manually rewrite the checkout URL, replacing myshopify.com with the primary domain, before the customer navigates to the checkout which is working fine. Thanks very much for your thoughts.