<?php
namespace FoodAirwaySiteBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Session;
class ProductController extends BaseController
{
public function listingAction(Request $request)
{
$dataService = $this->get('FoodAirwayApiBundle\Services\DataService');
$cartService = $this->get('FoodAirwaySiteBundle\Services\CartService');
$orderService = $this->get('FoodAirwayApiBundle\Services\OrderService');
$products = $dataService->productListingByCategoriesWithTimings();
$foodTypes = $dataService->fetchFoodTypes();
$cart = $cartService->getSessionCart();
$isDeliveryingNow = $orderService->isDeliveryingNow();
$response =
$this->render('@FoodAirwaySite/Product/listing.html.twig',
array('products'=>$products, 'cart'=>$cart, 'active'=>'product','foodTypes'=>$foodTypes, 'isDeliveryingNow'=>$isDeliveryingNow)
);
return $this->etagResponse($response, $request);
}
public function offerAction()
{
return $this->render('@FoodAirwaySite/Product/offers.html.twig');
}
}