feat: refactor product variant handling to use product pricing and remove unnecessary fields

This commit is contained in:
2026-06-30 15:58:19 -03:00
parent 8b10996319
commit fdeba7540b
10 changed files with 5 additions and 56 deletions

View File

@@ -20,7 +20,7 @@ class CartResource extends JsonResource
: collect();
$subtotal = $items->reduce(
fn (float $carry, $item): float => $carry + ((float) ($item->variant?->precio ?? 0) * $item->cantidad),
fn (float $carry, $item): float => $carry + ((float) ($item->variant?->product?->precio ?? 0) * $item->cantidad),
0.0,
);