discounts
This commit is contained in:
@@ -201,14 +201,15 @@ pub(crate) async fn resolve_cart(
|
||||
if qty == 0 {
|
||||
continue;
|
||||
}
|
||||
let line_total = product.price_cents * i64::from(qty);
|
||||
let unit_price = product.effective_price_cents();
|
||||
let line_total = unit_price * i64::from(qty);
|
||||
total += line_total;
|
||||
valid.push((product.id, qty));
|
||||
lines.push(json!({
|
||||
"id": product.id,
|
||||
"name": product.name,
|
||||
"slug": product.slug,
|
||||
"price": format_price(product.price_cents),
|
||||
"price": format_price(unit_price),
|
||||
"currency": product.currency,
|
||||
"quantity": qty,
|
||||
"stock": product.stock,
|
||||
|
||||
Reference in New Issue
Block a user