We sell some pretty light stuff - RJ45 Ends, for example, which weigh about 0.004lbs each. Since we do sell them by the piece, I have added them at that weight per item.
When I type 0.004 into the weight textbox for this item (in the admin panel) and save, the weight holds. If I ever visit this same product's page in the admin panel to change something other than the weight, it is now listed at 0.00lbs, even though it is still saved in my database as 0.0040. So the textbox is simply not displaying out to 4 decimal places.
The problem is that if I don't change the weight in the textbox to 0.004 every time I visit that page and make a change of any kind requiring a save, my weight gets overwritten to 0.0000 in the database. So it seems that simply extending the number of visible decimal places in that textbox would fix the problem, right?
Bug? Saving Product Weight
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 42
- Joined: Fri Apr 15, 2011 11:04 pm
Bug? Saving Product Weight
Jason Hendee
Cables for Less
Cables for Less
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 42
- Joined: Fri Apr 15, 2011 11:04 pm
Re: Bug? Saving Product Weight
Fixed - in 'Admin' >> 'Products' >> 'EditProduct.aspx.cs' I changed line 66 from:
to:
And in 'Admin' >> 'Products' >> 'Variants' >> 'Variants.aspx.cs' I changed line 160 from:
to:
Code: Select all
Weight.Text = string.Format("{0:F2}", _Product.Weight);
Code: Select all
Weight.Text = string.Format("{0:F4}", _Product.Weight);
Code: Select all
rowBuilder.Append("<td align=\"center\"><input name=\"" + weightKey + "\" type=\"text\" value=\"" + variant.Weight.ToString("F2") + "\" style=\"width:50px;\" />");
Code: Select all
rowBuilder.Append("<td align=\"center\"><input name=\"" + weightKey + "\" type=\"text\" value=\"" + variant.Weight.ToString("F4") + "\" style=\"width:50px;\" />");
Jason Hendee
Cables for Less
Cables for Less