added old price amount
This commit is contained in:
1
.vscode/settings.json
vendored
Normal file
1
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
@@ -151,7 +151,7 @@ export default function CartPage() {
|
|||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return (
|
return (
|
||||||
<div className="mx-auto px-2 md:px-4 lg:px-6 mb-18">
|
<div className="mx-auto px-2 max-w-[1504px] md:px-4 lg:px-6 mb-18">
|
||||||
<h1 className="text-xl md:text-2xl lg:text-3xl font-bold mb-4 md:mb-6 pt-3">
|
<h1 className="text-xl md:text-2xl lg:text-3xl font-bold mb-4 md:mb-6 pt-3">
|
||||||
{t("cart")}
|
{t("cart")}
|
||||||
</h1>
|
</h1>
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ export default function FavoritesPage() {
|
|||||||
product.price_amount ? parseFloat(product.price_amount) : null
|
product.price_amount ? parseFloat(product.price_amount) : null
|
||||||
}
|
}
|
||||||
struct_price_text={formattedPrice}
|
struct_price_text={formattedPrice}
|
||||||
|
oldPrice={
|
||||||
|
product.old_price_amount ? parseFloat(product.old_price_amount) : null
|
||||||
|
}
|
||||||
images={allImages}
|
images={allImages}
|
||||||
labels={[]}
|
labels={[]}
|
||||||
price_color="#0059ff"
|
price_color="#0059ff"
|
||||||
|
|||||||
@@ -59,6 +59,9 @@ export default function CategoryProductsGrid({
|
|||||||
price={
|
price={
|
||||||
product.price_amount ? parseFloat(product.price_amount) : null
|
product.price_amount ? parseFloat(product.price_amount) : null
|
||||||
}
|
}
|
||||||
|
oldPrice={
|
||||||
|
product.old_price_amount ? parseFloat(product.old_price_amount) : null
|
||||||
|
}
|
||||||
struct_price_text={`${product.price_amount} TMT`}
|
struct_price_text={`${product.price_amount} TMT`}
|
||||||
images={[product.media?.[0]?.images_400x400]}
|
images={[product.media?.[0]?.images_400x400]}
|
||||||
stock={product.stock}
|
stock={product.stock}
|
||||||
|
|||||||
@@ -58,6 +58,9 @@ export default function CollectionProductsGrid({
|
|||||||
price={
|
price={
|
||||||
product.price_amount ? parseFloat(product.price_amount) : null
|
product.price_amount ? parseFloat(product.price_amount) : null
|
||||||
}
|
}
|
||||||
|
oldPrice={
|
||||||
|
product.old_price_amount ? parseFloat(product.old_price_amount) : null
|
||||||
|
}
|
||||||
struct_price_text={`${product.price_amount} TMT`}
|
struct_price_text={`${product.price_amount} TMT`}
|
||||||
images={[product.media?.[0]?.images_400x400]}
|
images={[product.media?.[0]?.images_400x400]}
|
||||||
stock={product.stock}
|
stock={product.stock}
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export default function CategoryGrid({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<CardContent className="py-4 px-3">
|
<CardContent className="py-4 px-3">
|
||||||
<p className="text-sm font-semibold text-gray-900 truncate text-center group-hover:text-gray-700 transition-colors">
|
<p className="text-sm font-semibold text-gray-900 text-center group-hover:text-gray-700 transition-colors">
|
||||||
{cat.name}
|
{cat.name}
|
||||||
</p>
|
</p>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ type ProductCardProps = {
|
|||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
price: number | null;
|
price: number | null;
|
||||||
|
oldPrice: number | null;
|
||||||
struct_price_text: string;
|
struct_price_text: string;
|
||||||
discount?: number | null;
|
discount?: number | null;
|
||||||
discount_text?: string | null;
|
discount_text?: string | null;
|
||||||
@@ -58,6 +59,7 @@ export default function ProductCard({
|
|||||||
id,
|
id,
|
||||||
name,
|
name,
|
||||||
price,
|
price,
|
||||||
|
oldPrice,
|
||||||
struct_price_text,
|
struct_price_text,
|
||||||
images,
|
images,
|
||||||
labels = [],
|
labels = [],
|
||||||
@@ -375,13 +377,18 @@ export default function ProductCard({
|
|||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
{/* Price */}
|
{/* Price */}
|
||||||
<div className="flex items-baseline gap-2">
|
<div className="flex items-baseline gap-1">
|
||||||
<p
|
<p
|
||||||
className="text-2xl font-bold tracking-tight"
|
className="text-xl font-bold tracking-tight"
|
||||||
style={{ color: price_color }}
|
style={{ color: price_color }}
|
||||||
>
|
>
|
||||||
{struct_price_text}
|
{struct_price_text}
|
||||||
</p>
|
</p>
|
||||||
|
{oldPrice && (
|
||||||
|
<span className="text-sm text-gray-400 line-through ">
|
||||||
|
{oldPrice} TMT
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex gap-2 items-center">
|
<div className="flex gap-2 items-center">
|
||||||
{/* Favorite Button */}
|
{/* Favorite Button */}
|
||||||
|
|||||||
@@ -89,6 +89,9 @@ export default function CollectionSection({ collection, locale }: Props) {
|
|||||||
product.price_amount ? parseFloat(product.price_amount) : null
|
product.price_amount ? parseFloat(product.price_amount) : null
|
||||||
}
|
}
|
||||||
struct_price_text={formattedPrice}
|
struct_price_text={formattedPrice}
|
||||||
|
oldPrice={
|
||||||
|
product.old_price_amount ? parseFloat(product.old_price_amount) : null
|
||||||
|
}
|
||||||
images={allImages}
|
images={allImages}
|
||||||
labels={[]}
|
labels={[]}
|
||||||
price_color="#0059ff"
|
price_color="#0059ff"
|
||||||
|
|||||||
@@ -55,6 +55,9 @@ export function RelatedProductsSection({
|
|||||||
price={parseFloat(product.price_amount) || null}
|
price={parseFloat(product.price_amount) || null}
|
||||||
struct_price_text={
|
struct_price_text={
|
||||||
product.struct_price_text || `${product.price_amount} TMT`
|
product.struct_price_text || `${product.price_amount} TMT`
|
||||||
|
}
|
||||||
|
oldPrice={
|
||||||
|
product.old_price_amount ? parseFloat(product.old_price_amount) : null
|
||||||
}
|
}
|
||||||
discount={product.discount}
|
discount={product.discount}
|
||||||
discount_text={product.discount_text}
|
discount_text={product.discount_text}
|
||||||
|
|||||||
Reference in New Issue
Block a user