

<?php $__env->startSection('title'); ?>
	<?php echo e(title_case($page_product)); ?>

<?php $__env->stopSection(); ?>

<?php 
	$share_url = Request::url();
	if(!empty($meta_tags)){
		foreach ($meta_tags as $key => $value) {
			$meta[$value->name] = $value->content;
		}
		$share_title = isset($meta['title']) ? $meta['title'] : '';
		$share_desc = isset($meta['description']) ? $meta['description'] : '';
	}else{
		$share_title = title_case($page_product)." | ".$masterName;
		$share_desc = title_case($page_product).' '.$masterName;
	}
	$share_img = asset($storage_url.'img/'.$masterLogo);
 ?>

<?php $__env->startSection('sharing-meta'); ?>

<meta property="og:url" content="<?php echo e($share_url); ?>" />
<meta property="og:type" content="place" />
<meta property="og:title" content="<?php echo e($share_title); ?>" />
<meta property="og:description" content="<?php echo e($share_desc); ?>" />
<meta property="og:image" content="<?php echo e($share_img); ?>" />


<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="<?php echo e($share_url); ?>">
<meta name="twitter:title" content="<?php echo e($share_title); ?>">
<meta name="twitter:description" content="<?php echo e($share_desc); ?>">
<meta name="twitter:image:src" content="<?php echo e($share_img); ?>">


<meta itemprop="name" content="<?php echo e($share_title); ?>">
<meta itemprop="description" content="<?php echo e($share_desc); ?>">
<meta itemprop="image" content="<?php echo e($share_img); ?>">

<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
  <main id="mainContent product-category" class="container-fluid">
		<?php if(count($categories) == 0): ?>
			<section class="empty-product">
				<div>
					<h1 class="text-center"><i class="fa fa-shopping-bag" aria-hidden="true"></i></h1>
				</div>
			</section>
		<?php endif; ?>

		
    <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <section class="row category-wrapper">

			
      <div class="col-xs-12 col-sm-6 category-box category-name <?php echo e(($loop->index % 2 != 0) ? 'category-right' : 'category-left'); ?>">
        <img alt="" src="<?php echo e(asset($storage_url.'img/products/category/'.$category->category_image1)); ?>"/>
        <header class="<?php echo e(($loop->index % 2 != 0) ? 'text-right' : 'text-left'); ?>">
          <a href="<?php echo e(route('category', [
          		'id' => $category->id,
          		'category' => str_slug($category->category_name)
          		])); ?>">
            <h2><?php echo e(isset($category->category_name) ? $category->category_name : ''); ?></h2>
            
          </a>
        </header>
      </div>
			

			
      <div class="col-xs-12 col-sm-6 category-box">
        <div class="row product-list">
					<div>

						
						<?php if(count($category->products)): ?>
							<?php $__currentLoopData = $category->products()->latest()->take(2)->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

								
								<article class="col-xs-12 col-sm-6 <?php echo e(($loop->index % 2 != 0)?'hidden-xs':''); ?>">
		              <div class="card">

		                
		                <figure class="card-img">
		                  <img alt=""
		                  	src="<?php echo e(asset($storage_url.'img/products/'.$product->product_code.'/'.$product->product_image)); ?>"/>
		                </figure>
		                

		                
		                <div class="text-center card-content">
		                  <header class="card-header">

						            <h2><?php echo e(isset($product->product_name) ? $product->product_name : ''); ?></h2>

												<p class="product-price"><?php 
                
                if($masterCurrency === 'USD' ){
                  echo ($masterCurrency.' '.number_format($product->product_price,2,'.',','));
                }elseif($masterCurrency === 'EUR' ){
                  echo ($masterCurrency.' '.number_format($product->product_price,2,',','.'));
                }else{
                  echo ($masterCurrency.' '.number_format($product->product_price,0,',','.'));
                } 
              
              ?></p>
		                  </header>
											<div class="card-footer">
												<?php 
													$categorySlug = str_slug($category->category_name);
													$name = str_slug( $product->product_name ? $product->product_name : 'no name' );
												 ?>
												<a href="<?php echo e(route('productDetail',['category'=>$categorySlug,'id'=>$product->product_code,'slug'=>$name])); ?>" class="btn btn-default"><?php echo app('translator')->getFromJson('frontend.detail'); ?></a>
											</div>
		                </div>
										

		              </div>
		            </article>
		            

							<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
						<?php endif; ?>
						

            <aside class="col-xs-12 text-center">
							<br>
							<a href="<?php echo e(route('category',['id'=>$category->id,'category'=>str_slug($category->category_name)])); ?>" class="btn btn-default fs-shadow"><?php echo app('translator')->getFromJson('frontend.see_all_product'); ?></a>
						</aside>


					</div>
        </div>
      </div>
			

    </section>
		<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  </main>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
	<script>
		function resize_card(){
			var $highest = 0;
			$(".product-list .card").each(function(){
				var $h = $($(this)).height();
				if($h > $highest){
					$highest = $h;
				}
			});

			$(".product-list .card").each(function(){
				$($(this)).css("height",$highest+"px");
			});
		};

		$(document).ready(function(){
			resize_card();
		});

		$(window).resize(function(){
			resize_card();
		});
	</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>