Shopify themes, liquid, logos, and UX
Hi everyone,
On my product page I have full details and an app integrated onto it with trust badges which I cannot display on my home page. I would like to change the default "home" page to my product page. I previously tried this line of code however it redirected to collection page and I cannot find the correct solution:
{%- if template contains 'index' -%}
<script>
window.location.href = '/products';
</script>
{%- endif -%}
Id then just like to completely remove the home page in its entirety as I will have no need for it as product page will be the new homepage.
Thanks!
Solved! Go to the solution
This is an accepted solution.
Hello @samm7560
You are using the code you just set it to the products you need to pass the handle of the product too which you can get from the product page url
{%- if template contains 'index' -%}
<script>
window.location.href = '/products/handle-of-product';
</script>
{%- endif -%}
This is an accepted solution.
Hello @samm7560
You are using the code you just set it to the products you need to pass the handle of the product too which you can get from the product page url
{%- if template contains 'index' -%}
<script>
window.location.href = '/products/handle-of-product';
</script>
{%- endif -%}
Thank you very much! I did try this last night and got a 404 page instead but this has now worked!
User | RANK |
---|---|
135 | |
91 | |
76 | |
66 | |
52 |
Learn these 5 things I had to learn the hard way with starting and running my own business
By Kitana Jan 27, 2023Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...
By Gabe Jan 6, 2023How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...
By Skye Dec 30, 2022