<?php
namespace Elementor;

class headerfive extends Widget_Base {
	
	public function get_name() {
		return 'headerfive';
	}
	
	public function get_title() {
		return 'باکس سربرگ 4';
	}
	
	    public function get_icon() {
		return 'eicon eicon-header';
    }
    
    public function get_categories() {
        return [ 'farnam' ];
    }
	protected function register_controls() {


		$this->start_controls_section(
			'section_title',
			[
				'label' => __( 'Content', 'elementor' ),
			]
		);
		
		$this->add_control(
			'posts_per_page',
			[
				'label' => __( 'عنوان', 'elementor' ),
				'label_block' => true,
				'type' => Controls_Manager::TEXT,
				'placeholder' => __( 'یک عنوان وارد کنید', 'elementor' ),
			]
		);
		$this->add_control(
'title_color',
			[
				'label' => __( 'رنگ پس زمینه کاربری', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} .titlekarbar' => 'background: {{VALUE}} !important',
				],
			]
		);
				$this->add_control(
'color-two',
			[
				'label' => __( 'رنگ ایکون کاربری', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} .iconusertitle' => 'color: {{VALUE}} !important',
				],
			]
		);
				

		$this->add_control(
'color-two1',
			[
				'label' => __( 'رنگ ایکون سبد خرید', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} .left-sabad.min-car-6.gtr-654.sabadcolortitle' => 'color: {{VALUE}} !important',
				],
			]
		);
				
	$this->add_control(
'color-two2',
			[
				'label' => __( 'رنگ ایکون علاقه مندی', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} .left-sabad.gtr-654' => 'color: {{VALUE}} !important',
				],
			]
		);
		
				$this->add_control(

		'color-four',
			[
				'label' => __( 'رنگ شمارنده سبد خرید', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} .sabadnumbercolor' => 'background: {{VALUE}} !important',
				],
			]
		);
		
				$this->add_control(

		'color-four1',
			[
				'label' => __( 'رنگ متن شمارنده سبد خرید', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} .header-cart-count' => 'color: {{VALUE}} !important',
				],
			]
		);
		
				$this->add_control(

		'color-four2',
			[
				'label' => __( 'رنگ آیکون منو', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} .left-sabad.menu-resp .mdi.mdi-menu' => 'color: {{VALUE}} !important',
				],
			]
		);
		$this->add_control(
			'show_title',
			[
				'label' => __( 'نمایش علاقه مندی ها', 'plugin-domain' ),
				'type' => \Elementor\Controls_Manager::SWITCHER,
				'label_on' => __( 'نمایش', 'your-plugin' ),
				'label_off' => __( 'مخفی', 'your-plugin' ),
				'return_value' => 'yes',
				'default' => 'yes',
			]
		);
		$this->add_control(
			'show_title1',
			[
				'label' => __( 'نمایش سبد خرید', 'plugin-domain' ),
				'type' => \Elementor\Controls_Manager::SWITCHER,
				'label_on' => __( 'نمایش', 'your-plugin' ),
				'label_off' => __( 'مخفی', 'your-plugin' ),
				'return_value' => 'yes',
				'default' => 'yes',
			]
		);
		$this->add_control(
			'show_title2',
			[
				'label' => __( 'نمایش حساب کاربری', 'plugin-domain' ),
				'type' => \Elementor\Controls_Manager::SWITCHER,
				'label_on' => __( 'نمایش', 'your-plugin' ),
				'label_off' => __( 'مخفی', 'your-plugin' ),
				'return_value' => 'yes',
				'default' => 'yes',
			]
		);
		
				$this->add_control(
			'show_title3',
			[
				'label' => __( 'نمایش منو موبایل', 'plugin-domain' ),
				'type' => \Elementor\Controls_Manager::SWITCHER,
				'label_on' => __( 'نمایش', 'your-plugin' ),
				'label_off' => __( 'مخفی', 'your-plugin' ),
				'return_value' => 'yes',
				'default' => 'yes',
			]
		);
		
		$this->end_controls_section();
	}
	
	protected function render() {
		$settings = $this->get_settings_for_display();
		

		?>

<div class="left-header-box header-one-one-4 ss-nn-xx-11">

 <?php if ( 'yes' === $settings['show_title2'] ) { ?>


<?php if ( is_user_logged_in() ) { ?>


<div class="left-rr-user kkj-33434 gtr-654 gggg-f titlekarbar iconusertitle">
<i class="fi fi-rr-user"></i>
<div class="user-meta">
<a href="<?php echo home_url() ?>/my-account/"><i class="mdi mdi-view-dashboard-outline"></i>پنل کاربری </a>
<a href="<?php echo home_url() ?>/my-account/edit-account/"><i class="mdi mdi-account-outline"></i>ویرایش حساب کاربری </a>
<a href="<?php echo home_url() ?>/my-account/orders/"><i class="mdi mdi-card-bulleted-outline"></i> سفارش های شما </a>
<a href="<?php echo home_url() ?>/my-account/mywishlist/"><i class="mdi mdi-heart"></i> علاقه مندی های شما </a>

<div class="log-111">

<a  href="<?php echo home_url() ?>/my-account/customer-logout/"> <i class="mdi mdi-account-arrow-left-outline"></i>خروج از سایت </a>

</div>
</div>
</div>


 <?php } 
 else { ?>
 <a href="<?php echo home_url() ?>/my-account/" class="left-rr-user gtr-654 gggg-f titlekarbar iconusertitle">
<i class="fi fi-rr-user"></i>
</a>
 <?php } ?>
  <?php } ?>
 <?php if ( 'yes' === $settings['show_title1'] ) { ?>

 <span  class="left-sabad min-car-6 gtr-654 sabadcolortitle">
<i class="fi fi-rr-shopping-bag"></i><span class="sabadnumbercolor"><div class="header-cart-count"><?php echo WC()->cart->get_cart_contents_count(); ?></div></span>
<div class="mini-cart-3">

<div class="widget_shopping_cart_content"><?php woocommerce_mini_cart(); ?></div> </div>
</span>
 <?php } ?>
<?php if ( 'yes' === $settings['show_title'] ) { ?>
<a href="<?php echo home_url() ?>/wishlist/" class="left-sabad gtr-654">
 <i class="fi fi-rr-heart"></i> 
</a>
 <?php } ?>
 <?php if ( 'yes' === $settings['show_title3'] ) { ?>

<a class="left-sabad menu-resp" onclick="openNav()">
<i class="mdi mdi-menu"></i>
</a>
 <?php } ?>
</div>
 <?php if ( 'yes' === $settings['show_title3'] ) { ?>


<div id="mySidenav" class="sidenav">
  <a href="javascript:void(0)" class="closebtn" onclick="closeNav()">&times;</a>
<div class="mob-1"> 
          <form class="search" method="get" action="<?php bloginfo('url'); ?>">
<input type="text" placeholder="دنبال چی هستی؟
" onfocus="if (this.value == '') {this.value = '';}" onblur="if (this.value == '') {this.value = '';}" name="s" class="text">

<button type="submit" class="submit icon-search"><i class="mdi mdi-magnify"></i></button>
<input type="hidden" name="post_type" value="product" />
</form>

</div>
<div class="mobile-menu-1 stellarnav">
 <?php 
                        $defaults = array(
                            'theme_location' => 'header-menu',
                            'menu' => '',
                            'container' => '',
                            'container_class' => '',
                            'container_id' => '',
                            'menu_class' => 'main_menu',
                            'menu_id' => '',
                            'echo' => true,
                            'fallback_cb' => 'wp_page_menu',
							    'add_li_class'  => 'mega',
                            'before' => '',
                            'after' => '',
                            'link_before' => '',
                            'link_after' => ' ',
                            'items_wrap' => '<ul id="header_main_nav" class="nav header-nav header-bottom-nav nav-center  nav-uppercase">%3$s</ul>',
                            'depth' => 0,
                            'walker' => ''
                            );
                        wp_nav_menu($defaults);
                    ?>
</div>

<!-- required -->
	<script type="text/javascript">
		jQuery(document).ready(function($) {
			jQuery('.stellarnav').stellarNav({
				theme: 'dark',
				breakpoint: 3000,
				position: 'right',
				phoneBtn: '',
				locationBtn: ''
			});
		});
	</script>
	<!-- required -->
	</div> <?php } ?>

 <script>
/* Set the width of the side navigation to 250px */
function openNav() {
  document.getElementById("mySidenav").style.display = "block";
}

/* Set the width of the side navigation to 0 */
function closeNav() {
  document.getElementById("mySidenav").style.display = "none";
} 
</script>
      <script type="text/javascript">   $('document').ready(function () {   $(".kkj-33434").click(function(){    $('.user-meta').slideToggle('slow');   });   });
</script>

      <script type="text/javascript">   $('document').ready(function () {   $(".trybut").click(function(){    $('.box-etel').slideToggle('slow');   });   });
</script>


		<?php
	}
	
	protected function _content_template() {

    }
	
	
}