update price
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user