Skip to content

Commit f1418db

Browse files
dora-jurcevicthibaultrey
authored andcommitted
fix: product model prices fix
1 parent 7eb2a03 commit f1418db

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

models/Product.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,12 @@ export class Product extends Model {
122122
}
123123
this.sku = data?.sku || null
124124
this.variantAttributes = data?.variant_attributes || {}
125-
const priceLists = Object.keys(data?.prices || {})
125+
const prices = data?.prices || data?.price || {}
126+
const priceLists = Object.keys(prices)
126127
if(priceLists?.length > 0) {
127128
this.pricesList = {}
128129
for(let priceList of priceLists) {
129-
this.pricesList[priceList] = new ProductPrice(data?.prices?.[priceList])
130+
this.pricesList[priceList] = new ProductPrice(prices?.[priceList])
130131
}
131132

132133
if(this.pricesList?.['default']) {

0 commit comments

Comments
 (0)