instantcommerce / shopify-headless-theme Goto Github PK
View Code? Open in Web Editor NEWLiquid theme that automatically redirects customers to your custom storefront.
License: MIT License
Liquid theme that automatically redirects customers to your custom storefront.
License: MIT License
No update is render in frontend
Necesito ayuda para cambiar la cabecera de mi sitio web, no me abre el editor de shopify
I'm currently using a headless setup with Shopify and Next.js deployed on Vercel.
By using shopify-headless-theme, my Shopify store currently redirects to my Vercel domain. I’m considering adding <meta name="robots" content="noindex">
to my shopify-headless-theme in theme.liquid to prevent the Shopify domain from being indexed by search engines.
I want to understand if there are any potential drawbacks or issues with this approach, in the context of using Vercel + custom domain for deployment.
Thank you!
In theme.liquid
the variable storefrontBaseUrl
is referred to wrongly. Looking at the changes made in commit f43aae1 it looks like storefrontBaseUrl
was renamed to storefrontHostname
but not in all places it should've been renamed.
Furthermore at line 43 redirectUrl.startsWith(storefrontBaseUrl + fromPath)
isn't working as expected due to the fact that the redirectUrl
that is initialized as var redirectUrl = window.location.href.replace(currentHostname, storefrontHostname);
can never start with the provided value as it will always start with http://
or https://
.
Can't open the PR with the fixes at the moment so just quickly reporting on the issue.
e.g. what logic should be added on the login page such as redirecting to the checkout_url
query params (with multi-pass)
I'm building a Next.js Shopify site and I'm using this to redirect users that visit the Shopify domain to the Next.js site. But we're still looking to lean on an out-the-box template for users to log in and see their orders. Is this possible with this theme?
I'm trying to set up some custom xml feeds, is it possible to disable redirects for certain templates / paths?
When a shareable discount link evaluates … for example…
theme.com/discount/freeshipping?redirect=/pages/contact
The theme currently would redirect you to …
headless.com/pages/contact
, and there is a cookie for discount_code
set to freeshipping
but for the domain theme.com
.
This is because the client side code isn't executed until the routing is complete — one way to get around this would be to add a search param called discount_code
and set it to the value passed above.
e.g.
const discount_code = getCookie('discount_code');
function getCookie(name) {
name = name + '=';
var decodedCookie = decodeURIComponent(document.cookie);
var cookies = decodedCookie.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);
}
}
}
const url = new URL(window.location.href)
let params = new URLSearchParams(url.search);
params.append("discount_code", discount_code);
// Continue with existing logic…
How can I edit checkout code?
There is no reference for the checkout page in the source code and I don't find any default checkout code on shopify
Hello Team,
I have come across an issue that pertains to website sections, a crucial element of any web platform. I am seeking your expertise on the following matters:
1. Incorporating Custom Sections, Specifically a Hero Section, into a Next.js Template:
I am interested in understanding the process of integrating a custom section, such as a Hero Section, into a
Next.js template. Your guidance on this would be greatly appreciated.
2.Integrating Custom Sections into a Shopify Store for User-Friendly Editing:
One of my primary objectives is to seamlessly incorporate these custom sections into a Shopify store, allowing
users to easily edit and customize them. Your insights on how to achieve this would be invaluable.
3. Utilizing GraphQL to Fetch Section Data, Particularly for Products:
I am also keen to explore the use of GraphQL to retrieve data for sections, such as products, by leveraging
categories and product attributes. I am interested in learning how to implement this functionality and display the
fetched data on my deployed website.
Any advice or potential solutions in this regard would be greatly appreciated.
I have added the headless theme, yet I cant't see same checkout page as shown in documentation
I am getting redirect to my headless storefront on shopify customer login page.
Not sure if i did it right, but I had a bug in the login process.
After redirecting the customer to the checkout page, when they clicked "log in", they'd be redirected to the {{ settings.storefront_hostname }}/password
for some reason.
I couldn't track easily why I was redirected to /password
so I deactivated Javascript in advance and navigated to the Login
link where i could see that there was a redirection block at the end of the page (see details ↓)
I tracked it down to the main layouts/template.liquid
here:
shopify-headless-theme/layout/theme.liquid
Lines 220 to 239 in 4a8a8f1
...and should_redirect
was (hopefully) explained in a comment a bit above:
shopify-headless-theme/layout/theme.liquid
Lines 149 to 154 in 4a8a8f1
So according to the logic of the comment, the redirection should not happen when we navigate to the login page.
In order to debug I just added this:
<!-- should_redirect={{ should_redirect }} ⇒
And to my surprise the value wasn't a boolean but rather the template
value.
I changed this:
shopify-headless-theme/layout/theme.liquid
Line 154 in 4a8a8f1
To become that:
{%- assign should_redirect = false -%}
{% if template != 'customers/login' or settings.multipass_login %}
{% assign should_redirect = true %}
{% endif %}
and it seems now that should_redirect
is a boolean which is true/false
according to the logic of the comment.
The location of our online store is https://ourdomain.com/swag
. The following custom redirect doesn't appear to work:
/ > /swag
Otherwise working well. Thank you for writing this tool.
Hello,
This theme is really a great idea. I just tried it out on a store that uses a domain alias:
normalsetup.myshopify.com —> custom.customdomain.com
And I see that clicking the logo in the checkout causes an infinite redirect loop. Any way around this behavior, with this theme?
Navigation menu don't appear on frontend
I've password-protected the default Shopify store.
Custom front end lives on: godsent.gg
The checkout lives on a custom subdomain: checkout.godsent.gg
When I try to set up a custom redirect to link to the index page of godsent.gg:
/password > /
I'm greeted by the Redirecting template after clicking on the logotype on the checkout page, the "Click here" link wants to ref to:
checkout.godsent.gg/undefined but it should go to godsent.gg/
How do I solve this?
Did this break for someone else?
We just started seeing an issue, when users click on the checkout button they are redirected to my-domain.myshopify.com/password instead of the checkout page.
I would like to specify a logo and accent color that is used across all email notification templates using the following form:
When I try to upload a logo, or specify an accent color I receive an error that Shopify support tells me is because the theme doesn't allow editing notification templates. Is that true? And how would I go about changing the email notification templates in that case?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.