Woocommerce products are displaying on singular.php

242 views Asked by At

I have created a custom theme and downloaded woocommerce plugin, the shop page is working fine however when I view a product only the content appears.

The products exist and when I copy the single-product.php into the theme folder they display correctly, but I want it to use the plugin folder and use the single-product.php file currently it is using singular.php to display the product why is the theme not using the plugin folder for the products I used the twentytwenty theme and it works fine but on my custom theme this is happening any help would be much apricated. single.php

1

There are 1 answers

0
Dotsquares On

Currently, there is no support for woo-commerce, please add the below code in the functions.php file.

function mytheme_add_woocommerce_support() {
    add_theme_support( 'woocommerce' );
    add_theme_support( 'wc-product-gallery-zoom' );
    add_theme_support( 'wc-product-gallery-lightbox' );
    add_theme_support( 'wc-product-gallery-slider' );
}

add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );