<div class="isl-promotions isl-promotions-shortcode isl-promotions-products">
  <div class="swiper-viewport">
    <div id="carousel<?php echo $shortcode; ?>" class="swiper-container">
      <div class="swiper-wrapper">
      <?php foreach ($products as $product) { ?>
        <div class="swiper-slide">
          <div class="product-thumb">
            <div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-responsive" /></a></div>
            <div class="caption">
              <h4><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></h4>

              <?php if ($product['rating']) { ?>
                <div class="rating">
                  <?php for ($i = 1; $i <= 5; $i++) { ?>
                    <?php if ($product['rating'] < $i) { ?>
                      <span class="fa fa-stack"><i class="fa fa-star-o fa-stack-2x"></i></span>
                    <?php } else { ?>
                      <span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i><i class="fa fa-star-o fa-stack-2x"></i></span>
                    <?php } ?>
                  <?php } ?>
                </div>
              <?php } ?>

              <?php if ($product['price']) { ?>
                <p class="price">
                  <?php if (!$product['special']) { ?>
                    <?php echo $product['price']; ?>
                  <?php } else { ?>
                    <span class="price-new"><?php echo $product['special']; ?></span> <span class="price-old"><?php echo $product['price']; ?></span>
                  <?php } ?>

                  <?php if ($product['tax']) { ?>
                    <span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
                  <?php } ?>
                </p>
              <?php } ?>
            </div>

            <?php if ($theme == 'journal2'  ) { ?>
              <div class="text-center">
                <button type="button" class="btn btn-default <?php echo $theme == 'journal2' ? 'button' : ''; ?>" data-islpr-add-cart="<?php echo $product['product_id']; ?>"><?php echo $button_cart; ?></button>
              </div>
            <?php } else { ?>
              <div class="button-group">
                <button type="button" data-islpr-add-cart="<?php echo $product['product_id']; ?>"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $button_cart; ?></span></button>
                <button type="button" data-toggle="tooltip" title="<?php echo $button_wishlist; ?>" data-islpr-add-wishlist="<?php echo $product['product_id']; ?>"><i class="fa fa-heart"></i></button>
                <button type="button" data-toggle="tooltip" title="<?php echo $button_compare; ?>" data-islpr-add-compare="<?php echo $product['product_id']; ?>"><i class="fa fa-exchange"></i></button>
              </div>
            <?php } ?>

          </div>
        </div>
      <?php } ?>
      </div>
    </div>

    <?php if ($slide_arrow) { ?>
      <div class="swiper-pager">
        <div class="swiper-button-next"></div>
        <div class="swiper-button-prev"></div>
      </div>
    <?php } ?>
  </div>

<script>
$('#carousel<?php echo $shortcode; ?>').swiper({
  mode: 'horizontal',
  autoplay: 2500,
  slidesPerView: 5,
  slidesPerColumn: <?php echo $slide_column; ?>,
  slidesPerGroup: 2,
  spaceBetween: 20,
  breakpoints: {
    992: { // window width is <= 992px
      slidesPerView: 2,
      slidesPerColumn: 2,
      spaceBetween: 10
    },
    768: { // window width is <= 768px
      slidesPerView: 1,
      slidesPerColumn: 3,
      spaceBetween: 10
    },
  },
  nextButton: '.swiper-button-next',
  prevButton: '.swiper-button-prev',
});
</script>
</div>
