@lancom/shared 0.0.203 → 0.0.204
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.
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
},
|
|
24
24
|
computed: {
|
|
25
25
|
...mapGetters('quote', ['quote', 'option', 'proceedOption', 'selectedOption', 'depositInfo', 'shopContacts', 'quoteAddress', 'quoteId', 'options', 'gstTax']),
|
|
26
|
-
...mapGetters(['shop'])
|
|
26
|
+
...mapGetters(['shop', 'country', 'currency'])
|
|
27
27
|
},
|
|
28
28
|
methods: {
|
|
29
29
|
...mapActions('quote', ['selectOption', 'clear']),
|
|
@@ -48,6 +48,8 @@ export default {
|
|
|
48
48
|
createOrder(option) {
|
|
49
49
|
const orderData = {
|
|
50
50
|
shop: this.shop._id,
|
|
51
|
+
country: this.country?._id,
|
|
52
|
+
currency: this.currency?._id,
|
|
51
53
|
...convertQuoteToOrder(this.quote, option)
|
|
52
54
|
};
|
|
53
55
|
return api.createOrder(orderData, this.shop._id);
|
package/package.json
CHANGED
package/store/index.js
CHANGED
|
@@ -45,14 +45,14 @@ export const actions = {
|
|
|
45
45
|
commit('setMenus', menus);
|
|
46
46
|
commit('setShop', shop);
|
|
47
47
|
commit('setSettings', shop.settings);
|
|
48
|
-
if (req.headers.cookie) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
48
|
+
// if (req.headers.cookie) {
|
|
49
|
+
const { country, currency } = (req.headers.cookie && cookieparser.parse(req.headers.cookie)) || {};
|
|
50
|
+
const headers = (req && req.headers) ? Object.assign({}, req.headers) : {};
|
|
51
|
+
const params = { country, currency, ip: headers['x-real-ip'] || req.ip };
|
|
52
|
+
const settings = await api.fetchClientSettings(shop._id, params);
|
|
53
|
+
commit('setCountry', settings.country);
|
|
54
|
+
commit('setCurrency', settings.currency);
|
|
55
|
+
// }
|
|
56
56
|
try {
|
|
57
57
|
if (req.headers.cookie) {
|
|
58
58
|
const { auth } = cookieparser.parse(req.headers.cookie);
|