mirror of
https://github.com/badlogic/heissepreise.git
synced 2024-07-01 21:05:49 +02:00
Merge pull request #76 from mhochsteger/fix_spar_units_for_weighted_products
Use price-per-unit field for weighted products in spar
This commit is contained in:
commit
8632ca7024
|
@ -45,6 +45,12 @@ exports.getCanonical = function (item, today) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isWeighted = item.masterValues["item-type"] === "WeightProduct";
|
||||||
|
if (isWeighted) {
|
||||||
|
unit = fallback.unit;
|
||||||
|
quantity = fallback.quantity;
|
||||||
|
}
|
||||||
|
|
||||||
return utils.convertUnit(
|
return utils.convertUnit(
|
||||||
{
|
{
|
||||||
id: item.masterValues["code-internal"],
|
id: item.masterValues["code-internal"],
|
||||||
|
@ -54,7 +60,7 @@ exports.getCanonical = function (item, today) {
|
||||||
priceHistory: [{ date: today, price }],
|
priceHistory: [{ date: today, price }],
|
||||||
unit,
|
unit,
|
||||||
quantity,
|
quantity,
|
||||||
isWeighted: item.masterValues["item-type"] === "WeightProduct",
|
isWeighted,
|
||||||
bio: item.masterValues.biolevel === "Bio",
|
bio: item.masterValues.biolevel === "Bio",
|
||||||
url: item.masterValues.url,
|
url: item.masterValues.url,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user