<?php
/**
 * Template part for displaying Header Widgets Content
 *
 * @package vw_book_store_pro
 */ 
$header_widgets_section = get_theme_mod( 'vw_book_store_pro_header_widgets_enable' );
if ( 'Disable' == $header_widgets_section ) {
  return;
}
if( get_theme_mod('vw_book_store_pro_header_widgets_bgcolor','') ) {
  $background_setting = 'background-color:'.esc_attr(get_theme_mod('vw_book_store_pro_header_widgets_bgcolor','')).';';
}else{
  $background_setting = '';
}
?>
<?php if ( class_exists( 'WooCommerce' ) ) { ?>
<div id="header_widgets" style="<?php echo esc_attr($background_setting);  ?>">
  <div class="container">
    <div class="row">
      <div class="col-md-3 col-sm-12 col-12 p-md-0 cart_col">
        <div class="cat_toggle"> 
          <?php echo esc_html(get_theme_mod('vw_book_store_pro_header_cat_text')); ?><i class="fas fa-bars"></i></div>
        <div id="cart_animate">          
          <div id="cat_toggle">
            <?php the_widget( 'WC_Widget_Product_Categories', 'title=' ); ?>
          </div>
        </div>
      </div>
      <?php if(get_theme_mod('vw_book_store_pro_header_search_widget',true) != ''){ ?>
        <div class="col-md-8 col-sm-9 col-9 search_col"> 
          <?php the_widget( 'WC_Widget_Product_Search', 'title=' ); ?>
        </div>
      <?php } ?>
      <div class="col-md-1 col-sm-3 col-3 divider_col">
        <div class="divider"></div>
        <?php if(get_theme_mod('vw_book_store_pro_header_cart',true) != ''){ ?>
          <li class="cart_box" id="cart-box">
            <i class="fas fa-shopping-bag"></i>
            <span class="cart-value"> <?php echo wp_kses_data( WC()->cart->get_cart_contents_count() );?></span>
            <div class="top-cart" id="cart" >
              <div id="top-add-to-cart">
                <div class="top-cart-inner">
                  <?php the_widget( 'WC_Widget_Cart', 'title=' ); ?>
                </div>
              </div>
               
            </div>

          </li>
        <?php } 
        else {
        echo '<h6>'.esc_html('Please Install Woocommerce Plugin To display cart box','vw-book-store-pro').'<h6>'; }?>
      </div> 
    </div>
  </div>
</div>
<?php } ?>