PrestaShop Google Shopping Module: PHP 8 Compatibility & Integration Challenges

Navigating Google Shopping Integration for PrestaShop: A Free Module's PHP 8 Compatibility Challenge

For PrestaShop store owners, leveraging Google Shopping is a powerful strategy to enhance product visibility and drive targeted traffic. The ability to seamlessly integrate products with Google Merchant Center is a key requirement for modern e-commerce success.

The Promise of Automated Google Shopping Sync

A recent PrestaShop forum thread introduced a free Google Shopping module by Knowband Plugins. This module aimed to automate the complex process of syncing product catalogs, promising to generate feeds directly from the PrestaShop back office and keep them updated with changes in products, prices, and stock. The goal was to simplify product listing, expand market reach through multi-country/language feeds, and ensure feed quality by excluding out-of-stock or non-compliant products.

Key features included:

  • User-friendly syncing with Google's technical requirements.
  • Support for multiple feeds across different countries, languages, and currencies.
  • Automatic exclusion of out-of-stock products, items below a set minimum price, and those lacking unique identifiers (EAN13/JAN or UPC).

The module was available for download on GitHub, with an upgrade option on the PrestaShop Addons marketplace.

Unveiling PHP 8 Compatibility Hurdles

Despite its promising features, the module quickly faced critical technical scrutiny. A user, Eolia, reported extensive PHP 8 compatibility issues, primarily "Deprecated" notices. These errors signal that the module's codebase, particularly its integration with the Google API client library, does not fully align with PHP 8's stricter type declarations and syntax. For PrestaShop users on modern hosting environments, such issues can lead to module malfunction, administrative panel errors, and even site instability.

The reported problems included:

  • Numerous "Deprecated" notices concerning return type compatibility for core Google API client classes (e.g., Google\Model, Google\Collection), indicating outdated method signatures.
  • "Deprecated: Optional parameter declared before required parameter" warnings in module-specific files (e.g., GSSingleAction.php, GSBase.php), pointing to incorrect function parameter ordering.
  • "Deprecated: Creation of dynamic property" in controller files, highlighting practices that are no longer supported in modern PHP.
  • A critical "Warning: Cannot modify header information - headers already sent" error, a common symptom of output (like deprecation notices) being sent before HTTP headers, which can disrupt page rendering and functionality.
  • A JavaScript error (Uncaught ReferenceError: velovalidation is not defined), suggesting potential front-end script loading or dependency conflicts.

Below is an excerpt of the reported PHP errors:


Deprecated: Return type of Google\Model::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #\[ReturnTypeWillChange\] attribute should be used to temporarily suppress the notice in /var/www/clients/client5/web33/web/modules/kbgoogleshopping/vendor/lib/google_client/google/apiclient/src/Model.php on line 278
Deprecated: Return type of Google\Collection::current() should either be compatible with Iterator::current(): mixed, or the #\[ReturnTypeWillChange\] attribute should be used to temporarily suppress the notice in /var/www/clients/client5/web33/web/modules/kbgoogleshopping/vendor/lib/google_client/google/apiclient/src/Collection.php on line 22
Deprecated: Optional parameter $id_product_attribute declared before required parameter $listing is implicitly treated as a required parameter in /var/www/clients/client5/web33/web/modules/kbgoogleshopping/vendor/GSSingleAction.php on line 254
Warning: Cannot modify header information - headers already sent by (output started at /var/www/clients/client5/web33/web/modules/kbgoogleshopping/vendor/GSSingleAction.php:254) in /var/www/clients/client5/web33/web/classes/controller/AdminController.php on line 2523
JS error: Uncaught ReferenceError: velovalidation is not defined dans le fichier: https://test.shopping.com/admin/index.php?c à la ligne 968

Community Takeaway and Developer Considerations

This forum discussion serves as a crucial alert for the PrestaShop community. For merchants, it highlights the absolute necessity of verifying module compatibility with their specific PrestaShop and PHP versions before installation. Running incompatible modules, especially with PHP 8, can lead to critical errors and affect store operations.

For module developers, this underscores the importance of rigorous testing across PHP versions and maintaining up-to-date third-party dependencies. Addressing deprecation notices and adhering to modern PHP standards are vital for module stability and user trust. The cascade of errors, from PHP deprecations to header warnings and JavaScript issues, demonstrates how core code problems can manifest in widespread application failures.

Migrate My Shop advises developers to prioritize resolving such compatibility issues and encourages merchants to seek expert assistance or updated module versions when encountering similar challenges to ensure a smooth and functional PrestaShop experience.

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools