· Design My Website · Code Snippets  · 1 min read

How to Disable Image Zoom on WooCommerce Product Pages

Steps: Why This Works: Important Notes: If you don’t want to mess around with the functions.php file you can download a plugin called Code Snippets. You can download it here.

Steps:

  1. Access Your WordPress Dashboard:
    • Go to Appearance > Theme File Editor.
    • Alternatively, use an FTP client or a code editor if you prefer working locally.
  2. Edit the Functions File:
    • Open your theme’s functions.php file (preferably in a child theme to avoid losing changes during updates).
  3. Add the Code: _add_filter( 'woocommerce_single_product_zoom_enabled', '__return_false' );_
  4. Save Changes:
    • Click Update File if editing through WordPress or upload the file if using FTP.

Why This Works:

  • This code uses WooCommerce’s built-in filter woocommerce_single_product_zoom_enabled to disable the zoom feature globally by returning false.

Important Notes:

  • Use a Child Theme: If you’re editing the functions.php file directly, consider using a child theme to avoid overwriting changes when updating the theme.
  • Test the Site: Clear your browser and website cache, then check a single product page to ensure the zoom feature is disabled.

If you don’t want to mess around with the functions.php file you can download a plugin called Code Snippets. You can download it here.

    Share:
    Back to Blog

    Related Posts

    View All Posts »

    Add a custom font to Salient WordPress theme

    Step 1: Download and Install the Custom Fonts Plugin Download the Custom Fonts plugin from this link, and install it on your WordPress site. Step 2: Upload Your Fonts After installing and activating the plugin: Step 3: Add the Custom Fonts to Salient Typography To make your custom fonts appear in Sa

    Replace a label on WooCommerce checkout

    The modify_state_county_label function customizes the text displayed on a WooCommerce site, specifically targeting the “State/County” label. Here’s a breakdown of what it does and how it works: Function Explanation Hook: add_filter The add_filter function is used to attach modify_state_county_label

    How much does a website cost in Ireland?

    One of the most common questions we get asked at Design My Website is “how much does a website cost in Ireland?” The honest answer is — it depends. The cost of a website varies depending on the size, complexity and features you need. In this guide we break down exactly what you can expect