Comments (4)
Hey @MaSchVam, that should definitely be possible! After installing the headless theme, did you define the "Base URL" in the theme settings? This should look like this:
from shopify-headless-theme.
Hey @leeuwis ,
Yes! This is the setup we are using. However, this behavior persists:
Example: headless app is at https://detitalienskekoekken.dk
This is the base URL that I want to send people to.
I then have a checkout here:
https://detitalienskekoekken.myshopify.com
And if you visit that URL, you will see that the theme redirects properly (Great!).
However, to make the checkout URL look more legit, we use this domain alias within Shopify:
https://kasse.detitalienskekoekken.dk
If you visit that URL, you can verify in the browser tab that we enter an infinite redirect loop.
from shopify-headless-theme.
@leeuwis ,
Instead of getting the shop url on line 28 in theme.liquid, I now just grab window.location.href
. This should cover this use case?
from shopify-headless-theme.
@MaSchVam I've opened a PR with a fix, let me know if this fixes the issue for you!
It's indeed fixed by changing the value on line 28 in theme.liquid
, but I ended up using window.location.hostname
instead of the window.location.href
. If window.location.href
would be used, all traffic will always be redirect to the home url of your storefront, but the path should also stay intact so https://example.myshopify.com/products/slug-x
also gets redirected to https://example.com/products/slug-x
.
Please read the note in the PR when updating, since a settings_schema.json
has been changed.
from shopify-headless-theme.
Related Issues (20)
- Possible to not redirect away from the customer account section? HOT 1
- When trying to add this theme directly from a cloned repo, Shopify says is not a valid theme. HOT 3
- Variable storefrontBaseUrl is undefined + URL match check is wrong HOT 1
- cannot create a custom redirect for root/index HOT 2
- Discount links don't provide a way to pass the code through to the headless store.
- [question] login page redirection fixed? HOT 2
- Customise email notifications
- Disable redirect for certain templates HOT 3
- Inquiry Regarding Custom Sections in Next.js and Shopify Integration HOT 1
- /favicon.ico returns 404 in checkout HOT 1
- Edit checkout code HOT 2
- Error at Navigation menu HOT 3
- Error at Page update HOT 2
- Not able to see designs as per documentation HOT 1
- Cabecera
- Testing
- Potential Drawbacks of Adding <meta name="robots" content="noindex"> in Headless Setup
- /password > / (not working) HOT 4
- Theme seems to be broken HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shopify-headless-theme.