Skip to content

Commit 2ff7ae8

Browse files
committed
Fix purchase datalayer
1 parent 6393d54 commit 2ff7ae8

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

Config/module.xml

+7-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@
1313
<language>en_US</language>
1414
<language>fr_FR</language>
1515
</languages>
16-
<version>3.1.1</version>
16+
<version>3.1.2</version>
1717
<authors>
1818
<author>
19-
<name>Tom Pradat</name>
20-
<email>tpradat@openstudio.fr</email>
19+
<name>Bertrand Tourlonias</name>
20+
<email>btourlonias@openstudio.fr</email>
21+
</author>
22+
<author>
23+
<name>Nicolas Barbey</name>
24+
<email>nbarbey@openstudio.fr</email>
2125
</author>
2226
</authors>
2327
<type>classic</type>

Hook/FrontHook.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ public function onMainHeadTop(HookRenderEvent $event)
8484
]));
8585
}
8686

87-
if ($view === 'order-placed') {
87+
if ($view === 'order-placed' && $orderId = $request->get('order_id')) {
8888
$event->add($this->render('datalayer/thelia-page-view.html', [
89-
'data' => $this->googleTagService->getPurchaseData($session->get('order_id'))
89+
'data' => $this->googleTagService->getPurchaseData($orderId)
9090
]));
9191
}
9292

Service/GoogleTagService.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public function getCheckOutData(int $cartId, $addressCountry): string
243243
]);
244244
}
245245

246-
public function getPurchaseData($orderId)
246+
public function getPurchaseData(int $orderId)
247247
{
248248
$order = OrderQuery::create()->findPk($orderId);
249249

0 commit comments

Comments
 (0)