<div class="full-carousel">
  <?php
  $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'large', false);
  $attachment_ids = $product->get_gallery_image_ids();
  if($attachment_ids):
   ?>
  <div class="owl-carousel owl-theme full-items-slide">
     <?php
      if($image != false):
       $post_image = $image[0];
       ?>
       <div>
          <span class="full-image-show">
            <a class="glightbox" href="<?php echo $post_image; ?>">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M16 16h-8v-8h8v8zm-10-7.172v-2.828h2.828l-3.414-3.414 2.586-2.586h-8v8l2.586-2.586 3.414 3.414zm2.828 9.172h-2.828v-2.828l-3.414 3.414-2.586-2.586v8h8l-2.586-2.586 3.414-3.414zm9.172-2.828v2.828h-2.828l3.414 3.414-2.586 2.586h8v-8l-2.586 2.586-3.414-3.414zm-2-15.172l2.586 2.586-3.414 3.414h2.828v2.828l3.414-3.414 2.586 2.586v-8h-8z"/></svg>								</a>
          </span>
           <img src="<?php echo $post_image; ?>" alt="<?php the_title(); ?>">
       </div>
    <?php endif; ?>
    <?php
    $counter = 1;
    foreach ( $attachment_ids as $attachment_id ) {
      $counter++;
      $src = wp_get_attachment_image_src($attachment_id , 'large', false);
        ?>
        <div>
          <span class="full-image-show">
            <a class="glightbox" href="<?php echo $src[0]; ?>">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M16 16h-8v-8h8v8zm-10-7.172v-2.828h2.828l-3.414-3.414 2.586-2.586h-8v8l2.586-2.586 3.414 3.414zm2.828 9.172h-2.828v-2.828l-3.414 3.414-2.586-2.586v8h8l-2.586-2.586 3.414-3.414zm9.172-2.828v2.828h-2.828l3.414 3.414-2.586 2.586h8v-8l-2.586 2.586-3.414-3.414zm-2-15.172l2.586 2.586-3.414 3.414h2.828v2.828l3.414-3.414 2.586 2.586v-8h-8z"/></svg>								</a>
          </span>
          <img src="<?php echo $src[0]; ?>" alt="<?php the_title(); ?>">
        </div>
    <?php  } ?>
  </div>
  <script>
  jQuery(document).ready(function($) {
  const lightbox = GLightbox({
    touchNavigation: true,
    loop: true,
    autoplayVideos: true
  });
  var $owl = $('.full-items-slide');
  $owl.children().each( function( index ) {
  $(this).attr( 'data-position', index );
  });
  $owl.owlCarousel({
  rtl: true,
  dots: false,
  nav: true,
  center: true,
  loop: true,
  items: 3,
  navText: ["<i class='fa fa-chevron-left'></i>","<i class='fa fa-chevron-right'></i>"],
  responsive: {
      768: {
          items: 3
      },
      0 : {
          items: 1,
          margin: 5,
      }
  }
  });
  $(document).on('click', '.owl-item>div', function() {
  var $speed = 300;  // in ms
  $owl.trigger('to.owl.carousel', [$(this).data( 'position' ), $speed] );
  const lightbox = GLightbox({
      touchNavigation: true,
      loop: true,
  });
  });

  });
  </script>
<?php
else:
  if($image == false):
  if (get_theme_mod( 'charsoogh_ad_no_image' )) : $post_image = get_theme_mod( 'charsoogh_ad_no_image'); else: $post_image = get_template_directory_uri().'/assets/img/no_image_available.jpg'; endif;
  else:
  $post_image = $image[0];
  endif;
   ?>
  <img src="<?php echo $post_image; ?>" class="no_image_available" alt="<?php the_title(); ?>">
    <?php endif; ?>
</div>
