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) {
|
||||
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">
|
||||
{t("cart")}
|
||||
</h1>
|
||||
|
||||
@@ -75,6 +75,9 @@ export default function FavoritesPage() {
|
||||
product.price_amount ? parseFloat(product.price_amount) : null
|
||||
}
|
||||
struct_price_text={formattedPrice}
|
||||
oldPrice={
|
||||
product.old_price_amount ? parseFloat(product.old_price_amount) : null
|
||||
}
|
||||
images={allImages}
|
||||
labels={[]}
|
||||
price_color="#0059ff"
|
||||
|
||||
@@ -59,6 +59,9 @@ export default function CategoryProductsGrid({
|
||||
price={
|
||||
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`}
|
||||
images={[product.media?.[0]?.images_400x400]}
|
||||
stock={product.stock}
|
||||
|
||||
@@ -58,6 +58,9 @@ export default function CollectionProductsGrid({
|
||||
price={
|
||||
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`}
|
||||
images={[product.media?.[0]?.images_400x400]}
|
||||
stock={product.stock}
|
||||
|
||||
@@ -87,7 +87,7 @@ export default function CategoryGrid({
|
||||
/>
|
||||
</div>
|
||||
<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}
|
||||
</p>
|
||||
</CardContent>
|
||||
|
||||
@@ -42,6 +42,7 @@ type ProductCardProps = {
|
||||
id: number;
|
||||
name: string;
|
||||
price: number | null;
|
||||
oldPrice: number | null;
|
||||
struct_price_text: string;
|
||||
discount?: number | null;
|
||||
discount_text?: string | null;
|
||||
@@ -58,6 +59,7 @@ export default function ProductCard({
|
||||
id,
|
||||
name,
|
||||
price,
|
||||
oldPrice,
|
||||
struct_price_text,
|
||||
images,
|
||||
labels = [],
|
||||
@@ -375,13 +377,18 @@ export default function ProductCard({
|
||||
</h3>
|
||||
|
||||
{/* Price */}
|
||||
<div className="flex items-baseline gap-2">
|
||||
<div className="flex items-baseline gap-1">
|
||||
<p
|
||||
className="text-2xl font-bold tracking-tight"
|
||||
className="text-xl font-bold tracking-tight"
|
||||
style={{ color: price_color }}
|
||||
>
|
||||
{struct_price_text}
|
||||
</p>
|
||||
{oldPrice && (
|
||||
<span className="text-sm text-gray-400 line-through ">
|
||||
{oldPrice} TMT
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex gap-2 items-center">
|
||||
{/* Favorite Button */}
|
||||
|
||||
@@ -89,6 +89,9 @@ export default function CollectionSection({ collection, locale }: Props) {
|
||||
product.price_amount ? parseFloat(product.price_amount) : null
|
||||
}
|
||||
struct_price_text={formattedPrice}
|
||||
oldPrice={
|
||||
product.old_price_amount ? parseFloat(product.old_price_amount) : null
|
||||
}
|
||||
images={allImages}
|
||||
labels={[]}
|
||||
price_color="#0059ff"
|
||||
|
||||
@@ -55,6 +55,9 @@ export function RelatedProductsSection({
|
||||
price={parseFloat(product.price_amount) || null}
|
||||
struct_price_text={
|
||||
product.struct_price_text || `${product.price_amount} TMT`
|
||||
}
|
||||
oldPrice={
|
||||
product.old_price_amount ? parseFloat(product.old_price_amount) : null
|
||||
}
|
||||
discount={product.discount}
|
||||
discount_text={product.discount_text}
|
||||
|
||||
Reference in New Issue
Block a user