<?php
namespace Elementor;

class easysingle extends Widget_Base {
	
	public function get_name() {
		return 'easysingle';
	}
	
	public function get_title() {
		return 'دسترسی اسان';
	}
	
 public function get_icon() {
		return 'eicon eicon-products';
    }
    
    public function get_categories() {
        return [ 'farnamproduct' ];
    }

	
	protected function register_controls() {


	


		
		
  $this->start_controls_section(
            'farnam_product_style_2',
            [
                'label' => esc_html__( 'تنظیمات استایل و ظاهر', 'woolentor' ),
            ]
        );


		    $this->add_control(
'sepidcolor-2',
			[
				'label' => __( 'رنگ پس زمینه', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} .product-meta-sepid.iransingle-product' => 'background: {{VALUE}} !important',
				],
			]
           );
		   
		   
		   		    $this->add_control(
'sepidcolor-2derr',
			[
				'label' => __( 'رنگ کادر باکس اصلی', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} .product-meta-sepid.iransingle-product' => 'border-color: {{VALUE}} !important',
				],
			]
           );
		   
		      $this->add_control(
'sepidcolor-3',
			[
				'label' => __( 'رنگ ایکون علاقه مندی', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} .meta-v-sopid-box .yith-wcwl-add-to-wishlist a .yith-wcwl-icon.fa.fa-heart-o' => 'color: {{VALUE}} !important',
				],
			]
           );
		   
		   
		       $this->add_control(
'sepidcolor-4',
			[
				'label' => __( 'رنگ هاور ایکون علاقه مندی', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} .meta-v-sopid-box .yith-wcwl-add-to-wishlist a:hover i' => 'color: {{VALUE}} !important',
				],
			]
           );
		   
		   
		   
		   
  $this->add_control(
'sepidcolor-5fr1',
			[
				'label' => __( 'رنگ ایکون مقایسه', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} .meta-v-sopid-box .woosc-btn::before' => 'color: {{VALUE}} !important',
				],
			]
           );
		   
		   
  $this->add_control(
'sepidcolor-5fr12dffd',
			[
				'label' => __( 'رنگ هاور ایکون مقایسه', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} .meta-v-sopid-box .woosc-btn:hover::before' => 'color: {{VALUE}} !important',
				],
			]
           );
		   
		   
		    $this->add_control(
'sepidcolor-5fr13',
			[
				'label' => __( 'رنگ ایکون اشتراک گذاری', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} .meta-v-sopid-boxre5ty45y45 #shareb i' => 'color: {{VALUE}} !important',
				],
			]
           );
		
		    $this->add_control(
'sepidcolor-5fr14',
			[
				'label' => __( 'رنگ هاور ایکون اشتراک گذاری', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} .meta-v-sopid-boxre5ty45y45 #shareb:hover i' => 'color: {{VALUE}} !important',
				],
			]
           );
		   
	
		   
		   
		   $this->add_control(
'sepidcolor-5fr15',
			[
				'label' => __( 'رنگ ایکون تضمین اصالت', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} .meta-v-sopid-box #tazminesalaat-sin' => 'color: {{VALUE}} !important',
				],
			]
           );
		   
		   
		   
		   
		     $this->add_control(
'sepidcolor-5fr16',
			[
				'label' => __( 'رنگ هاور ایکون تضمین اصالت', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} .meta-v-sopid-box #tazminesalaat-sin:hover' => 'color: {{VALUE}} !important',
				],
			]
           );
		   
		  $this->add_control(
'sepidcolor-4hhhyyyyyyt',
			[
				'label' => __( 'رنگ پس زمینه ویدیو', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} #videob17' => 'background: {{VALUE}} !important',
				],
			]
           );
		   
		   	      $this->add_control(
'sepidcolor-5',
			[
				'label' => __( 'رنگ ایکون ویدیو', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} #videob17' => 'color: {{VALUE}} !important',
				],
			]
           );
		   
		   
		    $this->add_control(
'sepidcolor-57y',
			[
				'label' => __( 'رنگ هاور ویدیو', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} #videob17:hover' => 'background: {{VALUE}} !important',
				],
			]
           );
		   
		      $this->add_control(
'sepidcolor-57y777',
			[
				'label' => __( 'رنگ هاور ایکون ویدیو', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} #videob17:hover' => 'color: {{VALUE}} !important',
				],
			]
           );
		   
	
			  $this->add_control(
'sepidcolor-4fgrr',
			[
				'label' => __( 'رنگ دکمه خروج از اشتراک گذاری', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} #sharem .close1' => 'background: {{VALUE}} !important',
				],
			]
           );
		   
		     $this->add_control(
'sepidcolor-4fgRT',
			[
				'label' => __( 'رنگ ایکون دکمه خروج اشتراک گذاری', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} #sharem .close1' => 'color: {{VALUE}} !important',
				],
			]
           );
		   
		   
		     $this->add_control(
'sepidcolor-4fgRTuy',
			[
				'label' => __( 'رنگ پس زمینه عنوان باکس اشتراک گذاری', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} .chap-12221' => 'background: {{VALUE}} !important',
				],
			]
           );
		   
		    $this->add_control(
'sepidcolor-4fgRTu67y',
			[
				'label' => __( 'رنگ متن عنوان اشکرات گذاری', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} .chap-12221' => 'color: {{VALUE}} !important',
				],
			]
           );
		   
		   
		      $this->add_control(
'sepidcolor-4fgRTrr',
			[
				'label' => __( 'رنگ المان کنار عنوان محصول در اشتراک گذاری', 'plugin-domain' ),
				'type' => Controls_Manager::COLOR,
			
				'selectors' => [
					'{{WRAPPER}} .sgare-sepid-box span::before' => 'background: {{VALUE}} !important',
				],
			]
           );
					 $this->add_responsive_control(
                        'sepidborder-2',
                        [
                            'label' => esc_html__( 'گردی باکس اصلی', 'woolentor' ),
                            'type' => Controls_Manager::DIMENSIONS,
                            'selectors' => [
                                '{{WRAPPER}} .product-meta-sepid.iransingle-product' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px !important;',
                            ],
                        ]
                    );
					
					 $this->add_responsive_control(
                        'sepidborder-3',
                        [
                            'label' => esc_html__( 'گردی دکمه ویدیو', 'woolentor' ),
                            'type' => Controls_Manager::DIMENSIONS,
                            'selectors' => [
                                '{{WRAPPER}} #videob17' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px !important;',
                            ],
                        ]
                    );
					
					 $this->add_responsive_control(
                        'sepidborder-4',
                        [
                            'label' => esc_html__( 'گردی باکس اشتراک گذاری', 'woolentor' ),
                            'type' => Controls_Manager::DIMENSIONS,
                            'selectors' => [
                                '{{WRAPPER}} #sharem .modal-content' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px !important;',
                            ],
                        ]
                    );
					
					
					$this->add_responsive_control(
                        'sepidborder-dergg',
                        [
                            'label' => esc_html__( 'گردی باکس عنوان اشتراک گذاری', 'woolentor' ),
                            'type' => Controls_Manager::DIMENSIONS,
                            'selectors' => [
                                '{{WRAPPER}} .chap-12221' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px !important;',
                            ],
                        ]
                    );
					
					$this->add_responsive_control(
                        'sepidborder-5gh33',
                        [
                            'label' => esc_html__( 'گردی باکس ویدیو', 'woolentor' ),
                            'type' => Controls_Manager::DIMENSIONS,
                            'selectors' => [
                                '{{WRAPPER}} #popup-wrapper17 .modal-content' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px !important;',
                            ],
                        ]
                    );
		$this->end_controls_section();
		
	}
	protected function render() {
		$settings = $this->get_settings_for_display();
defined( 'ABSPATH' ) || exit;
global $product;

  if (!is_product()){
        return;
    }
  $product = wc_get_product();
    $id = $product->get_id();

				?>
<div id="sharem" class="modal1">

  <!-- Modal content -->
  <div class="modal-content">
    <span class="close1">&times;</span>
	<div class="sgare-sepid-box">

	<h4> 	<div class="product-aspk">
	
	 <?php the_post_thumbnail('thumbnail'); ?>
	 
	 
	 </div><div class="chap-12221"><i class=" fi fi-rr-share"></i> اشتراک گذاری </div> <span><?php the_title(); ?></span></h4>
	<div class="share-3">
<a class="twi" target="_blank" href="https://twitter.com/home?status=<?php the_permalink(); ?>"><i class="mdi mdi-twitter"></i></a>
<a class="link" target="_blank" href="https://www.linkedin.com/shareArticle?mini=true&amp;url==<?php the_permalink(); ?>"><i class="mdi mdi-linkedin"></i></a>

<a class="tel" target="_blank" href="https://telegram.me/share/url?url=<?php the_permalink(); ?>"><i class="mdi mdi-telegram"></i></a>
<a class="whstaspp" target="_blank" href="https://api.whatsapp.com/send?text=<?php the_permalink(); ?>"       data-action="share/whatsapp/share"  
        target="_blank"><i class="mdi mdi-whatsapp"></i></a>
<a class="face" target="_blank" href="https://www.facebook.com/sharer/sharer.php?m2w&s=100&p[url]=<?php the_permalink(); ?>"><i class="mdi mdi-facebook"></i></a>



</div>
<script>
function myFunction() {
  /* Get the text field */
  var copyText = document.getElementById("myInput");

  /* Select the text field */
  copyText.select();
  copyText.setSelectionRange(0, 99999); /* For mobile devices */

   /* Copy the text inside the text field */
  navigator.clipboard.writeText(copyText.value);

  /* Alert the copied text */
} 
</script>

<div class="link-kootah">
<button onclick="myFunction()"><i class="fi fi-rr-copy"></i></button>


<input id="myInput" value="<?php bloginfo('url'); ?>/?p=<?php the_ID(); ?>">
</div>
	</div>
</div>

  </div>
  <?php $option_meta = rwmb_meta('videol'); if (!empty($option_meta)) { ?>

<div id="popup-wrapper17" class="modal modalvideo">

  <!-- Modal content -->
  <div class="modal-content">
    <a href="#modal-close" class="modal-close" onClick="PopUp17('hide2')">X</a>   	

<div class="video-sepid-p-single">
<video id="video17" preload="none" controls="" poster="<?php $option_meta = rwmb_meta('videot'); if (!empty($option_meta)) { ?><?php echo $option_meta; ?><?php } ?>">
                        <source src="<?php $option_meta = rwmb_meta('videol'); if (!empty($option_meta)) { ?><?php echo $option_meta; ?><?php } ?>" type="video/mp4">
                    </video>
                    

</div>

  </div>

</div><?php } ?>
<div class="product-meta-sepid iransingle-product">
<div class="meta-v-sopid-boxre5ty45y45">
<?php $option_meta = rwmb_meta('videol'); if (!empty($option_meta)) { ?>

<button id="videob17" onclick="PopUp17()" class="meta-one-sepi-video meta-v-sopid-box">
<div class="tooltip-meta-v-sepid">ویدیو محصول</div>

<i class="fi fi-rr-play"></i>

</button>



<?php } ?>



<script>
    function PopUp17(hideOrshow) {
  if (hideOrshow == 'hide2') {
    document.getElementById('popup-wrapper17').style.display = "none";
    document.getElementById('video17').pause(); // add this
  }
  else {
    document.getElementById('popup-wrapper17').removeAttribute('style');
        document.getElementById('popup-wrapper17').style.display = "block";

  }
}
</script>
<div class="meta-v-sopid-box">
<div class="tooltip-meta-v-sepid">علاقه مندی</div>
<?php echo do_shortcode( '[yith_wcwl_add_to_wishlist product_id=' . get_the_ID() . ']' ); ?>

</div>


<div class="meta-v-sopid-box">
<div class="tooltip-meta-v-sepid">مقایسه محصول</div>

<?php echo do_shortcode( '[woosc id=' . get_the_ID() . ']' ); ?>
</div>

<button id="shareb" class="meta-v-sopid-box sink4324234 <?php $option_meta = rwmb_meta('videol'); if (!empty($option_meta)) { ?>mamolisho
<?php } ?>">
<div class="tooltip-meta-v-sepid">اشتراک گذاری</div>

<i class="fi fi-rr-share"></i>
</button>
<div class="meta-v-sopid-box">

<div id="tazminesalaat-sin" class="meta-v-sopid-box">
<div class="tooltip-meta-v-sepid">تضمین اصالت</div>

<i class="fi fi-rr-shield-check"></i>
</div>
</div>





</div>





<script>
// Get the modal
var modal1 = document.getElementById("sharem");

// Get the button that opens the modal
var btn = document.getElementById("shareb");

// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close1")[0];

// When the user clicks on the button, open the modal
btn.onclick = function() {
  modal1.style.display = "block";
}

// When the user clicks on <span> (x), close the modal
span.onclick = function() {
  modal1.style.display = "none";
}

// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
  if (event.target == modal1) {
    modal1.style.display = "none";
  }
}
</script>

</div>
		<?php


	}


	
	protected function _content_template() {

    }
	
	
}
