Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi,
I am using the Prestige theme and would like to disable the URL redirection when clicking on the product image that's on my home page. Rather than redirecting to the product page, I'd like for the product image to do nothing at all when clicking on it, i.e. I just want to remain on the same page.
Thanks!
Solved! Go to the solution
This is an accepted solution.
Hi @ggbears2022
Please follow these steps:
Go to Online Store > Theme > Edit Code, and find the assets folder. Then, please add the following code at the end of any JS file until the image link doesn't work. Usually, that file is called theme.js:
setTimeout(() => {
document.querySelector(".FeaturedProduct .FeaturedProduct__Gallery").style.pointerEvents = "none"
}, 1000)
I hope that it will work for you.
If our suggestions are useful, please let us know by giving it a like, marking it as a solution, or donating here ☕.
B2B Solution & Custom Pricing | Product Labels by BSS
Need help from our expert? Kindly share your request with us via community@bsscommerce.com
Hello @ggbears2022
You can follow these steps:
1. Go to Online Store->Theme->Edit code
2. Open your theme.liquid file, paste the below code before </body>
{% if template contains 'index' %}
<script src="https://code.jquery.com/jquery-3.6.3.min.js" integrity="sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU=" crossorigin="anonymous"></script>
<script>
$(document).ready(function() {
$('.ProductItem a.ProductItem__ImageWrapper').attr("href", "javascript:void(0)")
});
</script>
{% endif %}
I hope the above is useful to you.
Kind & Best regards,
GemPages Support Team
Hi @GemPages, thanks for the response. Unfortunately, the same issue is still persisting after adding the code. I'd appreciate any other potential solutions that you may have. Thanks!
Hello @ggbears2022 ,
Please share your store URL and password.
So that I will check and let you know the exact solution here.
Hi @f_malik, will this preview of our site suffice? https://k6pg6achah3p6wxi-68791861539.shopifypreview.com
thank you!
This is an accepted solution.
Hi @ggbears2022
Please follow these steps:
Go to Online Store > Theme > Edit Code, and find the assets folder. Then, please add the following code at the end of any JS file until the image link doesn't work. Usually, that file is called theme.js:
setTimeout(() => {
document.querySelector(".FeaturedProduct .FeaturedProduct__Gallery").style.pointerEvents = "none"
}, 1000)
I hope that it will work for you.
If our suggestions are useful, please let us know by giving it a like, marking it as a solution, or donating here ☕.
B2B Solution & Custom Pricing | Product Labels by BSS
Need help from our expert? Kindly share your request with us via community@bsscommerce.com
Hi, @BSS-Commerce I encounter the same problem that the it redirects to the home page when I click on the product page. How can I stop the redirect? I'm using Testament theme and couldn't find the code in the JS file you mentioned above. Can you please help?
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