-
Notifications
You must be signed in to change notification settings - Fork 2
Product measurements not saving correctly #702
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
Comments
All the measurements are required as if you decided to implement a realtime provider then dimensions would be required for it to do it's calculations. As such, if your product has a weight, I'd assume it also has dimensions so in which case it just seems best practice to fill them all in? I'll review our end whether we can implement a check, but the workaround seems to be to just fill them in. I'm tempted to make this a feature request rather than a bug though as the intension is that they are all required, so the only thing that could be considered a bug is that we don't validate them as required 🤔 |
Thanks for the reply Matt, Making the fields required could be a fix, unfortunately our users don't exactly always follow the best practices, and sometimes the only important info is the weight. We think making the fields required leads to users entering gibberish to just create new products. We expected that even when you enter a 0 instead of nothing (null) for the other dimensions the data should be saved correctly to the database and the correct calculations should still be made. In this case {"length":0,"width":0,"height":0,"weight":50} should be saved instead of just {"weight": 50} |
Sure. We probably do it to reduce data storage but yea, maybe we should handle it a little better. Let me add it to our backlog to take a look. |
Ok, so I've pushed a 15.3.4--preview.6 build to our nightly feed, if you want to give that a try to see if it works in your situation. I've updated it such that measurements are now copied to the orderline if ANY of the measurements have a value. If one of the measurements doesn't have a value, it's set to I've also updated the realtime shipping provider to fail if there are any packages that don't have all dimensions filled in so that prevents sending API requests if an item fails to have dimensions filled in. If you have an order with orderlines already set, you'll need to remove them and re-add them for the measurements to get copied over. |
That sounds great Matt, thanks for the fast fix :) Do you have the possibility to also update this for Umbraco v13? That would help us out a lot. |
Ahh, ok, do you want to give 15.3.4--preview.7 a test then instead? |
Hi Matt, we assumed you meant 13.2.2--preview.3.g38892cf for Umbraco 13? If so, the patch doesn't seem to work there just yet. |
Hmm, maybe I forgot to push it, there should be a 13.2.2--preview.5 build on there now if you want to try that one. Again, make sure you clear your current order and re-add items for it to take effect. |
Works like a charm on the orderlines, thanks again for the fast responses, hope you have a good weekend |
Excellent! Thanks @TresBlue I'll probably get this pushed out as an official release next week, but hopefully you can keep using the nightly for the time being. |
|
Which component is this issue related to?
Umbraco Commerce (Core)
Which Umbraco Commerce version are you using? (Please write the exact version, example: 10.1.0)
13.2.0
Bug summary
As per #559, when creating a product all measurements need to be filled with a value for proper handling with shipments.
However our shop has a lot of products where just the weight matters. When entering 0 values for length, width and height, and then hitting saveandpublish, the proper shipment costs for the product are not calculated.
When checking the database the measurements field of the product looks like this: {"weight": 300}. Changing this by hand to {"length": 0, "width": 0, "height": 0, "weight": 300} actually fixes the issue.
Furthermore, when examining the orderline with the 'wrong' measurements (e.g. Models.Order.Orderlines.First().ProductMeasurements) it's null.
Specifics
Steps to reproduce
Create a dynamic shipping method with weight costs. Create a product in the backoffice with a value for weight, with length, width and height to 0. Shipping costs should still be calculated.
For the 'fix', create a method in something like a controller to update the measurements by hand to {"length": 0, "width": 0, "height": 0, "weight": 300} and saveandpublish there. The proper costs should now be calculated.
Expected result / actual result
The proper shipping costs should be calculated based on the weight regardless of entering length, width and height.
Dependencies
No response
The text was updated successfully, but these errors were encountered: