/*!
Theme Name: CafeXP Child
Theme URI: https://iqonic.design/wp-themes/cafexp_wp/
Author: Iqonic Design
Author URI: https://iqonic.design/
Description: CafeXP - Coffee Eatery WordPress Theme
Template: cafexp
Version: 1.0.0
Requires at least: 5.5
Tested up to: 5.7
Requires PHP: 5.6+
License: GNU General Public License v3.0 (or later)
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: cafexp-child
Tags: four-columns,left-sidebar,right-sidebar,custom-background,custom-colors,custom-header,custom-logo,custom-menu

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share
what you've learned with others.
*/

/*In nAvigation Php
<?php

/**
 * Template part for displaying the header navigation menu
 *
 * @package cafexp
 

namespace cafexp\cafexp;

$cafexp_options = get_option('cafexp-options');
?>

<nav id="site-navigation" class="navbar navbar-expand-xl navbar-light p-0" aria-label="<?php esc_attr_e('Main menu', 'cafexp'); ?>" <?php
																																	if (cafexp()->is_amp()) {
																																	?> [class]=" siteNavigationMenu.expanded ? 'main-navigation nav--toggle-sub nav--toggle-small nav--toggled-on' : 'main-navigation nav--toggle-sub nav--toggle-small' " <?php
																																																																										}
																																																																											?>>

	<a class="navbar-brand" href="<?php echo esc_url(home_url('/')); ?>">
		<?php
		if (function_exists('get_field') && class_exists('ReduxFramework')) {
			$cafexp_options = get_option('cafexp-options');
			$key = get_field('key_header');
			if (!empty($key['header_logo']['url'])) {
				$options = $key['header_logo']['url'];		?>
				<img class="img-fluid logo" src="<?php echo esc_url($options); ?>" alt="<?php esc_attr_e('cafexp', 'cafexp'); ?>">
				<?php
			} else if (isset($cafexp_options['header_radio'])) {
				if ($cafexp_options['header_radio'] == 1) {
					$options = $cafexp_options['header_text'];
					$tag = $cafexp_options['cafexp_header_logo_tag'];
					echo '<' . esc_attr($tag) . ' class="logo logo-text">' . esc_html_($options, 'cafexp') . '</' . esc_attr($tag) . '>';
				}
				if ($cafexp_options['header_radio'] == 2) {
					$options = $cafexp_options['cafexp_logo']['url']; ?>
					<img class="img-fluid logo" src="<?php echo esc_url($options); ?>" alt="<?php esc_attr_e('cafexp', 'cafexp'); ?>">
				<?php }
			}
		} elseif (has_header_image()) {
			$image = wp_get_attachment_image_src(get_theme_mod('custom_logo'), 'full');
			if (has_custom_logo()) { ?>
				<img class="img-fluid logo" src="<?php echo esc_url($image); ?>" alt="<?php esc_attr_e('cafexp', 'cafexp'); ?>">
				<img class="img-fluid logo-sticky" src="<?php echo esc_url($image); ?>" alt="<?php esc_attr_e('cafexp', 'cafexp'); ?>">
			<?php } else { ?>
				<?php bloginfo('name'); ?>
			<?php }
		} else {
			?>
			<img class="img-fluid logo" src="<?php echo get_template_directory_uri(); ?>/assets/images/logo.svg" alt="<?php esc_attr_e('cafexp', 'cafexp'); ?>">
		<?php } ?>
		<?php
		if (isset($cafexp_options['header_sticky_radio'])) {
			if ($cafexp_options['header_sticky_radio'] == 1) {
				$options = $cafexp_options['header_sticky_text'];
				$tag = $cafexp_options['cafexp_header_logo_sticky_tag'];
				echo '<' . esc_attr($tag) . ' class="logo-sticky logo-text">' . esc_html_($options, 'cafexp') . '</' . esc_attr($tag) . '>';
			}
			if ($cafexp_options['header_sticky_radio'] == 2) {
				$options = $cafexp_options['cafexp_sticky_logo']['url']; ?>
				<img class="img-fluid logo-sticky" src="<?php echo esc_url($options); ?>" alt="<?php esc_attr_e('cafexp', 'cafexp'); ?>">

			<?php }
		} else {
			?>
			<img class="img-fluid logo-sticky" src="<?php echo get_template_directory_uri(); ?>/assets/images/logo.svg" alt="<?php esc_attr_e('cafexp', 'cafexp'); ?>">

		<?php }
		?>
	</a>

	<button type="button" class="navbar-toggler" data-toggle="collapse" aria-label="<?php esc_attr_e('Open menu', 'cafexp'); ?>" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" <?php
																																																								if (cafexp()->is_amp()) {
																																																								?> on="tap:AMP.setState( { siteNavigationMenu: { expanded: ! siteNavigationMenu.expanded } } )" [aria-expanded]="siteNavigationMenu.expanded ? 'true' : 'false'" <?php
																																																																																																}
																																																																																																	?>>
		<?php esc_html_e('Menu', 'cafexp'); ?>

		<span class="cafexp-menu-toggle moblie-menu">
			<span class="hamburger" id="hamburger">
				<span class="line"></span>
				<span class="line"></span>
				<span class="line"></span>
			</span>
		</span>
	</button>

	<div id="navbarSupportedContent" class="collapse navbar-collapse new-collapse">
		<div id="cafexp-menu-container" class="menu-all-pages-container">
			<?php
			if (cafexp()->is_primary_nav_menu_active()) {
				cafexp()->display_primary_nav_menu(array('menu_id' => 'top-menu', 'menu_class' => 'navbar-nav ml-0'));
			}
			?>
		</div>
	</div>
	
	<?php if (class_exists('ReduxFramework')) {
		if ($cafexp_options['header_display_booking_button'] == 'yes') {
			if ($cafexp_options['cafexp_link_type'] == 'dynamic') {
				$url =  get_permalink($cafexp_options['cafexp_booking_url_dynamic']);
			} else {
				if (!empty($cafexp_options['cafexp_booking_url'])) {
					$url =  $cafexp_options['cafexp_booking_url'];
				} else {
					$url =  '#';
				}
			}
		}
	?>

		<!-- shop page button start -->
    <!--mobile View-->
    <?php
    if ( class_exists( 'WooCommerce' ) && isset($cafexp_options['header_display_shop']) && $cafexp_options['header_display_shop'] == 'yes') 
    {   
	?>
   <div class="woo-menu">
        <div id="shop-toggle">
            <div class="cafexp-res-shop-btn-container cafexp-btn-4" id='x-ver-res-btn'>
                <?php 
                    $shop_url = '';
                    if(isset($cafexp_options['shop_link']) && !empty($cafexp_options['shop_link']))
                    {
                    $shop_url = get_page_link($cafexp_options['shop_link']);
                    }
                ?>
                <a href="https://www.recaffe.ch/warenkorb/">
                    <span class="cafexp-res-shop-btn">
                        <i class="fa fa-shopping-basket" aria-hidden="true"></i>
                    </span>
                </a>
            </div>
            <ul class="shop_list">
                <!-- wishlist -->
                <?php 
                    if(function_exists('YITH_WCWL') && isset($cafexp_options['header_display_shop']) && $cafexp_options['header_display_shop'] == 'yes')
                    {
                        $wish_url = '';
                        if(isset($cafexp_options['wishlist_link']) && !empty($cafexp_options['wishlist_link']))
                        {
                        $wish_url = get_page_link($cafexp_options['wishlist_link']);
                        }
                ?>
                <li class="wishlist-btn">
                    <div class="wishlist_count">
                        <?php $wishlist_count = YITH_WCWL()->count_products(); ?>
                        <a href="<?php echo esc_url($wish_url); ?>">
                            <i class="fa fa-heart"></i>
                            <span class="wcount"><?php echo esc_html($wishlist_count); ?></span>
                        </a>
                    </div>
                </li>
                <?php } ?>
                <!-- mini cart -->
                <?php 
                if(isset($cafexp_options['header_display_shop']))
                {
                    $options = $cafexp_options['header_display_shop'];
                    if($options == "yes")
                    { ?>
                    <li class="cart-btn">
                        <div class="cart_count">
                            <a class="parents mini-cart-count" href="<?php echo wc_get_cart_url(); ?>">
                                <i class="fa fa-shopping-cart"></i>
                                <span id="mini-cart-count"><?php echo WC()->cart->get_cart_contents_count(); ?></span>
                            </a>
                        </div>
                    </li>
                <?php 
                    } 
                } ?>
            </ul>
        </div>
    </div>
    <?php } ?>
	
		

	<div class="cafexp-shop-btn-holder">
		<div class="search_count">
			<span id="btn-search"><i class="fa fa-search"></i></span>
			<div class="search">
				<button id="btn-search-close" class="btn btn--search-close" aria-label="Close search form">
					<i class="fa fa-times"></i>
				</button>
				<?php get_search_form() ?>
			</div>
		</div>
	</div>

	<div class="cafexp-header_booking-btn-holder cafexp-btn-container">
		<div class="header_booking_button">
			<a class="cafexp-button" href="<?php echo esc_html($url); ?>" id="btn-booking">
				<?php if (!empty($cafexp_options['cafexp_booking_text'])) {
					echo '<div class="theme_btn_smoke_effect">';
					echo __($cafexp_options['cafexp_booking_text'], 'cafexp');
					echo '</div>';
				} ?></a>
		</div>
	</div>
	<?php } ?>
</nav><!-- #site-navigation -->*/