Skip to content

Commit d86fa61

Browse files
committed
Fix max cart line amount comparison
1 parent d9240e9 commit d86fa61

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

discounts/javascript/discount/default/src/generate_cart_run.liquid

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function generateCartRun(input) {
2121
throw new Error('No cart lines found');
2222
}
2323
const maxCartLine = input.cart.lines.reduce((maxLine, line) => {
24-
if (line.cost.subtotalAmount > maxLine.cost.subtotalAmount) {
24+
if (line.cost.subtotalAmount.amount > maxLine.cost.subtotalAmount.amount) {
2525
return line;
2626
}
2727
return maxLine;
@@ -89,7 +89,7 @@ export function generateCartRun(input: CartInput): CartLinesDiscountsGenerateRun
8989
}
9090

9191
const maxCartLine = input.cart.lines.reduce((maxLine, line) => {
92-
if (line.cost.subtotalAmount > maxLine.cost.subtotalAmount) {
92+
if (line.cost.subtotalAmount.amount > maxLine.cost.subtotalAmount.amount) {
9393
return line;
9494
}
9595
return maxLine;

0 commit comments

Comments
 (0)