Luc
Luc

Reputation: 412

Woocommerce single product broken

I'm developing a wordpress theme and for some reason, my woocommerce single-product is broken. It displays everything it's suppose too but it looks like css and javascript aren't working.

I already added woocommerce support in my function files.
If I change to twentyfourteen theme, then single-product is working normally.
Can somebody help me out?

Here's the link for the single product page: Link

Upvotes: 1

Views: 1272

Answers (1)

Ahmed Hassan
Ahmed Hassan

Reputation: 269

WooCommerce classes are not loading on your web page. If you already added WooCommerce theme support, then you might missing WordPress body function.

Make sure you have following line in functions.php

add_theme_support( 'woocommerce' );

Also include WordPress's body function, <body> tag must be like below.

<body <?php body_class() ?>>

If you already have any class for body, pass that class to this function like

<body <?php body_class( 'existing-class' ) ?>>

To enable WooCommerce gallery features in your theme you must declare support using add_theme_support() like so;

add_action( 'after_setup_theme', 'yourtheme_setup' );
function yourtheme_setup() {
    add_theme_support( 'wc-product-gallery-zoom' );
    add_theme_support( 'wc-product-gallery-lightbox' );
    add_theme_support( 'wc-product-gallery-slider' );
}

More Info here

Upvotes: 2

Related Questions