<?php
namespace App\Twig\Globals;
class CartHelper {
public function __construct(
\App\Service\CartHelper $cartHelper,
\Symfony\Component\HttpFoundation\RequestStack $requestStack
) {
$this->cartHelper = $cartHelper;
$this->requestStack = $requestStack;
}
public function getSessionCart() {
$session = $this->requestStack->getSession();
return $session->get('minicart', [
"products" => [],
"subtotal" => 0,
"qty" => 0
]);
}
}