Add multistore support to administration and product settings configuration forms#41409
Open
Codencode wants to merge 4 commits into
Open
Add multistore support to administration and product settings configuration forms#41409Codencode wants to merge 4 commits into
Codencode wants to merge 4 commits into
Conversation
Contributor
Author
|
@kpodemski, is this change suitable for 9.1.x, or should I target it to develop? |
7cff7a0 to
0c2d0c4
Compare
Use the boolean value true for the allow_ordering_oos fallback and apply it before saving when stock management is disabled. This prevents the field from being submitted as null and fixes the related boolean type error.
Reuse the parent save flow in ProductPreferencesFormHandler::save() instead of persisting the stock preferences twice. This keeps the save hook dispatch unchanged and avoids an unnecessary second save cycle.
0c2d0c4 to
a94a452
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
- Advanced Parameters > Administration
- Shop Parameters > Product Settings
The implementation follows the same multistore pattern already used in Shop Parameters > Order Settings, including form type integration, multistore configuration keys, route compatibility with PATCH, and frontend initialization for multistore fields.
It also fixes the allow_ordering_oosfallback in
ProductPreferencesFormHandlerby applying it before the save flow and forcing it to the boolean valuetruewhen stock management is disabled. This prevents the disabled field from reaching the configuration layer asnull, fixes the related form option type error, and avoids a duplicate save while keeping the existing save hook dispatch.2. Open
Advanced Parameters > Administrationin a single shop context and update some configuration values.3. Open
Shop Parameters > Product Settingsin a single shop context and update some configuration values.4. Check that multistore checkboxes are available and that the changes are saved only for the selected shop context.
Note: recompilation of the
new-themeadmin theme assets is required.Note:
The switch to
AbstractMultistoreConfigurationalso exposes a legacy compatibility issue in front office boolean checks. Some code paths still assume disabled configuration values are stored as 0, while the multistore configuration flow may persist false asNULL. As a result, comparisons such as0 == Configuration::get('PS_DISP_UNAVAILABLE_ATTR')no longer behave as expected. This currently happens in the product front controller:PrestaShop/controllers/front/ProductController.php
Lines 743 to 749 in cec75f1
Adjusting the controller logic is safer than forcing
0at storage level, sinceNULLstorage matches the default AbstractMultistoreConfiguration behavior. This regression is visible in the failing UI test run: https://github.com/Codencode/ga.tests.ui.pr/actions/runs/25482359105/job/74769371860