Shopify themes, liquid, logos, and UX
For a little background, I have a one product Shopify store and am using the Spark theme. With this theme, you can only have 'featured products' on the homepage. But products you put on the homepage don't have all the features like apps or reviews. So I'm looking for a way to completely remove my homepage, make my site link redirect to my product page, or make it so my homepage have a normal product option.
You have to add in script like below
<script>
window.addEventListener('load', function() {
window.location.href = 'http://www.example.com/products/product_page';
});
</script>
how and where do I add that ???
you have to add in Js file. which theme do you have ? send me link
Hi @Jarch
you can use this code to redirect your home page to product page direct
1. add this code in "layout->theme.liquid", before </head>
window.addEventListener('load', function() {
window.location.href = 'http://www.example.com/products/product_page';
});
Note: change url to your product page
Best regard
Hello, I added the code before </head> and changed the URL but the code just shows up in a white space above the header announcement bar.
Hi, in Shopify the homepage cannot be deleted. You can try redirecting home page to your collection or product page.
Click on "Navigation" or "URL Redirects" (the option might vary depending on your Shopify theme).
Look for an option to create a URL redirect. It may be labeled "URL Redirects," "URL Redirect Manager," or something similar.
Create a new redirect with the source URL being / (which represents the homepage) and set the target URL to the new destination URL you want.
Save your changes.
ALSO you can do the same thing with code (this is working one). Add before head in theme.liquid. ( '/' represents the home page)
<script>
window.addEventListener('load', function() {
// Check if this is the homepage
if (window.location.pathname === '/') {
// Redirect to the desired URL
window.location.href = 'URL of the page you want to get redirected to';
}
});
</script>
This doesn't really solve the issue because it still loads up the homepage then it loads the product page. Theres gota be a way to fully direct traffic to the singe main domain but lands on product page.
Here is an example shop that achieves this.
https://www.shopbotaniqueparis.com/
did you ever find a way i cant seem to find one
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024