Add configuration option to exclude disabled parent products and their children #134
+104
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements a new configuration option to prevent importing disabled parent products and their children into Clerk, addressing the issue described in FED-1338.
Problem
Currently, when a product is disabled in Magento 2, it still gets imported into Clerk if:
For example, a disabled configurable product (like product 70051) and its child products would still be imported even though the parent was disabled.
Solution
New Configuration Option
exclude_disabled_productsconfiguration option in the Product Synchronization sectionImplementation Details
status = disabledare filtered out usingaddAttributeToFilterFiles Modified
Model/Config.php- Added new configuration constantetc/adminhtml/system.xml- Added configuration field in admin paneletc/config.xml- Set default value to enabledController/Getconfig/Index.php- Exposed configuration to frontendModel/Adapter/Product.php- Implemented filtering logicTesting
The implementation:
Backward Compatibility
This change is backward compatible:
Fixes FED-1338
💻 View my work • 👤 Initiated by @CasperKN • About Codegen