<?php 
if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}

global $fbbttm_fullcartinfo,$fbbttm_helperobj;

 for($i=0;$i<count($fbbttm_fullcartinfo);$i++){

		$foodid =  $fbbttm_fullcartinfo[$i]->fbbttm_fd_id;
		$featuredimage = get_the_post_thumbnail($foodid , 'full' );
		if($featuredimage=='')
		{
			$featuredimage = "<img src='".FBBTTM_URL."/assets/images/noimge.jpg'>";
		}
		
		$title = get_the_title($foodid);
		
		$post_meta = get_post_meta($foodid); 
  		$itemdetails =  (!empty($post_meta['fbbttmdetails'][0]))? $post_meta['fbbttmdetails'][0] : '';

		$specialprice = $fbbttm_fullcartinfo[$i]->fbbttm_special_price;
		$fprice = $fbbttm_fullcartinfo[$i]->fbbttm_fitem_price;
		$package_price = $fbbttm_fullcartinfo[$i]->fbbttm_package_price;
		
		$package_pricesy = $fbbttm_helperobj->fbbttm_get_price_with_currency($package_price);
		$specialpricesym = $fbbttm_helperobj->fbbttm_get_price_with_currency($specialprice);
		$fpricesym =  $fbbttm_helperobj->fbbttm_get_price_with_currency($fprice);
		
		?>
		<div class="col-md-12 fbbttm-cart-productbox">

			<div class="col-md-6 fbbttm-product-mainbox">
				<div class="fbbttm-product-info">		
				  <?php 
					    echo wp_kses(
					    $featuredimage,
					    array( 'img'     => array(
					        	'class'  => array(),
					        	'id'  => array(),
					        	'src'  => array(),
					        	'title'  => array(),
					        	'height'  => array(),
					        	'width'  => array(),
					       	 ),
					    	)
						);
					    ?>
				</div>			
			</div>
			<div class="col-md-6 fbbttm-product-price">
						<div class="packageinfo">
  					<div class="packname">
  						<?php if(!empty($title)){?>
						<div class="fbbttm-ptitle"><h2><?php echo esc_html($title);?></h2></div>
						<?php }?>
						<?php if(!empty($fbbttm_fullcartinfo[$i]->fbbttm_pack_name)){?>
						<div class="fbbttm-item">
							<div class="fbbttm-item-title"><?php echo esc_html__('Package Name','foodboxbooker');?>:</div>
							<div class="fbbttm-item-info"><?php echo esc_html($fbbttm_fullcartinfo[$i]->fbbttm_pack_name);?></div>
						</div>
						<?php }?>
						<?php if(!empty($fbbttm_fullcartinfo[$i]->fbbttm_food_startdate)){?>
						<div class="fbbttm-item">
							<div class="fbbttm-item-title"><?php echo esc_html__('Package Start Date','foodboxbooker');?>:</div>
							<div class="fbbttm-item-info"><?php echo esc_html($fbbttm_fullcartinfo[$i]->fbbttm_food_startdate);?></div>
						</div>
						<?php }?>
						<?php if(!empty($fbbttm_fullcartinfo[$i]->fbbttm_food_enddate)){?>
						<div class="fbbttm-item">
							<div class="fbbttm-item-title"><?php echo esc_html__('Package End Date','foodboxbooker');?>:</div>
							<div class="fbbttm-item-info"><?php echo esc_html($fbbttm_fullcartinfo[$i]->fbbttm_food_enddate);?></div>
						</div>
						<?php }?>
						<?php if(!empty($fbbttm_fullcartinfo[$i]->fbbttm_booking_deliveryday)){?>
						<div class="fbbttm-item">
							<div class="fbbttm-item-title"><?php echo esc_html__('Delivery Day','foodboxbooker');?>:</div>
							<div class="fbbttm-item-info"><?php echo esc_html($fbbttm_fullcartinfo[$i]->fbbttm_booking_deliveryday);?></div>
						</div>
						<?php }?>
						<?php if(!empty($fbbttm_fullcartinfo[$i]->fbbttm_food_time)){?>
						<div class="fbbttm-item">
							<div class="fbbttm-item-title"><?php echo esc_html__('Delivery Time','foodboxbooker');?>:</div>
							<div class="fbbttm-item-info"><?php echo esc_html($fbbttm_fullcartinfo[$i]->fbbttm_food_time);?></div>
						</div>
						<?php }?>
						<?php if(!empty($fbbttm_fullcartinfo[$i]->fbbttm_package_description)){?>
						<div class="fbbttm-item">
							<div class="fbbttm-item-title"><?php echo esc_html__('Package info','foodboxbooker');?>:</div>
							<div class="fbbttm-item-info"><?php echo esc_html($fbbttm_fullcartinfo[$i]->fbbttm_package_description);?></div>
						</div>
						<?php }?>
					</div>
					<div class="packday"> 
							<div class="fbbttm-title"><?php echo esc_html__('Quantity','foodboxbooker');?>:</div>
							<div class="fbbttm-day"><?php echo esc_html($fbbttm_fullcartinfo[$i]->fbbttm_package_day);?></div>
							<div class="fbbttm-action">
								<button class="removeitem" data-id="<?php echo esc_html($fbbttm_fullcartinfo[$i]->fbbttm_fbcartitem_id);?>"><?php echo esc_html__('Remove' ,'foodboxbooker');?></button>
								<div class="fbbttm-loader hide"></div> 
							</div>
					</div>
				</div>
			</div>
			<div class="row  fbbttm-item-footer">
				<div class="col-md-12">
						<div class="fbbttm-iprice"><?php echo esc_html__('Item Price','foodboxbooker');?>:<?php if($specialprice > 0){ echo esc_html($specialpricesym); } else { echo esc_html($fpricesym); } ?></div>

						<div class="fbbttm-pprice"><?php echo esc_html__('Sub Total','foodboxbooker');?>:<?php echo esc_html($package_pricesy); ?></div>
				</div> 
			</div> 
		 </div> 
    <?php }?>