mirror of
https://github.com/badlogic/heissepreise.git
synced 2024-06-27 10:55:50 +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(
|
||||
{
|
||||
id: item.masterValues["code-internal"],
|
||||
|
@ -54,7 +60,7 @@ exports.getCanonical = function (item, today) {
|
|||
priceHistory: [{ date: today, price }],
|
||||
unit,
|
||||
quantity,
|
||||
isWeighted: item.masterValues["item-type"] === "WeightProduct",
|
||||
isWeighted,
|
||||
bio: item.masterValues.biolevel === "Bio",
|
||||
url: item.masterValues.url,
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user