fix(ga4): stabilize checkout funnel events

This commit is contained in:
2026-05-11 15:54:42 +02:00
parent 80a3cb3814
commit a9fce98b01
8 changed files with 597 additions and 106 deletions

View File

@@ -230,7 +230,7 @@ class PdGoogleAnalytycs4ProAjaxModuleFrontController extends ModuleFrontControll
$cp['content_ids'] = $module->getProductIdStringByType($cp);
$cp['content_coupon'] = ($cart_rules & is_array($cart_rules)) ? $cart_rules['name'].' - '.$cart_rules['code'] : '';
$cp['content_coupon'] = (is_array($cart_rules) && sizeof($cart_rules)) ? $cart_rules['name'].' - '.$cart_rules['code'] : '';
$discount = 0;
$discount = $cp['price_without_reduction'] - $cp['price_wt'];
if ($discount_cart > 0) {
@@ -261,7 +261,7 @@ class PdGoogleAnalytycs4ProAjaxModuleFrontController extends ModuleFrontControll
$carrier_name = '';
if ($id_carrier = Tools::getValue('id_carrier')) {
$carriers = $module->getCarriersArray();
$carrier_name = $carriers[$id_carrier];
$carrier_name = isset($carriers[$id_carrier]) ? $carriers[$id_carrier] : '';
}
$this->context->smarty->assign(array(
@@ -302,7 +302,7 @@ class PdGoogleAnalytycs4ProAjaxModuleFrontController extends ModuleFrontControll
$cp['content_category4'] = isset($content_category[3]) ? addslashes($content_category[3]) : '';
$cp['content_category5'] = isset($content_category[4]) ? addslashes($content_category[4]) : '';
$cp['content_ids'] = $module->getProductIdStringByType($cp);
$cp['content_coupon'] = ($cart_rules & is_array($cart_rules)) ? $cart_rules['name'].' - '.$cart_rules['code'] : '';
$cp['content_coupon'] = (is_array($cart_rules) && sizeof($cart_rules)) ? $cart_rules['name'].' - '.$cart_rules['code'] : '';
$discount = 0;
$discount = $cp['price_without_reduction'] - $cp['price_wt'];
if ($discount_cart > 0) {