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
Where do you input it in the custom liquid? I add a section and paste it but it still doesn't change anything
{%- if template contains 'index' -%}
<script>
window.location.href = '/products/(insert whatever is in the URL)';
</script>
{%- endif -%}
Click on the 3 dots next to customize theme and past this in the theme.liquid section near the top of the categories on the left. when you paste it make sure to paste it just above the head section. if you have any trouble with this message me back or paste what i just said in chatgpt and ask it to explain the steps better!
Dropshipping, 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, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024