4.4.0
Overview
This version focuses primarily on issues relating to stock changes and entity discovery in sync, as well as providing additional diagnostic information and improvements to extensibility.
Indexing Improvements
Changes In Stock Status Cause Products To Be Queued For Sync
Issues relating to stock status changes not being reflected in entity discovery - for example, where a product changed to or from being in stock - which may previously have required a Klevu entity update or discovery operation have been addressed.
Note: there remain some scenarios which will still do not cause a product to be queued for sync, primarily revolving around configurable products using Multi Source Inventory, where the last variant moves out of stock; or edge cases where variants exist in a different website to the parent. Additional improvements will be rolled out in future versions of the 4.4.x branch
Deferred Entity Updates
To address difficulties determining stock and status changes during database transactions, and to better support customisations to stock status logic, some discovery operations are now deferred.
This means that the indexing records will be marked as "requiring update", with the applicable status flag stored for reference.
A cron job has been added to process records requiring update, setting the Next Action if applicable. Job code: klevu_indexing_process_require_update_entities; Default schedule */15 * * * * (though this can be modified via the bin/magento config:set klevu:indexing:process_require_update_entities_cron_expr [CRON_EXPR] CLI command)
Improved Multi Source Inventory Support
A new module has been included to provide improved compatibility with Magento MSI. Package name: klevu/module-m2-indexing-msi; this module is required by klevu/module-indexing-products, though is designed to be replaceable via composer if MSI has been removed from your installation.
This module also adds a new setting to Stores > Configuration > Klevu > Developer Settings > Indexing - Products > Append Reservations Action, which allows you to determine how we respond to reservations - for example, when a sale is made through the storefront.

Available Options
- Calculate Requires Update : Will mark the sold item(s) as requiring update and determine whether to sync via Deferred Entity Updates (see above). This is the default.
- Mark All For Update : Will indiscriminately mark all items as requiring a sync, regardless of whether the change has changed the product's stock status
- No Action : Will not respond to reservations, requiring additional update or discovery operations to queue items. This is the pre-4.4.0 behaviour
Note: if you are experiencing high traffic through the checkout, Calculate Requires Update is the most processing-intensive and may cause slowdown; Mark All For Update is quicker, bu will cause additional load on the Klevu sync process; No Action has negligible impact on checkout speed but may lead to inaccurate data in Klevu's indexes.
Improved Extensibility for Stock and Status Determination
The logic to determine whether a product is out of stock, or disabled, has been moved to two independent services, which can be plugged into; preferenced; or replaced using standard Magento development practices
Reference
Product Status | ||
|---|---|---|
Stock Status |
Additionally, the native Stock Status provider now supports multiple calculation methods, configurable via Stores > Configuration > Klevu > Developer Settings >Indexing - Products > Stock Status Calculation Method

Available Options:
- Stock Item : This is the default setting to provide backwards compatibility. There are known issues relating to reservations and indexing, and this setting is no longer recommended
- Stock Registry : Utilises the Magento stock registry, which MSI plugs into. This is recommended setting if you encounter issues with products' stock status
- Is Available : References the product entity's is_available data property
- Is Salable : References the product entity's is_salable data property
Consolidation of Stock Status In Discovery and Payload Generation
Prior to 4.4.0, the stock status value used for entity discovery and the value included in the sync payload may have differed due to independent calculations. It is now possible to use the provider (above)'s logic to generate the sync payload value.
To support backward compatibility, this is disabled by default and must be turned on via Stores > Configuration > Klevu > Developer Settings > Indexing - Products > Use Provider for Stock Status Value

NOTE: Once enabled (and the Magento config cache flushed), you will need to regenerate the indexing pipeline overrides to ensure the changes are applied
bin/magento klevu:indexing:configuration-overrides-regenerate --entity-type KLEVU_PRODUCTDiagnostics Improvements
Metapackage and Library Versions in Stores > Configuration
The overal metapackage version (eg 4.4.0) and the standalone Klevu library (SDK and Pipeline) versions are now available in Stores > Configuration > Klevu > Information > Module Versions

Cron Execution Information in Stores > Configuration
Schedule and execution information for all Klevu cron jobs can now be found under Stores > Configuration > Klevu > Information > Cron Information

Live Product Sync Information Shown In Products Grid
In addition to the existing sync entity information found in the backend products grid under Action > Klevu Sync Info, a new section has been added to display live calculated data for the record for all integrated keys - regardless whether an indexing entity is present - and all store views using that key (if multiple stores share a key).

Information Includes
- Is Discovered : Whether an indexing entity exist for this product-parent product-api key combination
- Is Indexable : While the Next Sync Actions shows the is_indexable value for the sync record, this will show the real time calculated value
- Assigned to Website : Whether the product is assigned to the parent website for the store code in this row
- Product Status : whether the product is enabled as determined by the Status Provider (see above)
- Stock Status : whether the product is in stock as determined by the Stock Status Provider (see above)
- is_salable : the realtime value of $product->isSalable()
- is_available : the realtime value of $product->isAvailable()
Live Product Sync Information Available via CLI
A new terminal command has been added to provide a holistic overview of an individual product (including where it exists as a variant) across all integrated websites.
This information can be viewed by running the following command via the console
bin/magento klevu:indexing:sync-information --entity-type KLEVU_PRODUCT --target-entity-id [MAGENTO_PRODUCT_ID]
The output contains the same information as the products grid (above) as well as
- Relevant global configuration settings
- Information about deferred processing (see above) via the Requires Update and Orig Values lines
Minor Bugfixes and Technical Improvements
This release also contains a number of minor bug fixes and technical improvements. See changelog below for more details.
Changelog
- [FEATURE] Output Klevu cron execution information in Stores > Configuration
- [FEATURE] Add CLI Command to show indexing entity sync information
- [IMPROVEMENT] Implement deferred stock status processing for indexing
- [IMPROVEMENT] Add Stores > Configuration setting to determine indexing action following product sale
- [IMPROVEMENT] Add Stores > Configuration setting to allow matching stock status logic for discovery and sync payload generation
- [IMPROVEMENT] Add Stores > Configuration setting to define method used to determine stock status for entity discovery
- [IMPROVEMENT] Show metapackage and SDK package versions in Stores > Configuration
- [IMPROVEMENT] Output additional indexing entity sync information in backend Products grid modal
- [IMPROVEMENT] Hide Sync Info link in backend Products grid where no Klevu API key is integrated
- [IMPROVEMENT] Improve stock status support for stores utilising MultiSource Inventory
- [BUGFIX] Cascade variant and child stock changes to parent product (Configurable; Grouped; and Bundle)
- [BUGFIX] Resolve products not being marked for sync on stock status change *
- [BUGFIX] Resolve parent stock status not correctly considered for variant stock status in some scenarios during discovery and payload generation
- [BUGFIX] Resolve missing data in DiscoveryOrchestrator result objects
- [TECHNICAL] Add events to indexing record provider to support customisation
- [TECHNICAL] Extract Product status determination to standalone service to support customisation
- [TECHNICAL] Extract Product stock status determination to standalone service to support customisation
- [TECHNICAL] Implement cache clean support on StoresProvider
- [TECHNICAL] Expand Indexing Entity properties to include created and update dates
- [TECHNICAL] Add batch size validation to SetIndexingEntities... actions
- [TECHNICAL] Add provider for consolidation product parent IDs
- [TECHNICAL] Add missing dependencies
- [CHORE] Miscellaneous refactoring and clean-up