Home Forums Basel support forum Visual Composer Product Category Grid Reply To: Visual Composer Product Category Grid

#1679

Artem Temos
Keymaster

We have found this bug in our theme. It will be fixed in the next release.

As a work around you may try to replace all lines in the file basel/woocommerce/content-product_cat.php

<?php
/**
 * The template for displaying product category thumbnails within loops.
 *
 * Override this template by copying it to yourtheme/woocommerce/content-product_cat.php
 *
 * @author 		WooThemes
 * @package 	WooCommerce/Templates
 * @version 	2.6.1
 */

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

global $woocommerce_loop;

$isotope 		 = basel_get_opt( 'products_masonry' );
$different_sizes = basel_get_opt( 'products_different_sizes' );

// Store column count for displaying the grid
if ( empty( $woocommerce_loop['columns'] ) )
	$woocommerce_loop['columns'] = apply_filters( 'loop_shop_columns', 4 );

// Increase loop count
// $woocommerce_loop['loop']++;

$different_sizes = false;

if( ! empty( $woocommerce_loop['different_sizes'] ) ) {
	$different_sizes = $woocommerce_loop['different_sizes'];
	$isotope = true;
}

// Store loop count we're currently on
if ( empty( $woocommerce_loop['loop'] ) ) {
	if( $different_sizes ) {
		$woocommerce_loop['loop'] = 1;
	} else {
		$woocommerce_loop['loop'] = 0;
	}
}

$classes = array();
$classes[] = basel_get_grid_el_class($woocommerce_loop['loop'], $woocommerce_loop['columns'], $different_sizes);
$classes[] = 'category-grid-item';

?>
<div <?php wc_product_cat_class($classes, $category); ?>>
	
	<div class="category-content">
		<a href="<?php echo esc_url( get_term_link( $category->slug, 'product_cat' ) ); ?>">
			<?php do_action( 'woocommerce_before_subcategory', $category ); ?>

			<?php
				/**
				 * woocommerce_before_subcategory_title hook
				 *
				 * @hooked woocommerce_subcategory_thumbnail - 10
				 */
				do_action( 'woocommerce_before_subcategory_title', $category );
			?>
		</a>
		<div class="hover-mask">
			<h3>
				<?php
					echo esc_html( $category->name );

					if ( $category->count > 0 )
						echo apply_filters( 'woocommerce_subcategory_count_html', ' <mark class="count">(' . $category->count . ')</mark>', $category );
				?>
			</h3>

			<a href="<?php echo esc_url( get_term_link( $category->slug, 'product_cat' ) ); ?>"><?php _e('View products', 'basel'); ?></a>

			<?php
				/**
				 * woocommerce_after_subcategory_title hook
				 */
				do_action( 'woocommerce_after_subcategory_title', $category );
			?>
		</div>

		<?php do_action( 'woocommerce_after_subcategory', $category ); ?>
	</div>
</div>

<?php if( ! $isotope ) echo basel_get_grid_clear($woocommerce_loop['loop'], $woocommerce_loop['columns']); ?>

Regards