Woo commerce not supporting css

Woo commerce not supporting css

This is mostly happened while updating old version  or installing new version directly .This is mainly because of new versions have a wrapper missing .This missing cause to prevent all other sub classes .so you want to do following our intention is to  wrap <?php woocommerce_content(); ?> in a <div class="woocommerce"></div>

Here is the solution for Woo commerce not supporting for product page and single.php but cart ,checkout and all others are working fine what to do ?

For product page

1. Go wp contents =>plugins =>woo commerce =>templates =>archive product.php (for product page ) then take it in your dream weaver to edit .(you can edit it as indicated or coppy and paste  this code to your template)

 

Take from here in your template (dont delete anything just add the following class here )

<div class=”woocommerce”> /** add this class here */

<?php if ( apply_filters( ‘woocommerce_show_page_title’, true ) ) : ?>

<?php /*?><h1 class=”page-title”><?php woocommerce_page_title(); ?></h1><?php */?>

<?php endif; ?>

<?php do_action( ‘woocommerce_archive_description’ ); ?>

<?php if ( have_posts() ) : ?>

<?php
/**
* woocommerce_before_shop_loop hook
*
* @hooked woocommerce_result_count – 20
* @hooked woocommerce_catalog_ordering – 30
*/
do_action( ‘woocommerce_before_shop_loop’ );
?>

<?php woocommerce_product_loop_start(); ?>

<?php woocommerce_product_subcategories(); ?>

<?php while ( have_posts() ) : the_post(); ?>

<?php wc_get_template_part( ‘content’, ‘product’ ); ?>

<?php endwhile; // end of the loop. ?>

<?php woocommerce_product_loop_end(); ?>

<?php
/**
* woocommerce_after_shop_loop hook
*
* @hooked woocommerce_pagination – 10
*/
do_action( ‘woocommerce_after_shop_loop’ );
?>

<?php elseif ( ! woocommerce_product_subcategories( array( ‘before’ => woocommerce_product_loop_start( false ), ‘after’ => woocommerce_product_loop_end( false ) ) ) ) : ?>

<?php wc_get_template( ‘loop/no-products-found.php’ ); ?>

<?php endif; ?>

<?php
/**
* woocommerce_after_main_content hook
*
* @hooked woocommerce_output_content_wrapper_end – 10 (outputs closing divs for the content)
*/
do_action( ‘woocommerce_after_main_content’ );
?>
</div>/** End div class here */

<?php
/**
* woocommerce_sidebar hook
*
* @hooked woocommerce_get_sidebar – 10
*/
do_action( ‘woocommerce_sidebar’ );
?>

<?php get_footer( ‘shop’ ); ?>

For single product page

Go wp contents =>plugins =>woo commerce =>templates =>content-single-product.php

add same class (div class=”woocommerce”) as indicated or copy and past following

<?php
/**
* The template for displaying product content in the single-product.php template
*
* Override this template by copying it to yourtheme/woocommerce/content-single-product.php
*
* @author         WooThemes
* @package     WooCommerce/Templates
* @version     1.6.4
*/

if ( ! defined( ‘ABSPATH’ ) ) exit; // Exit if accessed directly
?>

<?php
/**
* woocommerce_before_single_product hook
*
* @hooked wc_print_notices – 10
*/

if ( post_password_required() ) {
echo get_the_password_form();
return;
}
?>

<div class=”woocommerce”>
<div itemscope itemtype=”<?php echo woocommerce_get_product_schema(); ?>” id=”product-<?php the_ID(); ?>” <?php post_class(); ?>>

<?php
/**
* woocommerce_before_single_product_summary hook
*
* @hooked woocommerce_show_product_sale_flash – 10
* @hooked woocommerce_show_product_images – 20
*/
do_action( ‘woocommerce_before_single_product_summary’ );
?>

<div class=”summary entry-summary”>

<?php
/**
* woocommerce_single_product_summary hook
*
* @hooked woocommerce_template_single_title – 5
* @hooked woocommerce_template_single_rating – 10
* @hooked woocommerce_template_single_price – 10
* @hooked woocommerce_template_single_excerpt – 20
* @hooked woocommerce_template_single_add_to_cart – 30
* @hooked woocommerce_template_single_meta – 40
* @hooked woocommerce_template_single_sharing – 50
*/
do_action( ‘woocommerce_single_product_summary’ );
?>

</div><!– .summary –>

<?php
/**
* woocommerce_after_single_product_summary hook
*
* @hooked woocommerce_output_product_data_tabs – 10
* @hooked woocommerce_upsell_display – 15
* @hooked woocommerce_output_related_products – 20
*/
do_action( ‘woocommerce_after_single_product_summary’ );
?>

<meta itemprop=”url” content=”<?php the_permalink(); ?>” />

</div><!– #product-<?php the_ID(); ?> –>

<?php do_action( ‘woocommerce_after_single_product’ ); ?>

======================

Woo commerce not supporting for product page and single.php but cart ,checkout and all others are working fine what to do ?

Share this post


WhatsApp chat