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.
- Documentation:
README.mdand basic usage examples for cron execution. - Basic compatibility notes for PrestaShop 1.7+, with reference to testing on PS 8 and 9.
- Internal improvements for more robust secure-key handling and configuration exposure in the Back Office.
- Minor wording and metadata corrections.
- Persistent secure key support: the module now saves a deterministic
TECDEFAULTCOMBINATION_SECURE_KEYin 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
cronnow supportsdry_run,batch_sizeandstartparameters for safer, paginated runs. - Robust logging helper: cron writes to
modules/tecdefaultcombination/logs/cron.logwhen debug is enabled; the logger trims the file keeping only the last 100 lines to avoid unbounded growth.
- Cron validation now prefers the explicit
TECDEFAULTCOMBINATION_SECURE_KEYfrom Configuration; if not present it falls back to the module'scomputeModuleSecureKey()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 acomputeModuleSecureKey()function compatible with PrestaShop 1.7 → 9.
- The algorithm that chooses the cheapest combination was improved:
computeDefaultCombinationId()now usesProduct::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
Productproperties and callingsave()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.
- Cron endpoint validates the full secure key and returns clear JSON error codes (403 on invalid key). Keep the
TECDEFAULTCOMBINATION_SECURE_KEYsecret and always call the cron over HTTPS.
- Initial public release on GitHub.
- Core functionality to detect product combinations and set the default combination to the lowest effective price.
- Front controller
cronendpoint 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.mdandCHANGELOG.mdfiles.
- 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.
- Addressed a number of small bugs discovered during initial integration testing.
- 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.