We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4bb7a21 commit f00fd50Copy full SHA for f00fd50
1 file changed
classes/Hook/HookActionProductCancel.php
@@ -57,6 +57,12 @@ public function run()
57
// Display GA refund product
58
$orderDetail = new OrderDetail($this->params['id_order_detail']);
59
60
+ // Check if the hook provided us with a valid existing ID of order detail.
61
+ // An example are automatic tests, which do not provide it unfortunately.
62
+ if (!Validate::isLoadedObject($orderDetail)) {
63
+ return;
64
+ }
65
+
66
$idProduct = empty($orderDetail->product_attribute_id) ? $orderDetail->product_id : $orderDetail->product_id . '-' . $orderDetail->product_attribute_id;
67
if ((bool) Configuration::get('GA_V4_ENABLED')) {
68
$js = $this->getGoogleAnalytics4(
0 commit comments