@easy-cms/plugin-ecommerce 0.66.1 → 0.67.1
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.
|
@@ -783,7 +783,7 @@ var INFO = {
|
|
|
783
783
|
name: "@easy-cms/plugin-ecommerce",
|
|
784
784
|
// The plugin API it is written for (`PLUGIN_API_VERSION` of @easy-cms/core).
|
|
785
785
|
apiVersion: 1,
|
|
786
|
-
...true ? { version: "0.
|
|
786
|
+
...true ? { version: "0.67.1" } : {}
|
|
787
787
|
};
|
|
788
788
|
|
|
789
789
|
// src/shop.ts
|
|
@@ -1694,15 +1694,23 @@ function ecommercePlugin(options) {
|
|
|
1694
1694
|
return found;
|
|
1695
1695
|
};
|
|
1696
1696
|
const who = (req) => ({ user: req.user, context: req.context });
|
|
1697
|
-
const settings = () => ({
|
|
1697
|
+
const settings = (locale) => ({
|
|
1698
1698
|
currencies,
|
|
1699
1699
|
defaultCurrency,
|
|
1700
|
-
|
|
1700
|
+
// Labels in the page's language (`?locale=`), as the order emails use the order's.
|
|
1701
|
+
paymentMethods: [...methods.values()].map((m) => ({
|
|
1702
|
+
name: m.name,
|
|
1703
|
+
label: labelText(m.label, locale)
|
|
1704
|
+
})),
|
|
1701
1705
|
guests: shop.guests,
|
|
1702
1706
|
countries
|
|
1703
1707
|
});
|
|
1704
1708
|
const endpoints = [
|
|
1705
|
-
{
|
|
1709
|
+
{
|
|
1710
|
+
path: "/shop/config",
|
|
1711
|
+
method: "get",
|
|
1712
|
+
handler: ({ url }) => settings(url.searchParams.get("locale") ?? void 0)
|
|
1713
|
+
},
|
|
1706
1714
|
{
|
|
1707
1715
|
path: "/shop/cart",
|
|
1708
1716
|
method: "post",
|
|
@@ -147,7 +147,7 @@ function createShopClient(options = {}) {
|
|
|
147
147
|
async load() {
|
|
148
148
|
try {
|
|
149
149
|
const [settings, user] = await Promise.all([
|
|
150
|
-
call("GET",
|
|
150
|
+
call("GET", `/shop/config?locale=${encodeURIComponent(locale)}`),
|
|
151
151
|
me().catch(() => null)
|
|
152
152
|
]);
|
|
153
153
|
set({ settings, user });
|
package/dist/client.js
CHANGED
package/dist/index.js
CHANGED
package/dist/react.js
CHANGED
package/dist/stripe.js
CHANGED
package/dist/vue.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easy-cms/plugin-ecommerce",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.67.1",
|
|
4
4
|
"description": "A shop for Easy CMS: products and variants, prices in several currencies, carts (guests too), checkout with Stripe or bank transfer, orders, stock, customer accounts, and React and Vue hooks (experimental)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"react": ">=18.0.0",
|
|
37
37
|
"stripe": ">=17.0.0",
|
|
38
38
|
"vue": "^3.4.0",
|
|
39
|
-
"@easy-cms/core": "^0.
|
|
39
|
+
"@easy-cms/core": "^0.67.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependenciesMeta": {
|
|
42
42
|
"react": {
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"happy-dom": "^20.14.5",
|
|
55
55
|
"react": "^19.2.0",
|
|
56
56
|
"vue": "^3.5.43",
|
|
57
|
-
"@easy-cms/core": "^0.
|
|
58
|
-
"@easy-cms/db-sqlite": "^0.
|
|
59
|
-
"@easy-cms/plugin-multi-tenant": "^0.
|
|
57
|
+
"@easy-cms/core": "^0.67.1",
|
|
58
|
+
"@easy-cms/db-sqlite": "^0.67.1",
|
|
59
|
+
"@easy-cms/plugin-multi-tenant": "^0.67.1"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": ">=22.12"
|