<?php
/*
Theme Designed By: Meysam Hosseinkhani
Email: Meysam98@Gmail.com
Author Website: Hosseinkhani.ir
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
global $di_data;
if ( is_active_sidebar( 'shop-sidebar' ) ) : 
$side_sticky = ($di_data['side_sticky'] ? ' sidesticky' : '');
 if(is_singular('product')) {
    $pside = get_post_meta( get_the_ID(), 'dina_pside', true );
   
   if(($pside == 'rside' || $pside == 'lside') && $pside != 'wside') { ?>
      <aside id="mySidebar" class="col-lg-3 sidebar<?php echo $side_sticky; ?>">
      <div class="side-head">
      <a href="javascript:void(0)" class="mclosebtn" aria-label="<?php echo __('Close', 'dina-kala'); ?>" data-title="<?php echo __('Close', 'dina-kala'); ?>" rel="nofollow" onclick="closeSide()">
      <i class="fal fa-times" aria-hidden="true"></i>
      </a>
      </div>
      <?php if($di_data['product_page_side']) {
            dynamic_sidebar('product-sidebar');
      } else {
            dynamic_sidebar('shop-sidebar');
      } ?>
      </aside>
      <div id="myCanvasSide" class="overlay3" onclick="closeSide()"></div>
   <?php 
    
   } elseif($di_data['product_side'] > 0 && $pside != 'wside') { ?>
   <aside id="mySidebar" class="col-lg-3 sidebar<?php echo $side_sticky; ?>">
      <div class="side-head">
      <a href="javascript:void(0)" class="mclosebtn" aria-label="<?php echo __('Close', 'dina-kala'); ?>" data-title="<?php echo __('Close', 'dina-kala'); ?>" rel="nofollow" onclick="closeSide()">
      <i class="fal fa-times" aria-hidden="true"></i>
      </a>
      </div>
      <?php if($di_data['product_page_side']) {
            dynamic_sidebar('product-sidebar');
      } else {
            dynamic_sidebar('shop-sidebar');
      } ?>
   </aside>
   <div id="myCanvasSide" class="overlay3" onclick="closeSide()"></div>
   <?php 
   }
 } else {
     if ($di_data['product_archive_side'] != 0) { ?>
   <aside id="mySidebar" class="col-lg-3 sidebar<?php echo $side_sticky; ?>">
      <div class="side-head">
      <a href="javascript:void(0)" class="mclosebtn" aria-label="<?php echo __('Close', 'dina-kala'); ?>" data-title="<?php echo __('Close', 'dina-kala'); ?>" rel="nofollow" onclick="closeSide()">
      <i class="fal fa-times" aria-hidden="true"></i>
      </a>
      </div>
      <?php dynamic_sidebar('shop-sidebar'); ?>
   </aside>
   <div id="myCanvasSide" class="overlay3" onclick="closeSide()"></div>
<?php
 } } 

 endif; ?>