<?php
/**
 * Template part for displaying Top Bar Content
 *
 * @package vw_book_store_pro
 */ 

$about_section = get_theme_mod( 'vw_book_store_pro_topbar_enable' );
if ( 'Disable' == $about_section ) {
  return;
}
/*About us*/
$img_bg = get_theme_mod('vw_book_store_pro_topbar_image_bg');
if( get_theme_mod('vw_book_store_pro_topbar_bgcolor','') ) {
  $background_setting = 'background-color:'.esc_attr(get_theme_mod('vw_book_store_pro_topbar_bgcolor','')).';';
}elseif( get_theme_mod('vw_book_store_pro_topbar_bgimage','') ){
  $background_setting = 'background-image:url(\''.esc_url(get_theme_mod('vw_book_store_pro_topbar_bgimage')).'\')';
}else{
  $background_setting = '';
}
?>
<section id="site_top" class="top_bar <?php echo esc_attr($img_bg); ?>" style="<?php echo esc_attr($background_setting);  ?>">
  <div class="container container-full-width">
    <div class="row">
      <div class="col-lg-7 col-md-7 col-sm-12">
        <div class="contact_details">
          <ul>
            <?php if ( class_exists( 'WooCommerce' ) ) { ?>              
              <?php 
                if (is_user_logged_in()) { ?>
                  <li><i class="fas fa-user"></i><a href="<?php echo wp_logout_url( get_permalink( wc_get_page_id( 'shop' ) ) ); ?>"><?php echo esc_html(get_theme_mod('vw_book_store_pro_header_link2'));?></a></li>
                <?php }
                elseif (!is_user_logged_in()) { ?>
                  <li><i class="fas fa-user"></i><a href="<?php echo get_permalink( wc_get_page_id( 'myaccount' ) ); ?>"><?php echo esc_html(get_theme_mod('vw_book_store_pro_header_link1'));?></a></li>
              <?php }
            }  ?>
            <?php if(get_theme_mod('vw_book_store_pro_header_link3') != ''){ ?>
              <li>
                <i class="far fa-question-circle"></i>
                <a class="twitter" href="<?php echo esc_url( get_theme_mod( 'vw_book_store_pro_header_link3_url' ) ); ?>" target="_blank"><?php echo esc_html(get_theme_mod('vw_book_store_pro_header_link3'));?></a>
              </li>
            <?php } ?>
            <?php if(get_theme_mod('vw_book_store_pro_header_email_address') != ''){ ?>
              <li>
                <i class="far fa-envelope"></i>  <span class="p-0">
                      <a href="mailto:<?php echo esc_html( get_theme_mod('vw_book_store_pro_header_email_address') ); ?>" target="_blank"><?php echo esc_html( get_theme_mod('vw_book_store_pro_header_email_address') ); ?></a>
                    </span>
              </li>
            <?php } ?>
          </ul>
        </div>
      </div>
      <div class="col-lg-5 col-md-5 col-sm-12">
        <?php get_template_part('template-parts/footer/social-icons'); ?>
      </div>
    </div>
  </div>
</section>