New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Product combination price edit : Use blur instead of onkeyup to avoid price flip #25749
Product combination price edit : Use blur instead of onkeyup to avoid price flip #25749
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sowbiba
Seems good to me, I would just like to have the approval from @PierreRambaud since he worked on the number formatted part
I approve but I don't know if this trigger is still needed: |
$(document).on('blur', '.combination-form .attribute_priceTI', function() { ==> TI edit
this is weird to me, we assume to (maybe) override the value edited |
@@ -1991,7 +1976,7 @@ var priceCalculation = (function() { | |||
var impactPriceTI = this.getImpactTIInputValue(obj); | |||
var impactPriceTE = this.computePriceTaxExcluded(impactPriceTI); | |||
|
|||
this.updateImpactTEInput(impactPriceTE, obj); | |||
this.getImpactTEInput(obj).val(impactPriceTE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful, you are changing the behaviour here, as the removed updateImpactTEInput
function used to update both fields tax excluded and included (and recompute tax included at the same time)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole behaviour is quite touchy and prone to many errors To avoid any risk I would have kept the update*
methods, and you can simply remove the change
trigger code I guess
Also you need to be careful because not only the combination form is updated, the combination list also needs to be updated and it's not handled in this file. The list update is handled here
updateFinalPrice($(input.parents('tr')[0])); |
It relies on the change
event so it might break this feature, if you only wanted to remove the change
trigger for "clean code" the DON'T 😅. Because this whole code is a mess and a slight change can break many unexpected things
As long as your bug is fixed you should try to minimize the modifications as much as possible. This code is bound to be removed once the product page is redone in v8 anyway, so now is not the time to do overkill changes unless you plan on releasing a 1.7.9 next week.. ^^
86cac09
to
66332b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sowbiba
3295b5d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @atomiix for fixing my mistakes ^^
I checked with @Robin-Fischer-PS About the rounding price, we have old issues: But before PS1.7.7.5, we need to refresh the page to show the error and now the rounding bug is displayed when we click outside because of And about the ecotax issue, we have old issues So it seems that the ecotax is not working since before. Thanks! |
This change is