{*
 **********************************************************
 * Developed by: Team Theme Metro
 * Website: http://www.thememetro.com
 **********************************************************
*}

{assign var="item" value=$sidebar}

{if $templatefile eq "clientareaproducts" && count($item) > "1"}
	<div id="promotions-slider-sidebar" class="swiper-container">
		<div class="swiper-wrapper my-3">
			{foreach $sidebar as $item}
				{if $item->hasBodyHtml() or $setting == "product-list"}
					<div class="swiper-slide">
						<div menuItemName="{$item->getName()}" class="panel bg-checkered panel-sidebar {if $item->getClass()}{$item->getClass()}{else}panel-sidebar{/if}"{if $item->getAttribute('id')} id="{$item->getAttribute('id')}"{/if} style="box-shadow: none;">
							<div class="panel-body">
								{$item->getBodyHtml()}
							</div>
						</div>
					</div>
				{/if}
			{/foreach}
		</div>
		
		{if count($item) > 2}
		<div class="swiper-pagination"></div>
		{/if}
	</div>

	<script>
		jQuery(document).ready(function () {
			var swiper = new Swiper('#promotions-slider-sidebar', {
			  slidesPerView: 1,
			  spaceBetween: 0,
			  autoHeight: true, //enable auto height
			  autoplay: {
				delay: 2500,
				disableOnInteraction: false,
			  },
			  pagination: {
				el: '.swiper-pagination',
				clickable: true,
			  }
			  
			});
		});
	</script>
{/if}

  