diff --git a/docs/index.md b/docs/index.md
index 687e192..4a5bbae 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -5,3 +5,7 @@ This project is a PrestaShop integration for Vue Storefront 2.
The PrestaShop integration with Vue Storefront is being maintained by [Binshops](https://www.binshops.com).
You can help us to improve the integration by reporting bugs and contributing to the code at the [repository issues page](https://github.com/vuestorefront/prestashop/issues).
+
+## Why Headless?
+
+
diff --git a/packages/api-client/package.json b/packages/api-client/package.json
index 1985972..c525edd 100644
--- a/packages/api-client/package.json
+++ b/packages/api-client/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue-storefront/prestashop-api",
- "version": "1.2.1",
+ "version": "1.2.2",
"private": false,
"sideEffects": false,
"server": "server/index.js",
diff --git a/packages/composables/package.json b/packages/composables/package.json
index 951d6bb..d245fb1 100644
--- a/packages/composables/package.json
+++ b/packages/composables/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue-storefront/prestashop",
- "version": "1.2.1",
+ "version": "1.2.2",
"private": false,
"sideEffects": false,
"main": "lib/index.cjs.js",
@@ -16,7 +16,7 @@
"update:update": "ncu -u"
},
"dependencies": {
- "@vue-storefront/prestashop-api": "1.2.1",
+ "@vue-storefront/prestashop-api": "1.2.2",
"@vue-storefront/core": "~2.7.5"
},
"devDependencies": {
diff --git a/packages/composables/src/useBootstrap/index.ts b/packages/composables/src/useBootstrap/index.ts
index 2f6d51f..fc53e33 100644
--- a/packages/composables/src/useBootstrap/index.ts
+++ b/packages/composables/src/useBootstrap/index.ts
@@ -22,7 +22,11 @@ export const useBootstrap = () => {
try {
loading.value = true;
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
const { data, cookieObject } = await context.$prestashop.api.bootstrap({ lang: lang, currency: currency });
diff --git a/packages/composables/src/useCart/index.ts b/packages/composables/src/useCart/index.ts
index da97df8..c2b789a 100644
--- a/packages/composables/src/useCart/index.ts
+++ b/packages/composables/src/useCart/index.ts
@@ -18,7 +18,11 @@ const params: UseCartFactoryParams = {
const psCookieKey = context.$prestashop.config.app.$cookies.get(vsfCookieKey);
const psCookieValue = context.$prestashop.config.app.$cookies.get(vsfCookieValue);
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
const { data, cookieObject } = await context.$prestashop.api.getCartItems({ psCookieKey, psCookieValue, lang: lang, currency: currency });
@@ -43,7 +47,11 @@ const params: UseCartFactoryParams = {
const psCookieKey = context.$prestashop.config.app.$cookies.get(vsfCookieKey);
const psCookieValue = context.$prestashop.config.app.$cookies.get(vsfCookieValue);
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
const { data, cookieObject } = await context.$prestashop.api.addToCart({ psCookieKey, psCookieValue, product, quantity, lang: lang, currency: currency });
@@ -68,7 +76,11 @@ const params: UseCartFactoryParams = {
const psCookieKey = context.$prestashop.config.app.$cookies.get(vsfCookieKey);
const psCookieValue = context.$prestashop.config.app.$cookies.get(vsfCookieValue);
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
const { data, cookieObject } = await context.$prestashop.api.removeFromCart({ psCookieKey, psCookieValue, product, lang: lang, currency: currency });
@@ -100,7 +112,11 @@ const params: UseCartFactoryParams = {
const psCookieKey = context.$prestashop.config.app.$cookies.get(vsfCookieKey);
const psCookieValue = context.$prestashop.config.app.$cookies.get(vsfCookieValue);
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
const { data, cookieObject } = await context.$prestashop.api.updateCart({ psCookieKey, psCookieValue, product, op, lang: lang, currency: currency });
diff --git a/packages/composables/src/useCheckProduct/index.ts b/packages/composables/src/useCheckProduct/index.ts
index aef9ae3..8eba6c2 100644
--- a/packages/composables/src/useCheckProduct/index.ts
+++ b/packages/composables/src/useCheckProduct/index.ts
@@ -17,7 +17,11 @@ export const useCheckProduct = () => {
try {
loading.value = true;
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
const data = await context.$prestashop.api.getProduct(
diff --git a/packages/composables/src/useCountryList/index.ts b/packages/composables/src/useCountryList/index.ts
index 381893a..be36f8c 100644
--- a/packages/composables/src/useCountryList/index.ts
+++ b/packages/composables/src/useCountryList/index.ts
@@ -18,7 +18,11 @@ export const useCountryList = () => {
try {
loading.value = true;
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
const { data, cookieObject } = await context.$prestashop.api.getAvailableCountries({ lang: lang, currency: currency });
diff --git a/packages/composables/src/useFacet/index.ts b/packages/composables/src/useFacet/index.ts
index ad34059..9ca2d4e 100644
--- a/packages/composables/src/useFacet/index.ts
+++ b/packages/composables/src/useFacet/index.ts
@@ -11,7 +11,11 @@ const factoryParams = {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
search: async (context: Context, params: FacetSearchResult) => {
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
const data = await context.$prestashop.api.getCategoryProducts({ ...params, lang: lang, currency: currency });
diff --git a/packages/composables/src/useMakeOrder/index.ts b/packages/composables/src/useMakeOrder/index.ts
index bbb932f..c9022ca 100644
--- a/packages/composables/src/useMakeOrder/index.ts
+++ b/packages/composables/src/useMakeOrder/index.ts
@@ -17,7 +17,11 @@ const factoryParams: UseMakeOrderFactoryParams = {
const psCookieKey = context.$prestashop.config.app.$cookies.get(vsfCookieKey);
const psCookieValue = context.$prestashop.config.app.$cookies.get(vsfCookieValue);
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
const { data, cookieObject } = await context.$prestashop.api.makeOrder({ methodName: methodName, psCookieKey, psCookieValue, lang: lang, currency: currency });
diff --git a/packages/composables/src/usePayment/index.ts b/packages/composables/src/usePayment/index.ts
index 0823c95..e2870a2 100644
--- a/packages/composables/src/usePayment/index.ts
+++ b/packages/composables/src/usePayment/index.ts
@@ -24,7 +24,11 @@ export const usePayment = () => {
const psCookieKey = context.$prestashop.config.app.$cookies.get(vsfCookieKey);
const psCookieValue = context.$prestashop.config.app.$cookies.get(vsfCookieValue);
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
const { data, cookieObject } = await context.$prestashop.api.getPaymentMethods({ psCookieKey, psCookieValue, lang: lang, currency: currency });
diff --git a/packages/composables/src/useProduct/index.ts b/packages/composables/src/useProduct/index.ts
index 456e94f..8735b36 100644
--- a/packages/composables/src/useProduct/index.ts
+++ b/packages/composables/src/useProduct/index.ts
@@ -22,7 +22,11 @@ const params: UseProductFactoryParams = {
params.variantObj = variantObj;
}
- params.lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ params.lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
params.currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
const data = await context.$prestashop.api.getProduct(params);
diff --git a/packages/composables/src/useReview/index.ts b/packages/composables/src/useReview/index.ts
index d274b58..7021743 100644
--- a/packages/composables/src/useReview/index.ts
+++ b/packages/composables/src/useReview/index.ts
@@ -14,7 +14,11 @@ const params: UseReviewFactoryParams = {
searchReviews: async (context: Context, params) => {
const { customQuery, ...searchParams } = params;
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
const item = await context.$prestashop.api.getReview({ ...searchParams, lang: lang, currency: currency }, customQuery);
@@ -32,7 +36,11 @@ const params: UseReviewFactoryParams = {
const key = context.$prestashop.config.app.$cookies.get(cookieKey);
const value = context.$prestashop.config.app.$cookies.get(cookieValue);
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
const item = await context.$prestashop.api.addReview({ ...AddParams, customQuery, key, value, lang: lang, currency: currency });
diff --git a/packages/composables/src/useShippingProvider/index.ts b/packages/composables/src/useShippingProvider/index.ts
index 3ddc8a4..ac11627 100644
--- a/packages/composables/src/useShippingProvider/index.ts
+++ b/packages/composables/src/useShippingProvider/index.ts
@@ -10,7 +10,11 @@ const params: UseShippingProviderParams = {
const psCookieKey = context.$prestashop.config.app.$cookies.get(vsfCookieKey);
const psCookieValue = context.$prestashop.config.app.$cookies.get(vsfCookieValue);
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
const { data, cookieObject } = await context.$prestashop.api.getShippingMethods({ psCookieKey, psCookieValue, lang: lang, currency: currency });
if (data.code === 200) {
@@ -33,7 +37,11 @@ const params: UseShippingProviderParams = {
const psCookieKey = context.$prestashop.config.app.$cookies.get(vsfCookieKey);
const psCookieValue = context.$prestashop.config.app.$cookies.get(vsfCookieValue);
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
await context.$prestashop.api.setShippingMethod({ ...params.customQuery, psCookieKey, psCookieValue, lang: lang, currency: currency });
diff --git a/packages/composables/src/useUser/index.ts b/packages/composables/src/useUser/index.ts
index 1b48e32..e536546 100644
--- a/packages/composables/src/useUser/index.ts
+++ b/packages/composables/src/useUser/index.ts
@@ -18,7 +18,12 @@ const params: UseUserFactoryParams = {
const key = context.$prestashop.config.app.$cookies.get(cookieKey);
const value = context.$prestashop.config.app.$cookies.get(cookieValue);
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ // todo: lang detection should be another helper - removing duplicates (and cookie mgmt)
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
if (key && value) {
@@ -54,7 +59,11 @@ const params: UseUserFactoryParams = {
const psCookieKey = context.$prestashop.config.app.$cookies.get(vsfCookieKey);
const psCookieValue = context.$prestashop.config.app.$cookies.get(vsfCookieValue);
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
const { data, cookieObject } = await context.$prestashop.api.updateCustomer({ psCookieKey, psCookieValue, updatedUserData, lang: lang, currency: currency });
@@ -84,7 +93,11 @@ const params: UseUserFactoryParams = {
const psCookieKey = context.$prestashop.config.app.$cookies.get(vsfCookieKey);
const psCookieValue = context.$prestashop.config.app.$cookies.get(vsfCookieValue);
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
const {data, cookieObject} = await context.$prestashop.api.register({email, password, firstName, lastName, psCookieKey, psCookieValue, lang: lang, currency: currency});
@@ -126,7 +139,11 @@ const params: UseUserFactoryParams = {
const psCookieKey = context.$prestashop.config.app.$cookies.get(vsfCookieKey);
const psCookieValue = context.$prestashop.config.app.$cookies.get(vsfCookieValue);
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
const {data, cookieObject} = await context.$prestashop.api.login({username, password, psCookieKey, psCookieValue, lang: lang, currency });
@@ -160,7 +177,11 @@ const params: UseUserFactoryParams = {
const psCookieKey = context.$prestashop.config.app.$cookies.get(vsfCookieKey);
const psCookieValue = context.$prestashop.config.app.$cookies.get(vsfCookieValue);
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
const { data, cookieObject } = await context.$prestashop.api.updateCustomer({ psCookieKey, psCookieValue, updatedUserData, lang: lang, currency: currency });
diff --git a/packages/composables/src/useUserOrder/index.ts b/packages/composables/src/useUserOrder/index.ts
index 4085945..85d55e9 100644
--- a/packages/composables/src/useUserOrder/index.ts
+++ b/packages/composables/src/useUserOrder/index.ts
@@ -19,7 +19,11 @@ const params: UseUserOrderFactoryParams = {
const psCookieKey = context.$prestashop.config.app.$cookies.get(vsfCookieKey);
const psCookieValue = context.$prestashop.config.app.$cookies.get(vsfCookieValue);
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
const { data, cookieObject } = await context.$prestashop.api.fetchOrders({ psCookieKey, psCookieValue, orderId, lang: lang, currency: currency });
diff --git a/packages/composables/src/useUserShipping/index.ts b/packages/composables/src/useUserShipping/index.ts
index 93bb8a3..702a101 100644
--- a/packages/composables/src/useUserShipping/index.ts
+++ b/packages/composables/src/useUserShipping/index.ts
@@ -19,7 +19,11 @@ const params: UseUserShippingFactoryParams = {
const psCookieKey = context.$prestashop.config.app.$cookies.get(vsfCookieKey);
const psCookieValue = context.$prestashop.config.app.$cookies.get(vsfCookieValue);
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
await context.$prestashop.api.addNewAddress({address, psCookieKey, psCookieValue, lang: lang, currency: currency });
@@ -47,7 +51,11 @@ const params: UseUserShippingFactoryParams = {
const psCookieKey = context.$prestashop.config.app.$cookies.get(vsfCookieKey);
const psCookieValue = context.$prestashop.config.app.$cookies.get(vsfCookieValue);
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
await context.$prestashop.api.removeAddress({id, psCookieKey, psCookieValue, lang: lang, currency: currency });
@@ -74,7 +82,11 @@ const params: UseUserShippingFactoryParams = {
const psCookieKey = context.$prestashop.config.app.$cookies.get(vsfCookieKey);
const psCookieValue = context.$prestashop.config.app.$cookies.get(vsfCookieValue);
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
await context.$prestashop.api.updateOneAddress({address, psCookieKey, psCookieValue, lang: lang, currency: currency });
@@ -99,7 +111,11 @@ const params: UseUserShippingFactoryParams = {
const psCookieKey = context.$prestashop.config.app.$cookies.get(vsfCookieKey);
const psCookieValue = context.$prestashop.config.app.$cookies.get(vsfCookieValue);
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
const { data, cookieObject } = await context.$prestashop.api.loadAddresses({ psCookieKey, psCookieValue, lang: lang, currency: currency });
@@ -127,7 +143,11 @@ const params: UseUserShippingFactoryParams = {
const psCookieKey = context.$prestashop.config.app.$cookies.get(vsfCookieKey);
const psCookieValue = context.$prestashop.config.app.$cookies.get(vsfCookieValue);
- const lang = context.$prestashop.config.app.i18n.locales && context.$prestashop.config.app.i18n.locales.length > 1 ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+ const lang = context.$prestashop.config.app.i18n.locales &&
+ context.$prestashop.config.app.i18n.locales.length > 1 &&
+ context.$prestashop.config.app.$cookies.get('vsf-locale')
+ ? '/' + context.$prestashop.config.app.$cookies.get('vsf-locale') : '';
+
const currency = context.$prestashop.config.app.$cookies.get('vsf-currency');
await context.$prestashop.api.setAddress({ id, psCookieKey, psCookieValue, lang: lang, currency: currency });
diff --git a/packages/theme/package.json b/packages/theme/package.json
index bbb5729..17fe4a3 100644
--- a/packages/theme/package.json
+++ b/packages/theme/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue-storefront/prestashop-theme",
- "version": "1.2.1",
+ "version": "1.2.2",
"private": true,
"scripts": {
"build": "nuxt build -m",
@@ -24,7 +24,7 @@
"@vue-storefront/middleware": "~2.7.5",
"@vue-storefront/nuxt": "~2.7.5",
"@vue-storefront/nuxt-theme": "~2.7.5",
- "@vue-storefront/prestashop": "1.2.1",
+ "@vue-storefront/prestashop": "1.2.2",
"cookie-universal-nuxt": "^2.1.5",
"core-js": "^3.19.0",
"nuxt": "^2.15.8",