<?php if (get_theme_mod( 'charsoogh_category_button_style') != 'defualt') : ?>
  <div class="modal left fade" id="charsoogh_category_show" tabindex="-1" role="dialog" aria-labelledby="charsoogh_category_show">
    <div class="modal-dialog modal-sm" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title"><?php _e('Categories' , 'charsoogh'); ?></h5>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body">
          <ul class="vertical-menu">
            <?php
            $args = array(
              'taxonomy'     => 'product_cat',
              'hide_empty'   => 0,
              'orderby'      => 'term_group',
              'pad_counts'   => false,
              'hierarchical' => true,
              'title_li'     => '',
              'walker'=> new My_Walker_Category
            );
            ?>
            <?php wp_list_categories($args); ?>
          </ul>
      </nav>
      </div>
        </div>
      </div>
    </div>
<?php endif; ?>
<?php if(isset($_GET['adid'])){$is_edit_ad = true;}else{$is_edit_ad = false;} ?>
<?php if (get_theme_mod( 'charsoogh_submit_ad_style' , 'advanced') == 'advanced' && !$is_edit_ad ) :
  if(!function_exists('wp_ajax_adlist')):?>
  <div class="modal full fade" id="charsoogh_submit_ad_show" tabindex="-1" role="dialog" aria-labelledby="charsoogh_submit_ad_show">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header d-none">
          <h5 class="modal-title"><?php if (get_theme_mod( 'charsoogh_submit_btn_title' )) : echo get_theme_mod( 'charsoogh_submit_btn_title'); else: echo __('Free ad Submission' , 'charsoogh'); endif; ?></h5>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body modal-submit-new-show d-flex align-items-center justify-content-center flex-column">
          <h2 class="close-modal display-2"><a class="text-decoration-none" href="#0" data-dismiss="modal">&times;</a></h2>
          <div class="ad-loading"><div class="ad-loader-show"></div></div>
          <section class="submit-ad-modal"><?php echo do_shortcode('[newad]'); ?></section>
        </div>
      </div>
    </div>
  </div>
<?php else: ?>
  <script>
  jQuery(document).ready(function($) {
    jQuery('#charsoogh_submit_ad_show').remove();
    jQuery(document).on('click', '.submit_ad', function(e){
      e.preventDefault();
      e.stopPropagation();
      jQuery("html, body").animate({ scrollTop: "200px" });
    });
  });
  </script>
<?php endif; ?>
<?php endif; ?>
