create-brainerce-store 1.77.0 → 1.78.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/messages/en.json +0 -1
- package/messages/he.json +0 -1
- package/package.json +1 -1
- package/templates/nextjs/base/src/app/checkout/page.tsx +24 -29
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ var require_package = __commonJS({
|
|
|
31
31
|
"package.json"(exports2, module2) {
|
|
32
32
|
module2.exports = {
|
|
33
33
|
name: "create-brainerce-store",
|
|
34
|
-
version: "1.
|
|
34
|
+
version: "1.78.0",
|
|
35
35
|
description: "Scaffold a production-ready e-commerce storefront connected to Brainerce",
|
|
36
36
|
bin: {
|
|
37
37
|
"create-brainerce-store": "dist/index.js"
|
package/messages/en.json
CHANGED
package/messages/he.json
CHANGED
package/package.json
CHANGED
|
@@ -1068,36 +1068,31 @@ function CheckoutContent() {
|
|
|
1068
1068
|
{/* Totals */}
|
|
1069
1069
|
{checkout &&
|
|
1070
1070
|
(() => {
|
|
1071
|
-
//
|
|
1072
|
-
//
|
|
1073
|
-
//
|
|
1074
|
-
//
|
|
1075
|
-
//
|
|
1076
|
-
//
|
|
1077
|
-
|
|
1078
|
-
// `taxBreakdown.subtotal` is the NET of every taxed line, and
|
|
1079
|
-
// shipping is one of those lines — so it already contains the
|
|
1080
|
-
// shipping net. Rendering it and then adding `shippingAmount`
|
|
1081
|
-
// below counts shipping twice: a real checkout read
|
|
1082
|
-
// 54.06 + 9.99 + 7.93 = 71.98 beside a 61.99 total, three rows
|
|
1083
|
-
// that visibly refuse to add up next to the figure being charged.
|
|
1071
|
+
// Every row in this column is GROSS, and the tax row below is
|
|
1072
|
+
// informational. That is how a VAT receipt reads, it is what
|
|
1073
|
+
// `TaxDisplay` already says on its own line ("VAT 18% included"),
|
|
1074
|
+
// and it is exactly what the order-history summary renders — one
|
|
1075
|
+
// convention across all three, so a shopper who compares the
|
|
1076
|
+
// checkout against the order they later open sees the same
|
|
1077
|
+
// arithmetic twice.
|
|
1084
1078
|
//
|
|
1085
|
-
//
|
|
1086
|
-
//
|
|
1087
|
-
//
|
|
1088
|
-
//
|
|
1089
|
-
// `shippingAmount`
|
|
1090
|
-
//
|
|
1091
|
-
//
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
const
|
|
1079
|
+
// This deliberately drops an earlier attempt to show a NET
|
|
1080
|
+
// subtotal for inclusive stores. Two things were wrong with it.
|
|
1081
|
+
// It read `taxBreakdown.subtotal`, which is the net of every
|
|
1082
|
+
// TAXED LINE — shipping included — and then added
|
|
1083
|
+
// `shippingAmount` below, counting shipping twice: a real
|
|
1084
|
+
// checkout printed 54.06 + 9.99 + 7.93 beside a 61.99 total.
|
|
1085
|
+
// And a net subtotal cannot coexist with a tax row labelled
|
|
1086
|
+
// "included": either the shopper adds the tax, contradicting the
|
|
1087
|
+
// label, or they do not, and the column falls short of the total
|
|
1088
|
+
// by the whole VAT. Subtracting the shipping net back out fixes
|
|
1089
|
+
// the arithmetic and leaves the contradiction, so the row that
|
|
1090
|
+
// has to go is the special case itself.
|
|
1091
|
+
//
|
|
1092
|
+
// Gross + gross = total, with the VAT stated beneath it:
|
|
1093
|
+
// 52.00 + 9.99 = 61.99, "VAT 18% included 7.93".
|
|
1094
|
+
const displayedSubtotal = parseFloat(checkout.subtotal);
|
|
1095
|
+
const subtotalLabel = tc('subtotal');
|
|
1101
1096
|
return (
|
|
1102
1097
|
<div className="border-border space-y-2 border-t pt-4 text-sm">
|
|
1103
1098
|
<div className="flex items-center justify-between">
|