working on getting input to respond correctly.
This commit is contained in:
@ -87,6 +87,18 @@ export class Product {
|
||||
throw new Error(`Invalid dimensions: ${dimensions}`);
|
||||
}
|
||||
|
||||
get priceDisplay() {
|
||||
const u = this.presentUnits;
|
||||
if (this.area) {
|
||||
const w = Math.round(convert(this.area.w, this.area.u).to(this.presentUnits));
|
||||
const l = Math.round(convert(this.area.l, this.area.u).to(this.presentUnits));
|
||||
return `$ ${this.pricePerUnit} / ${l} x ${w} ${u}`;
|
||||
} else if (this.length) {
|
||||
const l = Math.round(convert(this.length.l, this.length.u).to(this.presentUnits));
|
||||
return `$ ${this.pricePerUnit} per ${l} ${u}`;
|
||||
}
|
||||
}
|
||||
|
||||
get attributesAsList() {
|
||||
return Object.entries(this.attributes).map(([key, value]) => {
|
||||
return { key, value }
|
||||
|
Reference in New Issue
Block a user