mirror of
https://github.com/jcreek/SvelteKitSaasBoilerplate.git
synced 2026-07-13 19:13:48 +00:00
fix(#12): Ensure unit prices are displayed correctly
This commit is contained in:
@@ -30,7 +30,7 @@
|
|||||||
<h6
|
<h6
|
||||||
class="font-medium text-lg leading-8 text-indigo-600 max-[550px]:text-center pr-4 mr-4 border-r border-gray-200"
|
class="font-medium text-lg leading-8 text-indigo-600 max-[550px]:text-center pr-4 mr-4 border-r border-gray-200"
|
||||||
>
|
>
|
||||||
{ formatCurrency(price, currency) }
|
{formatCurrency(price, currency)}
|
||||||
</h6>
|
</h6>
|
||||||
<p class="font-medium text-base leading-7 text-black">
|
<p class="font-medium text-base leading-7 text-black">
|
||||||
Qty: <span class="text-gray-500">{quantity}</span>
|
Qty: <span class="text-gray-500">{quantity}</span>
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
<h6
|
<h6
|
||||||
class="text-indigo-600 font-manrope font-bold text-2xl leading-9 w-full max-w-[176px] text-center"
|
class="text-indigo-600 font-manrope font-bold text-2xl leading-9 w-full max-w-[176px] text-center"
|
||||||
>
|
>
|
||||||
{ formatCurrency(price, currency) }
|
{formatCurrency(price * quantity, currency)}
|
||||||
</h6>
|
</h6>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,11 +11,7 @@
|
|||||||
localBasket = value;
|
localBasket = value;
|
||||||
});
|
});
|
||||||
|
|
||||||
let {
|
let { checkoutSession, lineItems, paymentStatus } = data;
|
||||||
checkoutSession,
|
|
||||||
lineItems,
|
|
||||||
paymentStatus
|
|
||||||
} = data;
|
|
||||||
|
|
||||||
onDestroy(unsubscribe);
|
onDestroy(unsubscribe);
|
||||||
|
|
||||||
@@ -76,7 +72,7 @@
|
|||||||
{#each lineItems as item (item.id)}
|
{#each lineItems as item (item.id)}
|
||||||
<OrderConfirmationItem
|
<OrderConfirmationItem
|
||||||
itemName={item.description}
|
itemName={item.description}
|
||||||
price={item.amount_total / 100}
|
price={item.price.unit_amount / 100}
|
||||||
quantity={item.quantity}
|
quantity={item.quantity}
|
||||||
currency={item.currency}
|
currency={item.currency}
|
||||||
/>
|
/>
|
||||||
@@ -89,7 +85,12 @@
|
|||||||
<div class="flex flex-col sm:flex-row items-center max-lg:border-b border-gray-200"></div>
|
<div class="flex flex-col sm:flex-row items-center max-lg:border-b border-gray-200"></div>
|
||||||
<p class="font-semibold text-lg text-black py-6">
|
<p class="font-semibold text-lg text-black py-6">
|
||||||
{#if checkoutSession?.amount_total != null}
|
{#if checkoutSession?.amount_total != null}
|
||||||
Total Price: <span class="text-indigo-600"> {formatCurrency(checkoutSession?.amount_total / 100, checkoutSession?.currency ?? 'gbp')}</span>
|
Total Price: <span class="text-indigo-600">
|
||||||
|
{formatCurrency(
|
||||||
|
checkoutSession?.amount_total / 100,
|
||||||
|
checkoutSession?.currency ?? 'gbp'
|
||||||
|
)}</span
|
||||||
|
>
|
||||||
{/if}
|
{/if}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user