I’m not exactly sure I’m understanding the redirect question correctly, but can state how I approached our setup.
- I have my “store” located at domain.com. This is a WordPress hosted site with a custom theme and utilizes Shopify Buy Button JS. We are not using WooCommerce as we rely on the Shopify checkout process
- Within Shopify under the domain admin area I have the primary domain set as domain.com but not connected.
- I have a third-party domain set up which is checkout.domain.com and then a CNAME pointing checkout.domain.com > shops.myshopify.com
- We dynamically generate our Buy Buttons based off of the Buy Now JS SDK but the main part of it, pertaining to URLs or “how does the redirect work” is that you need to set your domain to the thrid-party domain you created earlier when you initialize your Buy Button
function ShopifyBuyInit() {
var client = ShopifyBuy.buildClient({
domain: "checkout.domain.com",
storefrontAccessToken: "YOUR_TOKEN",
});
The whole shopping experience happens on our WordPress site as the “cart” utilizes the flyout cart that is part of Shopify Buy Button JS framework. Once the user presses “checkout” this is when they jump over to checkout.domain.com and finalize their purchase.
Again, our approach was based off of needing Google Analytics to properly track the user session over the Shopify hosted checkout. Cross-domain linking within GA never appeared to work with domain.com > domain.myshopify.com as Shopify has their checkout flow somewhat locked down from a thrid-party script perspective. Since GA links sessions out of the box on the “root” domain domain.com > checkout.domain.com worked perfectly.