[Bugfix] #7333 Unable to set negative custom option fixed price in admin view.#15267
[Bugfix] #7333 Unable to set negative custom option fixed price in admin view.#15267magento-engcom-team merged 10 commits intomagento:2.3-developfrom dverkade:2.3-Fix-7333-negative-value-for-custom-option
Conversation
|
Tests are failing, any chance you can review them? |
|
Will work on this at the MM18NL contribution day. |
…ice in admin view. - Fixed unit tests - Fixed integration tests - Changed defaultvalidator to have the locale format interface. Because a value entered in the backoffice of Magento is passed as the value like "40,000.00", which needs to be converted to a float in order to do a valid check on it.
|
All tests are now green. Please proceed with processing this PR. |
| * @param string $value | ||
| * @return bool | ||
| */ | ||
| protected function isNumber($value) |
There was a problem hiding this comment.
So @dverkade looking over this pr again I think we should be making this method public. We are trying to stay away from protected and since these classes are built with inheritance in mind I would suggest that having this method public would allow for a user to create a new validator and change the isNumber functionality.
There was a problem hiding this comment.
Hi @dmanners, thanks for reviewing this. I have changed the function to public.
- Changed validator method to public
|
Changes have been made, this PR can be processed / reviewed again. |
|
Thanks for those changes @dverkade there are two failures with the api tests but I will investigate these for you and then process this pr. |
|
Will do @ihor-sviziev thanks for the note. |
|
Hi @dverkade just to keep you updated I am checking with the core team to understand the reasoning for making negative prices not allowed a bit better, just to make sure that we do not miss something important out. After I have more information I will update you via this PR. Thanks for your patience. |
|
Hi @dverkade sorry for the delay. Would you be able to look into the test |
|
Hi @dverkade any update here? |
…m-option # Conflicts: # app/code/Magento/Catalog/Model/Product/Option/Validator/DefaultValidator.php # app/code/Magento/Catalog/Model/Product/Option/Validator/Select.php # app/code/Magento/Catalog/Test/Unit/Model/Product/Option/Validator/DefaultValidatorTest.php # app/code/Magento/Catalog/Test/Unit/Model/Product/Option/Validator/FileTest.php # app/code/Magento/Catalog/Test/Unit/Model/Product/Option/Validator/SelectTest.php # app/code/Magento/Catalog/Test/Unit/Model/Product/Option/Validator/TextTest.php
|
Hi @dmanners, Thanks for your patience. This has been resolved by merging the 2.3 develop branch into this PR. Merge conflicts have been resolved. You can proceed with checking this PR. |
|
Thanks @dverkade got one more failure coming through. Could you take a look at this for me. |
|
Hi @dmanners, I have taken a look at this test and fixed the issue. The API functional test should now pass as well. |
|
Hi @dverkade , please, resolve merge conflict. |
…7333-negative-value-for-custom-option # Conflicts: # app/code/Magento/Catalog/Model/Product/Option/Validator/DefaultValidator.php
|
Hi @sidolov, thank you for the review. |
|
Hi @dverkade, thank you for your contribution! |
|
Hi @dverkade. Thank you for your contribution. |
…d price in admin view. #15267
Fixes the ability to set a negative custom option price in the backend.
Description
In Magento 1 it was possible to set a negative price change to a custom option. This PR fixes issue #7333 and makes it possible to set a negative price in the backend of Magento. This PR fixes the backend so that the negative price change can actually be entered in the Magento admin. There is a separate PR for the frontend changes which is PR #14975
There also seem to be two other PR's for this issue which are stale and are not moving along:
#13393
#14342
Fixed Issues
Manual testing scenarios