Show Lot Quantities Instead of Weights for Some Products
|Assignee:||Pavan Rikhi||% Done:|
|Target version:||v0.7.0 - Misc Pages & UI|
E.g., for mushroom spawn we want to show things like "100 plugs", not "0.00g".
Make the weight field an amount field/type with weight or custom label constructors?
type ProductAmount = Mass Milligrams | Custom Integer Text.
Or should we hardcode all possible types & show a "amount type" dropdown on the admin page? E.g.
type ProductAmount = Mass Milligrams | Plugs Amount.
After reviewing old product names, this should be good enough for now. Later, we can add more standardized options if necessary/common.
data LotSize = Mass Milligrams | Bulbs Integer | Slips Integer | Plugs Integer | CustomLotSize Text ProductVariant lotSize LotSize Maybe
[#1403] Support Multiple Lot Size Descriptions
Modify the ProductVariant model so that variants can be described in
other ways than just milligrams by replacing the weight field with a
lotSize field. Add a LotSize type to the Models.Fields module with
built-in support for Mass, Bulb/Slip/Plug counts, custom text, & blank
Modify the routes returning Variants to use the new lotSize field insted
of the weight field.
Modify the DataMigration script so that blank values are given for the
LotSize if the old Product's weight is 0.
[#1403] Show Lot Sizes Instead of Variant Weights
Modify the client to decode & display the new lotSize field for Product
Variants instead of the removed weight field. A LotSize type has been
added to the Models.Fields module, along with a decoder & string
Modify the milligramsToString function to append the "g" suffix(grams)
to the returned string.