In a recent WooCommerce development project, I wanted to disable click on product image, I needed to create an easy and quick way to disable click on the product image.
I created this solution that I will share with you in this quick guide and also WooCommerce disable click on product image code snippet that you can reuse in your WooCommerce development projects or customization of WooCommerce to help you save time and be more productive.
WooCommerce Disable Click on Product Image
You should add the following code to your custom CSS to disable the pointer events on the product image :
[php]/**
* WooCommerce Disable Click on Product Image
*/
.woocommerce-product-gallery__image{
pointer-events: none;
}
.woocommerce-product-gallery__trigger {
display: none !important;
}
As you can see in the image below, I have added this code to the custom CSS section in the customizer and it works. You can also add this code to your child theme styles and it should work well.
Conclusion
I guess you can now comfortably disable click on product image by following the steps I have outlined in this quick guide. The take from this tutorial is to disable click on product image you need to add the custom CSS to the child theme or the additional CSS in your customizer section.
If you need further assistance in fixing this issue, I can quickly check and advise what is the best way to get this done in your specific WooCommerce theme. I would be glad to help you, feel free to reach out for further assistance, you can get in touch for free consultation.
Joe is an experienced full-stack web developer with a decade of industry experience in the LAMP & MERN stacks, WordPress, WooCommerce, and JavaScript – (diverse portfolio). He has a passion for creating elegant and user-friendly solutions and thrives in collaborative environments. In his spare time, he enjoys exploring new tech trends, tinkering with new tools, and contributing to open-source projects. You can hire me here for your next project.
Similar Articles
- How to Delete a Page In WordPress
- How To Display Product Variations In WooCommerce
- How to Create tax_query WooCommerce Example
- Elementor Review 2021 » Features, Pros, Cons, Pricing & Tutorial
- How to Add Local Pickup to WooCommerce
- How to Get Product Image src WooCommerce
- How to Change Out Of Stock Text in WooCommerce
- How to Insert Default Content to WordPress Post Editor Dynamically
- How to Remove Product Category from URL WooCommerce Without Plugin
- How to Fix Duplicate WooCommerce Product Showing up on Page
- How to Change WooCommerce Storefront Layout
- How to Get Current Product Category Name in WooCommerce
- How to Add Video In Product Image WooCommerce
- How to Remove Product Image Placeholder In WooCommerce
- How to Add Text after Price in WooCommerce » Add Price Suffix
- How to Hide Product Image on Cart Page WooCommerce
- How to Get Rid of Leave a Reply on WordPress
- How to Delete a Category in WordPress