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!
Hi,
Where did you put this code in order to change it.
go to custom liquid and input that code
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024