Skip to content

Latest commit

 

History

History
67 lines (48 loc) · 4.22 KB

File metadata and controls

67 lines (48 loc) · 4.22 KB

Changelog

All notable changes to this module will be documented in this file.

The format is based on "Keep a Changelog" and this project adheres to Semantic Versioning.

[Unreleased]

Added

  • Documentation: README.md and basic usage examples for cron execution.
  • Basic compatibility notes for PrestaShop 1.7+, with reference to testing on PS 8 and 9.

Changed

  • Internal improvements for more robust secure-key handling and configuration exposure in the Back Office.

Fixed

  • Minor wording and metadata corrections.

[1.0.2] - 2026-01-27

Added

  • Persistent secure key support: the module now saves a deterministic TECDEFAULTCOMBINATION_SECURE_KEY in Configuration at install time (and exposes it in the Back Office) so administrators can set/change the cron token from the module UI.
  • Debug switch in Back Office to enable/disable cron logging.
  • Front controller cron now supports dry_run, batch_size and start parameters for safer, paginated runs.
  • Robust logging helper: cron writes to modules/tecdefaultcombination/logs/cron.log when debug is enabled; the logger trims the file keeping only the last 100 lines to avoid unbounded growth.

Changed

  • Cron validation now prefers the explicit TECDEFAULTCOMBINATION_SECURE_KEY from Configuration; if not present it falls back to the module's computeModuleSecureKey() or a deterministic md5-based fallback. The controller validates the full key (not a prefix).
  • The module attempts to obtain the concrete module instance via Module::getInstanceByName() in the controller to safely call module-specific methods (computeModuleSecureKey, runCron).
  • The admin UI uses a boolean switch for debug instead of a select for clearer UX.
  • The cron URL displayed in Back Office now uses the full secure key.
  • Replaced deprecated use of Tools::encrypt() with a computeModuleSecureKey() function compatible with PrestaShop 1.7 → 9.

Fixed

  • The algorithm that chooses the cheapest combination was improved: computeDefaultCombinationId() now uses Product::getPriceStatic() where available to compute the effective price for each combination (includes combination impact and specific prices), with a safe fallback.
  • Avoid writing to undefined Product properties and calling save() when not necessary: the module updates database fields (cache_default_attribute, product_attribute.default_on, product_attribute_shop.default_on) directly to remain compatible across PS versions and avoid static-analysis warnings.
  • Various robustness fixes for context/link checks and fallbacks in environments where certain helpers may not be available.

Security

  • Cron endpoint validates the full secure key and returns clear JSON error codes (403 on invalid key). Keep the TECDEFAULTCOMBINATION_SECURE_KEY secret and always call the cron over HTTPS.

[1.0.1] - 2026-01-27

Added

  • Initial public release on GitHub.
  • Core functionality to detect product combinations and set the default combination to the lowest effective price.
  • Front controller cron endpoint that can be invoked via a secure key: /module/tecdefaultcombination/cron?secure_key=YOUR_SECURE_KEY.
  • Batch processing support to limit products processed per run (to avoid long locks/timeouts on large catalogs).
  • Basic README.md and CHANGELOG.md files.

Changed

  • Use deterministic secure key computation compatible with different PrestaShop versions.
  • Improved logging for cron runs and safer handling of edge cases when products have no combinations.

Fixed

  • Addressed a number of small bugs discovered during initial integration testing.

[1.0.0] - 2026-01-20

Added

  • Module scaffold and core algorithm to compute the effective price for each product combination (base price + impact) and mark the cheapest as default.
  • Implementation avoids adding extra database tables and operates using PrestaShop core objects and APIs.
  • Basic admin configuration screen to set secure_key, batch size and run a manual job.

If you need a more detailed per-commit changelog or release notes (for publishing on the module page or GitHub Releases), tell me which release version(s) you want expanded and I will generate a detailed list of changes suitable for the Releases section on GitHub.