Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impact de Matomo sur le calcul du la somme totale du panier #1234

Open
ble6575 opened this issue Dec 22, 2024 · 12 comments · May be fixed by #1239
Open

impact de Matomo sur le calcul du la somme totale du panier #1234

ble6575 opened this issue Dec 22, 2024 · 12 comments · May be fixed by #1239

Comments

@ble6575
Copy link

ble6575 commented Dec 22, 2024

Config: Woocommerce et avec un panier personnaliser par shopengine.
problème:
Si une livraison gratuite est configurer à un seuil (par exemple 30€) et le panier contient au moins deux produits
lorsque de la variation de la quantité de deux produits en même temps la vérification du total panier est supérieur ou non au seuil fixé devient aléatoire (sur wordpress, packlink pro et boxtal)

source du problème:
lors de la mise à jour du panier (après changement des quantité), le plugin Matomo impact la valeur du panier et la passe à 0 ensuite vers la bonne valeur.
==> problème résolu avec la désactivation de Matomo

@diosmosis
Copy link
Member

@ble6575 Thanks for the bug report, I'll see if I can get a fix in for it in the next release.

@diosmosis
Copy link
Member

@ble6575
Copy link
Author

ble6575 commented Jan 4, 2025

			  # Matomo
  • Version de l’extension Matomo: 5.1.7
  • Config existe et est accessible en écriture.: Oui ("$abs_path/wp-content/uploads/matomo/config/config.ini.php" )
  • JS Tracker existe et est accessible en écriture.: Oui ("$abs_path/wp-content/uploads/matomo/matomo.js" )
  • Répertoires de l’extension: Yes ([{"pluginsPathAbsolute":"$abs_path/wp-content/plugins/matomo/plugins","webrootDirRelativeToMatomo":"../plugins"}])
  • Répertoire temporaire accessible en écriture: Yes ($abs_path/wp-content/cache/matomo)
  • Version de Matomo: 5.1.2
  • idSite du site web Matomo: 1
  • Version installée de Matomo: 5.1.7 (Install date: 2025-01-04 23:48:21)
  • Upgrades outstanding: No
  • Upgrade in progress: No

Endpoints

  • Matomo JavaScript Tracker URL: ($site_url/wp-content/uploads/matomo/matomo.js)
  • Matomo JavaScript Tracker - WP Rest API: ($site_url/wp-json/matomo/v1/hit/)
  • Matomo HTTP Tracking API: ($site_url/wp-content/plugins/matomo/app/matomo.php)
  • Matomo HTTP Tracking API - WP Rest API: ($site_url/wp-json/matomo/v1/hit/)

Crons

  • Heure du serveur: 2025-01-04 23:05:12
  • Heure du site web: 2025-01-05 00:05:12 (Les dates ci-dessous sont affichées dans le fuseau horaire du site web)
  • Sync users & sites: Next run: 2025-01-05 23:48:21 (23 heures 43 min) ( Last started: 2025-01-04 23:48:24 (-16 min 48s). Last ended: 2025-01-04 23:48:24 (-16 min 48s). Interval: daily)
  • Archive: Next run: 2025-01-05 00:48:21 (43 min 9s) ( Last started: 2025-01-04 23:48:24 (-16 min 48s). Last ended: 2025-01-04 23:48:25 (-16 min 47s). Interval: hourly)
  • Update GeoIP DB: Next run: 2025-02-03 23:48:21 (29 jours 23 heures) ( Last started: 2025-01-04 23:48:25 (-16 min 47s). Last ended: 2025-01-04 23:48:26 (-16 min 46s). Interval: matomo_monthly)

Contrôles obligatoires

  • Version PHP >= 7.2.5: ok
  • PDO extension: ok
  • PDO\MYSQL extension: ok
  • MYSQLI extension: ok
  • Autres extensions requises: ok
  • Fonctions requises: ok
  • Configuration PHP requise (php.ini): ok
  • Répertoires avec les droits d'accès en écriture: ok
  • Répertoires avec accès en écriture pour Gestionnaire de balises: ok

