<?php
	//[fbbttm-cart]
if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}
	function fbbttm_cart($atts, $content=NULL){

		global $fbbttm_helperobj,$fbbttm_cartobj,$cartsummary,$fbbttm_fullcartinfo;

		$return = $cartcontent = $cartsummary ='';

		$fbbttm_fullcartinfo = $fbbttm_cartobj->fbbttm_get_basic_cartinfo();

		if(!empty($fbbttm_fullcartinfo)){

		$cartsummary = $fbbttm_cartobj->fbbttm_get_cart_summaryata($fbbttm_fullcartinfo);


		 if( file_exists(FBBTTM_DIR . 'templates/cart.php') ){	
				$cartpath = FBBTTM_DIR . 'templates/cart.php';
				$cartcontent  =  $fbbttm_helperobj->fbbttm_get_filecontent( $cartpath);
			}


            if( file_exists(FBBTTM_DIR . 'templates/cartsummary.php') ){	
				$cartsummarypath = FBBTTM_DIR . 'templates/cartsummary.php';
				$cartsummary  =  $fbbttm_helperobj->fbbttm_get_filecontent( $cartsummarypath);
			}

			
			$return .='<div class="fbbttm-cartpage row">
    		<div class="col-md-12">
        	<div class="col-md-8">';

			$return .= $cartcontent;

			$return .='</div>';

		  	$return .='<div class="col-md-4" >';

		  	$return .= $cartsummary;

		  	$return .='</div>';	

		  }
		  else
		  {

		  	$return .='<div class="fbbttm-cart">'.esc_html__('Your cart is currently empty','foodboxbooker').'</div>';

		  }
			
			
		add_filter('body_class', 'fbbttm_body_class');

		return $return;

	}

	add_shortcode( 'fbbttm-cart', 'fbbttm_cart' );
?>