|
5 | 5 | use GoogleTagManager\Service\GoogleTagService;
|
6 | 6 | use Thelia\Controller\Front\BaseFrontController;
|
7 | 7 | use Thelia\Core\HttpFoundation\JsonResponse;
|
| 8 | +use Thelia\Core\HttpFoundation\Session\Session; |
8 | 9 | use Thelia\Model\Base\RewritingUrlQuery;
|
9 | 10 | use Thelia\Model\Currency;
|
10 | 11 | use Thelia\Model\Lang;
|
@@ -33,13 +34,14 @@ public function getProductDataWithUrl()
|
33 | 34 | ->filterByUrl(substr($productUrl['path'], 1))
|
34 | 35 | ->findOne();
|
35 | 36 |
|
| 37 | + /** @var Session $session */ |
36 | 38 | $session = $request->getSession();
|
37 | 39 |
|
38 | 40 | /** @var Lang $lang */
|
39 | 41 | $lang = $session->get('thelia.current.lang');
|
40 | 42 |
|
41 | 43 | /** @var Currency $currency */
|
42 |
| - $currency = $session->get('thelia.current.currency'); |
| 44 | + $currency = $session->getCurrency(); |
43 | 45 |
|
44 | 46 |
|
45 | 47 | if (null !== $rewriteUrl) {
|
@@ -70,13 +72,14 @@ public function getCartItem()
|
70 | 72 | $pse = ProductSaleElementsQuery::create()->findPk($pseId);
|
71 | 73 | $product = $pse->getProduct();
|
72 | 74 |
|
| 75 | + /** @var Session $session */ |
73 | 76 | $session = $request->getSession();
|
74 | 77 |
|
75 | 78 | /** @var Lang $lang */
|
76 | 79 | $lang = $session->get('thelia.current.lang');
|
77 | 80 |
|
78 | 81 | /** @var Currency $currency */
|
79 |
| - $currency = $session->get('thelia.current.currency'); |
| 82 | + $currency = $session->getCurrency(); |
80 | 83 |
|
81 | 84 | $result = $googleTagService->getProductItem($product, $lang, $currency, $pse, $quantity);
|
82 | 85 |
|
|
0 commit comments