I'm in trouble with hydrogen storefront deployment #1610
Unanswered
William29302
asked this question in
Help
Replies: 1 comment 1 reply
-
Ok, update : I success to migrate my storefront, however when I go to the checkout{myshopdomainename} page I can navigate to my online store, so I'd like to redirect anyone who goes to the online store to the hydrogen storefront, and it's the theme liquid modification part that makes me reload the page over and over again. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I would like to replace my shopify store by my new Hydrogen store, however I meet several problems, in order to achieve my goals I followed the doc:
And here is my procedure:
I bought a shopify domain name directly, I created a subdomain checkout.{myshopdomain}
I assigned the subdomain as target: Online Store and domain type: Primary domain.
I made my Hydrogen storefront public.
I assigned the domain I bought as Target: Target(Hydrogen), Storefront(Mystorefront), Environment(Production) and as Domain Type: Primary domain.
I have removed the password protection from my online store.
I modified the theme.liquid of my online store theme (dawn) and inserted the code shown in the doc above, obviously modifying "https://headless-website.com" by the domain I purchased. However for this step at this moment, when I save and go to the preview of my theme the page reloads infinitly.
`
<script> function getCookie(name) { name = name + '='; var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i].trim(); if (cookie.indexOf(name) == 0) { return cookie.substring(name.length, cookie.length); } } }{% assign new_website = 'https://headless-website.com' %}
<!doctype html>
`
import {redirect} from '@shopify/remix-oxygen';
export async function loader({request, context: {storefront}}) {
const {origin} = new URL(request.url);
const {shop} = await storefront.query(
query getShopDomain{ shop { primaryDomain{ url } } }
,);
const onlineStoreStatusPage = request.url.replace(
origin,
shop.primaryDomain.url,
);
return redirect(onlineStoreStatusPage);
}
`
Having followed all the steps in the documentation, here are the problems I encountered afterwards:
When I go to my new domain, it redirects me to the online store with the prefix "checkout", which seems logical given that the doc asks me to add this sub-domain as the primary online store. But I'd like checkout to be just the shopify checkout page when I place an order.
The problem of the page reloading endlessly when I modify the theme.liquid.
Thanks for your help.
Beta Was this translation helpful? Give feedback.
All reactions