Bug? Saving Product Weight

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
jasonhendee
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 42
Joined: Fri Apr 15, 2011 11:04 pm

Bug? Saving Product Weight

Post by jasonhendee » Wed Aug 03, 2011 1:23 pm

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?
Jason Hendee
Cables for Less

jasonhendee
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 42
Joined: Fri Apr 15, 2011 11:04 pm

Re: Bug? Saving Product Weight

Post by jasonhendee » Thu Aug 04, 2011 4:00 pm

Fixed - in 'Admin' >> 'Products' >> 'EditProduct.aspx.cs' I changed line 66 from:

Code: Select all

Weight.Text = string.Format("{0:F2}", _Product.Weight);
to:

Code: Select all

Weight.Text = string.Format("{0:F4}", _Product.Weight);
And in 'Admin' >> 'Products' >> 'Variants' >> 'Variants.aspx.cs' I changed line 160 from:

Code: Select all

rowBuilder.Append("<td align=\"center\"><input name=\"" + weightKey + "\" type=\"text\" value=\"" + variant.Weight.ToString("F2") + "\" style=\"width:50px;\" />");
to:

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

Post Reply