<?php
/**
 * The template for displaying products
 */

get_header();

global $restorator_options;

$restorator_shop_class = '';

$restorator_shop_layout = isset( $restorator_options['shop_layout'] ) ? $restorator_options['shop_layout'] : 'right-sidebar';
if( $restorator_shop_layout == 'left-sidebar' ) {
	$restorator_sidebar_class = 'pull-left ';
	$restorator_shop_class .= 'left_sidebar ';
	$restorator_shop_list_class = 'col-md-9 pull-right';
} elseif( $restorator_shop_layout == 'right-sidebar' ) {
	$restorator_sidebar_class = 'pull-right';
	$restorator_shop_class .= 'right_sidebar ';
	$restorator_shop_list_class = 'col-md-9 pull-left ';
} else {
	$restorator_sidebar_class = $restorator_shop_list_class = '';
	$restorator_shop_class .= 'no_sidebar ';
}

$restorator_shop_columns = isset( $restorator_options['shop_columns'] ) ? $restorator_options['shop_columns'] : 'col3';
$restorator_shop_class .= $restorator_shop_columns . ' ';
?>

		<div id="products_list" class="container <?php echo esc_html( $restorator_shop_class ); ?>">
			
			<?php
			if( $restorator_shop_layout != 'no-sidebar' && !is_product() ) {
			echo '
				<div class="row">
					<div class="' . esc_html( $restorator_shop_list_class ) . '">';
			}
			?>

						<div class="shop_wrap clearfix">
				
							<?php woocommerce_content(); ?>
						
						</div>
					
			<?php
			if( $restorator_shop_layout != 'no-sidebar' && !is_product() ) {
			echo '</div>';
			}
			?>
				
			<?php if( $restorator_shop_layout != 'no-sidebar' && !is_product() ) { ?>
					<div class="col-md-3 <?php echo esc_html( $restorator_sidebar_class ); ?>">
						<?php get_sidebar(); ?>
					</div>
				</div>
			<?php } ?>
			
		</div>

<?php get_footer(); ?>