Contrôles facultatifs

  • Binaire PHP 64 bits: ok
  • État du traqueur: ok
  • Limite mémoire: ok
  • Fuseau horaire: ok
  • Ouvrir l'URL: ok
  • GD > 2.x + FreeType (graphics): ok
  • Autres extensions: ok
  • Warning Autres fonctions: warning (shell_exec Il est recommandé d'activer cette fonction intégrée à PHP. Lisez ceci pour en savoir plus. set_time_limit mail parse_ini_file glob gzopen md5_file )
  • Système de fichiers: ok
  • Dernière exécution d'archivage réussie: ok
  • Capacités de la base de données: ok
  • Taille maximale des paquets: ok
  • Géolocalisation: ok
  • Mettre à jour via HTTPS: ok
  • Mobile Messaging SMS Provider: ok
  • Prise en charge de l’archivage asynchrone: No
  • Async Archiving Disabled in Setting: No
  • Location provider ID: geoip2php
  • Location provider available: Yes
  • Location provider working: Yes
  • Warning Proxy header: HTTP_X_REAL_IP (Un en-tête de proxy est défini, ce qui signifie que vous devrez peut-être configurer un en-tête de proxy dans les réglages avancés pour que les rapports de localisation fonctionnent. Si la localisation est détecté correctement dans vos rapports, vous pouvez ignorer cet avertissement. En savoir plus)
  • Warning Proxy header: HTTP_X_FORWARDED_FOR (Un en-tête de proxy est défini, ce qui signifie que vous devrez peut-être configurer un en-tête de proxy dans les réglages avancés pour que les rapports de localisation fonctionnent. Si la localisation est détecté correctement dans vos rapports, vous pouvez ignorer cet avertissement. En savoir plus)
  • Had visit in last 5 days: Yes
  • Matomo URL: Yes ($site_url/wp-content/plugins/matomo/app/)

Matomo Settings

  • Track mode: default
  • Track ecommerce: Yes
  • Track codeposition: footer
  • Track api endpoint: default
  • Track js endpoint: default
  • Version history: 5.1.7
  • Core version: 5.1.2
  • Last tracking settings update: 1736030945
  • Last settings update: 1736030945

Logs

  • Aucun:

WordPress

  • Home URL: $site_url
  • Site URL: $site_url
  • WordPress Version: 6.7.1
  • Number of blogs: 1
  • Multisite Enabled: No
  • Network Enabled: No
  • WP_DEBUG: No
  • WP_DEBUG_DISPLAY: Yes
  • WP_DEBUG_LOG: No
  • DISABLE_WP_CRON: -
  • FORCE_SSL_ADMIN: No
  • WP_CACHE: Yes
  • CONCATENATE_SCRIPTS: -
  • COMPRESS_SCRIPTS: -
  • COMPRESS_CSS: -
  • ENFORCE_GZIP: -
  • WP_LOCAL_DEV: -
  • WP_CONTENT_URL: $site_url/wp-content
  • WP_CONTENT_DIR: $abs_path/wp-content
  • UPLOADS: -
  • BLOGUPLOADDIR: -
  • DIEONDBERROR: -
  • WPLANG: -
  • ALTERNATE_WP_CRON: -
  • WP_CRON_LOCK_TIMEOUT: 60
  • WP_DISABLE_FATAL_ERROR_HANDLER: -
  • MATOMO_SUPPORT_ASYNC_ARCHIVING: -
  • MATOMO_ENABLE_TAG_MANAGER: -
  • MATOMO_SUPPRESS_DB_ERRORS: -
  • MATOMO_ENABLE_AUTO_UPGRADE: -
  • MATOMO_DEBUG: -
  • MATOMO_SAFE_MODE: -
  • MATOMO_GLOBAL_UPLOAD_DIR: -
  • MATOMO_LOGIN_REDIRECT: -
  • Permalink Structure: /%postname%/
  • Possibly uses symlink: No
  • Upload base url: $site_url/wp-content/uploads
  • Upload base dir: $abs_path/wp-content/uploads
  • Upload url: $site_url/wp-content/uploads/2025/01
  • Custom upload_path:
  • Custom upload_url_path:
  • Compatible content directory: Yes
  • WP_Filesystem Initialized: Yes

WordPress Plugins

  • Advanced Shipment Tracking for WooCommerce: 3.7.3
  • Advanced Woo Labels: 2.09
  • Blackhole for Bad Bots: 3.7.3
  • Boxtal Connect: 1.3.3
  • Code Snippets: 3.6.6.1
  • Contact Form 7: 6.0.2
  • CookieYes | GDPR Cookie Consent: 3.2.8
  • Custom Fonts: 2.1.7
  • Custom Order Status Manager for WooCommerce: 1.1.5
  • Elementor: 3.26.3
  • Essential Addons for Elementor: 6.1.0
  • Google for WooCommerce: 2.9.4
  • hCaptcha for WP: 4.9.0
  • Headers Security Advanced & HSTS WP: 5.0.41
  • Hostinger AI: 2.0.26
  • Hostinger Tools: 3.0.21
  • Jetpack: 14.1
  • Jetpack Boost: 3.6.1
  • Jetpack Protect: 3.1.1
  • LightStart - Maintenance Mode, Coming Soon and Landing Page Builder: 2.6.15
  • Limit Login Attempts Reloaded: 2.26.16
  • Loco Translate: 2.6.14
  • Matomo Analytics - Ethical Stats. Powerful Insights.: 5.1.7
  • NextMove Lite - Thank You Page for WooCommerce: 2.19.0
  • Ocean Extra: 2.4.3
  • Packlink PRO Shipping: 3.4.13
  • Password Strength Settings for WooCommerce: 3.0.1
  • Payment Plugins for Stripe WooCommerce: 3.3.80
  • PDF Invoices & Packing Slips for WooCommerce: 3.9.4
  • PixelYourSite: 10.0.3.1
  • Really Simple Security: 9.1.4 (Réseau activé)
  • Security.txt Manager: 1.0.2
  • ShopEngine: 4.7.3
  • Side Cart WooCommerce: 2.5.7
  • Site Kit by Google: 1.142.0
  • Ultimate Addons for Elementor Lite: 2.0.6
  • Variation Swatches for WooCommerce: 2.1.3
  • WooCommerce: 9.5.1
  • WooCommerce.com Update Manager: 1.0.3
  • WooCommerce Advanced Free Shipping: 1.1.7
  • WPC Grouped Product for WooCommerce: 5.1.3
  • WP Consent API: 1.0.8
  • WPC Product Bundles for WooCommerce: 8.1.6
  • WP Crontrol: 1.17.1
  • WP Fastest Cache: 1.3.3
  • WPForms Lite: 1.9.2.3
  • WP Headers And Footers: 3.1.0
  • WP Mail SMTP: 4.3.0
  • WP Rollback: 2.0.7
  • WPS Hide Login: 1.9.17.1
  • WPVulnerability: 4.0.3
  • Yoast SEO: 24.1
  • Active Plugins: 51 (advanced-woo-labels:2.09 blackhole-bad-bots:3.7.3 boxtal-connect:1.3.3 bp-custom-order-status-for-woocommerce:1.1.5 code-snippets:3.6.6.1 contact-form-7:6.0.2 cookie-law-info:3.2.8 custom-fonts:2.1.7 elementor:3.26.3 essential-addons-for-elementor-lite:6.1.0 google-listings-and-ads:2.9.4 hcaptcha-for-forms-and-more:4.9.0 header-footer-elementor:2.0.6 headers-security-advanced-hsts-wp:5.0.41 hostinger-ai-assistant:2.0.26 hostinger:3.0.21 jetpack-boost:3.6.1 jetpack-protect:3.1.1 jetpack:14.1 limit-login-attempts-reloaded:2.26.16 loco-translate:2.6.14 matomo:5.1.7 ocean-extra:2.4.3 packlink-pro-shipping:3.4.13 pixelyoursite:10.0.3.1 really-simple-ssl:9.1.4 security-txt-manager:1.0.2 shopengine:4.7.3 side-cart-woocommerce:2.5.7 wc-password-strength-settings:3.0.1 woo-advanced-shipment-tracking:3.7.3 woo-product-bundle:8.1.6 woo-stripe-payment:3.3.80 woo-thank-you-page-nextmove-lite:2.19.0 woo-update-manager:1.0.3 woo-variation-swatches:2.1.3 woocommerce-advanced-free-shipping:1.1.7 woocommerce-pdf-invoices-packing-slips:3.9.4 woocommerce:9.5.1 wordpress-seo:24.1 wp-consent-api:1.0.8 wp-crontrol:1.17.1 wp-fastest-cache:1.3.3 wp-headers-and-footers:3.1.0 wp-mail-smtp:4.3.0 wp-maintenance-mode:2.6.15 wp-rollback:2.0.7 wpc-grouped-product:5.1.3 wpforms-lite:1.9.2.3 wps-hide-login:1.9.17.1 wpvulnerability:4.0.3)
  • Theme: oceanwp (oceanwp)

Server

  • Server Info: LiteSpeed
  • PHP OS: Linux
  • PHP Version: 8.3.2
  • PHP SAPI: litespeed
  • PHP Binary Name: /opt/alt/php83/usr/bin/lsphp
  • Extension PHP Maxmind DB: Non chargé
  • PHP Error Reporting: 4437 After bootstrap: 4437
  • Timezone: UTC
  • WP timezone: Europe/Paris
  • Locale: fr_FR
  • User Locale: fr_FR
  • Memory Limit: 512M (Au moins 128MB recommandé. En fonction de votre trafic, 256MB ou plus peuvent être nécessaires.)
  • WP Memory Limit: 40M
  • WP Max Memory Limit: 512M
  • Timezone version: 2023.4
  • Time: 1736031913
  • Max Execution Time: 180
  • Max Post Size: 256M
  • Max Upload Size: 268435456
  • Max Input Vars: 5000
  • Disabled PHP functions: Yes (system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail)
  • zlib.output_compression is off: Yes
  • Curl Version: 7.87.0, OpenSSL/1.1.1w
  • Suhosin installed: No

Database

  • MySQL Version: 10.11.10
  • Mysqli Connect: Yes
  • Force MySQL over Mysqli: No
  • DB Prefix: wp_
  • DB CHARSET: utf8
  • DB COLLATE:
  • SHOW ERRORS: No
  • SUPPRESS ERRORS: No
  • Uses Socket: No
  • Uses IPv6: No
  • Matomo tables found: 39
  • DB tables exist: Yes
  • Matomo users found: 1
  • Matomo sites found: 1
  • Permissions obligatoires: OK

Browser

  • Browser: (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36)
  • Language: fr-fr,fr,ar-tn,ar,en-us,en

@diosmosis
Copy link
Member

Hi @ble6575, would you be able to comment out this line: https://github.com/matomo-org/matomo-for-wordpress/blob/develop/classes/WpMatomo/Ecommerce/Woocommerce.php#L139 and see if that resolves the problem for you? (Note: I can provide a modified file if you'd rather just replace the entire file instead of editing the plugin directly.)

Note: there is nothing in Matomo for WordPress' WooCommerce code that explicitly modifies the cart, so I'm assuming this behavior is triggered indirectly and unintentionally.

@ble6575
Copy link
Author

ble6575 commented Jan 5, 2025

Hi Diosmosis,
thank you for your feedback,
By commenting out the line the problem is resolved.

Thank you for your support

@diosmosis
Copy link
Member

@ble6575 That's good to hear. Can you also check that the calculated order totals that appear in Matomo are still correct?

@ble6575
Copy link
Author

ble6575 commented Jan 6, 2025

Hello Diosmosis,
it's showing the good value of total but it showing it as $US instead of €

@diosmosis
Copy link
Member

@ble6575 thanks for the confirmation. To change the currency displayed, you'll want to change the "Currency" setting in Matomo Analytics > Settings > Tracking > General Tracking Settings.

I'll be able to include a fix for this in the next release.

@ble6575
Copy link
Author

ble6575 commented Jan 6, 2025

I have remarked new issue, when i add products and i go to cart matomo follow the correct value, but if i change the number of product and i update the cart matomo doesn't follow the new total amount

@diosmosis
Copy link
Member

@ble6575 can you replace the /path/to/wordpress/wp-content/plugins/matomo/classes/WpMatomo/Ecommerce/Woocommerce.php file with this one: https://github.com/matomo-org/matomo-for-wordpress/blob/3a85d539ef9ad3df9b8911f4748a8bc98467c3be/classes/WpMatomo/Ecommerce/Woocommerce.php and see if that fixes the new issue?

If it doesn't then this issue will be harder to fix than I originally thought.

@ble6575
Copy link
Author

ble6575 commented Jan 7, 2025

Hello Diosmosis,
With this update matomo doesn't shown anymore the amount of the cart and new issue happen, this update is impacting the process to add products in the cart (it take long time to add product).

I have another question but this one is related to the configuration, now I have the following of visited pages in the same line but the cart is shown in another line (example in the following link
matomo) how I can have the follwing in the same line ?

@diosmosis
Copy link
Member

I'll answer your question first.

I have another question but this one is related to the configuration, now I have the following of visited pages in the same line but the cart is shown in another line (example in the following link) how I can have the follwing in the same line ?

This happens when the visitor ID cookie isn't being sent to Matomo for WordPress. Normally it shouldn't happen with the default settings. The only thing that might cause it is activating the "Disable cookies" tracking setting. If you haven't activated this, then it may be something else in your WordPress install.

If you are able to share the URL to your website I can look into this further. Note: if you don't want to share it publicly, you can email dizzy (at) innocraft (dot) com.

With this update matomo doesn't shown anymore the amount of the cart and new issue happen, this update is impacting the process to add products in the cart (it take long time to add product).

That's very strange. All the change does is avoid calculating cart totals in Matomo for WordPress if they were already calculated. The slowness must be due to something else.

As for what else is happening, I think I'm not sure exactly what's happening on your WordPress. Lets restore the old code and deal with the original problem. Can you:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
  • Then trigger the original problem you were experiencing.
  • Then post or email the /path/to/wordpress/wp-content/debug.log file that will appear.
  • And finally, disable debug logging by removing the code added to wp-config.php, or changing define('WP_DEBUG', true); to define('WP_DEBUG', false);

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants