Quote Originally Posted by Borek View Post
Hi,

I have just yesterday installed ZC 1.5.8a and GA4.
I have found many DEBUG files in log directory.

All errors are this form:
[29-Mar-2023 16:22:41 UTC] Request URI: /index.php?main_page=product_reviews_write&products_id=11, IP address: 65.108.2.171, Language id CZK
#0 /pub/amforawa/vialux.cz/web/www/includes/classes/observers/class.ga4_analytics.php(79): zen_debug_error_handler()
#1 /pub/amforawa/vialux.cz/web/www/includes/autoload_func.php(47): ga4_analytics->__construct()
#2 /pub/amforawa/vialux.cz/web/www/includes/application_top.php(237): require('...')
#3 /pub/amforawa/vialux.cz/web/www/index.php(25): require('...')
--> PHP Warning: Undefined array key "currency" in /pub/amforawa/vialux.cz/web/www/includes/classes/observers/class.ga4_analytics.php on line 79.

on the row 79 in the ga4_analytics.php is this code:

$this->currency_decimal_places = $currencies->currencies[$_SESSION['currency']]['decimal_places'];

I find this code right, but understand what is wrong.
$_SESSION['currency'] is "CZK" and the decimal_places is ind the DB set to 2.
when I change the row 79 to this, it will works

$this->currency_decimal_places = 2;

so the problem is in the class Currencies, but I don't understav why.

can you help me?
than k you Dalibor
i disagree. i think the problem is with your $_SESSION['currency'] var. the error is saying that array value is not set.

if one looks at when the currencies get set, it is at load point 120.

the ga-4 analytics code gets set at load point 90.

the ga-4 analytics needs to be loaded AFTER the currencies get loaded in order that the currency value of the SESSION array is available.

best.