Page 1 of 1

Need to modify sku/weight to support weight less than 0.01Kg

Posted: Tue Oct 06, 2015 5:11 am
by tonystt
Hi all,
Currently it seems to be sku's weight has floating point precision as 0.0x (2 decimal places).
But in my case, the sku could be less than 0.01 grams.
So how could we modify the scale value of weight field of sku entity so that we can keep those values ?

Thanks,
Tony

Re: Need to modify sku/weight to support weight less than 0.01Kg

Posted: Wed Oct 07, 2015 2:54 am
by tonystt
Solved.
Extend Sku to
1. Override embedded weight field using @AttributeOverrides to change scale value
2. Override setter/getter of embedded weight field

Re: Need to modify sku/weight to support weight less than 0.01Kg

Posted: Thu Oct 22, 2015 11:36 pm
by phillipuniverse
Nice, good call with @AttributeOverrides I didn't know about that annotation.

Thanks for reporting back your solution!