update price

This commit is contained in:
Samandar Turgunboyev
2026-03-04 10:14:49 +05:00
parent a0994df9bd
commit 3fcbf22b70
6 changed files with 40 additions and 29 deletions

View File

@@ -213,7 +213,9 @@ const ProductDetail = () => {
};
const subtotal = data?.prices?.length
? Math.min(...data.prices.map((p) => Number(p.price)))
? data.prices.find((p) => p.price_type.code === '1')
? data.prices.find((p) => p.price_type.code === '1')?.price
: Math.min(...data.prices.map((p) => Number(p.price)))
: 0;
/* ---------------- LOADING ---------------- */
@@ -250,7 +252,7 @@ const ProductDetail = () => {
<div className="flex items-baseline gap-2 mb-4">
<span className="text-4xl font-bold text-blue-600">
{formatPrice(subtotal, true)}
{formatPrice(Number(subtotal), true)}
</span>
<span className="text-xl text-gray-500">/{measurementDisplay}</span>
</div>
@@ -298,7 +300,7 @@ const ProductDetail = () => {
</div>
<div className="mb-6 text-xl font-semibold">
{t('Jami')}: {formatPrice(subtotal * numericQty, true)}
{t('Jami')}: {formatPrice(Number(subtotal) * numericQty, true)}
</div>
<div className="flex gap-3">