WooCommerce Uses single.php Instead of single-product.php: How to Fix It

WooCommerce uses its own template hierarchy. When a theme declares WooCommerce support, WooCommerce loads templates from woocommerce/ template folders in the theme. Without that declaration, WooCommerce falls back to the generic single.php template for product pages — breaking the product layout.

Problem: WooCommerce is ignoring the single-product.php template file in your theme and loading single.php instead for all product pages.

Solution: Call add_theme_support('woocommerce') inside your theme's after_setup_theme hook — without this declaration, WooCommerce falls back to single.php regardless of whether a single-product.php template exists in the theme folder.

The fix is a single function call in your theme's functions.php:

add_action( 'after_setup_theme', 'declare_woocommerce_support' );

function declare_woocommerce_support() {
    add_theme_support( 'woocommerce' );

    // Optional: enable WooCommerce gallery features
    add_theme_support( 'wc-product-gallery-zoom' );
    add_theme_support( 'wc-product-gallery-lightbox' );
    add_theme_support( 'wc-product-gallery-slider' );
}

With WooCommerce support declared, the template lookup order for a single product page becomes:

1. wp-content/themes/your-theme/woocommerce/single-product.php  (theme override)
2. wp-content/plugins/woocommerce/templates/single-product.php   (WooCommerce default)

To create a theme override, copy the WooCommerce template into your theme:

mkdir -p wp-content/themes/your-theme/woocommerce/
cp wp-content/plugins/woocommerce/templates/single-product.php    wp-content/themes/your-theme/woocommerce/single-product.php

NOTE: WooCommerce templates change between versions. After updating WooCommerce, compare your theme overrides against the updated plugin templates and apply any structural changes. The WooCommerce System Status page (WooCommerce → Status → Templates) shows which theme overrides are out of date.