pierrebalian of Rocket55 Web Team
8/17/2017 - 4:09 PM

woocommerce popular brands carousel with slick and custom taxonomy loop

woocommerce popular brands carousel with slick and custom taxonomy loop

<section class="popular-brands">
	<div class="container">
		<div class="row text-center">
			<div class="col-md-10 col-md-offset-1">
			<h1 class="sectionheading script">Brands We Carry</h1>
			<p>Browse our selection of high quality products from some of the top brands in the industry. </p>
			</div>
		</div>
		<div class="row padsides text-center">
			<?php 
			// get all the brands with link
			$brands = get_terms(array(
				'taxonomy' => 'product_brand',
				'hide_empty' => false,
				'order' => 'DESC',
				'orderby' => 'count',
				'number' => 12,
				)); 
			echo '<div class="brand-carousel">';
			foreach ($brands as $brand) { ;?>
			<?php 
			$thumbnail = get_brand_thumbnail_url( $brand->term_id, apply_filters( 'woocommerce_brand_thumbnail_size', 'brand-thumb' ) );
			if ( ! $thumbnail )
				$thumbnail = wc_placeholder_img_src(); 
			?>
			<div class="col-md-3">
				<a href="<?php echo get_term_link( $brand->slug, 'product_brand' ); ?>" title="<?php echo $brand->name; ?>" class="term-thumbnail">
					<img src="<?php echo $thumbnail; ?>" alt="<?php echo $brand->name; ?>" />
					<h3><?php //echo $brand->name; ?></h3>
				</a>
				<div id="term-<?php echo $brand->term_id; ?>" class="term-description">
					<?php echo wpautop( wptexturize( $brand->description ) ); ?>
				</div>
			</div>
			<?php }
			echo '</div>';
			?>
		</div>
	</div>
</section>