Fix: Show personalised price on design review page

Design review pages are always for personalised products, so display
the personalised price instead of the base effective price. This ensures
the preview page shows the same price that will be charged at checkout.
This commit is contained in:
Andymick
2026-07-18 20:02:48 +01:00
parent 121d469d06
commit 404f17acb2
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -67,7 +67,8 @@
"Bash(git commit -m 'Fix: Calculate effectivePrice in design API endpoints *)", "Bash(git commit -m 'Fix: Calculate effectivePrice in design API endpoints *)",
"Bash(git commit -m 'Fix: Handle designJson as string in checkout API *)", "Bash(git commit -m 'Fix: Handle designJson as string in checkout API *)",
"Bash(git commit -m 'Fix: Use personalised price in design approval cart add *)", "Bash(git commit -m 'Fix: Use personalised price in design approval cart add *)",
"Bash(git commit -m 'Fix: Safely access designJson properties in admin orders page *)" "Bash(git commit -m 'Fix: Safely access designJson properties in admin orders page *)",
"Bash(git commit -m 'Fix: Show personalised price on design review page *)"
] ]
} }
} }
+2 -2
View File
@@ -13,7 +13,7 @@ interface DesignApproval {
id: string; id: string;
name: string; name: string;
basePrice: number; basePrice: number;
personalisedPrice: number; personalisedPrice: number | null;
effectivePrice: number; effectivePrice: number;
}; };
designJson: string; designJson: string;
@@ -165,7 +165,7 @@ export default function DesignReviewPage({ params }: { params: { id: string } })
</p> </p>
)} )}
<p className="border-t border-line pt-3"> <p className="border-t border-line pt-3">
<strong>Price:</strong> £{(design.product.effectivePrice / 100).toFixed(2)} <strong>Price:</strong> £{((design.product.personalisedPrice ?? design.product.effectivePrice) / 100).toFixed(2)}
</p> </p>
</div> </div>