I've discovered that this module doesn't work when EC Analytics is installed (https://www.zen-cart.com/downloads.php?do=file&id=1997)
I am just presented with the regular multiple page checkout.
Is this something you're aware of, and is there a solution other than switching to a different analytics module?
No debug logs, or console logs.
EC Analytics is as per zc download apart from the following change after adding an admin configuration page for setting the GA number and a switch to enable/disable the module.
In includes/templates/YOUR_TEMPLATE/jscript/jscript_ec_analytics.php i replaced
if ((!defined('GOOGLE_UA') || GOOGLE_UA === "UA-XXXXXXXX-X")) {
echo '<script>alert("The Google Analytics trackingID is not yet defined in\n /includes/extra_datafiles/ec_analytics.php")</script>' ;
} else { $trackingID = GOOGLE_UA ; }
?>
with
if (GOOGLE_ANALYTICS_ENABLE == 'true'){
if ((!defined('GOOGLE_UA') || GOOGLE_UA === "UA-XXXXXXXX-X")) {
echo '<script>alert("The Google Analytics trackingID is not yet defined in Admin > Configuration > EC Analytics Configuration")</script>' ;
} else { $trackingID = GOOGLE_UA ; }
?>
so that the warning message wasn't displayed if the module wasn't active.
Site is ZC 1.5.7, latest version of OPC, and last available update of EC Analytics apart from the edit mentioned above.
I did some digging around here and it seems to be related to 'NOTIFY_HEADER_START_CHECKOUT_SHIPPING', on line 26 of includes/classes/observers/class.ec_analytics.php, meaning that commenting out that line allows OPC to load correctly upon checkout. Obviously this is going to have some negative impact on the functionality of EC Analytics though.
I assume it's somehow messing with whatever part of your code calls checkout_one rather than checkout_shipping
Does that help at all?
Last edited by strelitzia; 26 Jul 2020 at 12:59 AM.
I just looked at the auto_loaders file for both OPC and ECA
ECA is using $autoLoadConfig[90] whereas OPC is mainly using $autoLoadConfig[200]
I took a wild guess that perhaps ECA being loaded earlier than OPC was causing an issue so as a test I changed ECA to $autoLoadConfig[200] as well.
The issue went away, but not sure of the ramifications of changing the loading order like this.
Is it likely to cause issues for ECA, or should I perhaps change OPC to load earlier?
What do you advise Cindy?
You didn't indicate in your original posting, @strelitzia, but are you, by chance running zc157?
If that's the case, there's a bug in the zc157 core, identified by @mc12345678 (https://github.com/zencart/zencart/pull/3654), that prevents multiple observers from watching the same event.
Bookmarks