@viur/shop-components 0.9.0 → 0.9.2
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/package.json +1 -1
- package/src/Shop.vue +2 -1
- package/src/composables/cart.js +5 -5
- package/src/translations/en.js +1 -1
- package/src/translations/fr.js +1 -1
package/package.json
CHANGED
package/src/Shop.vue
CHANGED
|
@@ -120,12 +120,12 @@ onBeforeMount(()=>{
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
shopStore.state.moduleName= props.modulename
|
|
123
|
-
fetchCart()
|
|
124
123
|
shopStore.fetchMetaData()
|
|
125
124
|
const params = useUrlSearchParams('hash')
|
|
126
125
|
if (Object.keys(params).includes('order')){
|
|
127
126
|
shopStore.state.orderKey = params['order']
|
|
128
127
|
fetchOrder(shopStore.state.orderKey).then(()=>{
|
|
128
|
+
fetchCart(); // load after cartKey has been loaded from order
|
|
129
129
|
shopStore.state.orderReady = true
|
|
130
130
|
// navigate to order state
|
|
131
131
|
if(shopStore.state.order?.['is_ordered']){
|
|
@@ -135,6 +135,7 @@ onBeforeMount(()=>{
|
|
|
135
135
|
}
|
|
136
136
|
})
|
|
137
137
|
}else{
|
|
138
|
+
fetchCart()
|
|
138
139
|
shopStore.state.orderReady = true
|
|
139
140
|
}
|
|
140
141
|
|
package/src/composables/cart.js
CHANGED
|
@@ -39,18 +39,18 @@ export function useCart() {
|
|
|
39
39
|
//first fetch root then fetchItems for this root
|
|
40
40
|
state.isLoading = true;
|
|
41
41
|
|
|
42
|
-
if (shopStore.state.order != null && shopStore.order?.cart?.key
|
|
43
|
-
shopStore.state.cartRoot = {};
|
|
44
|
-
shopStore.state.cartRoot = shopStore.state.order.cart;
|
|
42
|
+
if (shopStore.state.order != null && shopStore.state.order?.cart?.dest.key) {
|
|
43
|
+
// shopStore.state.cartRoot = {};
|
|
44
|
+
shopStore.state.cartRoot = shopStore.state.order.cart.dest;
|
|
45
45
|
|
|
46
|
-
return fetchCartItems(shopStore.state.
|
|
46
|
+
return fetchCartItems(shopStore.state.cartRoot["key"]).then(() => { // TODO: duplicate code
|
|
47
47
|
state.isLoading = false;
|
|
48
48
|
shopStore.state.cartReady = true;
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
return fetchCartRoot().then(() => {
|
|
52
52
|
if (!shopStore.state.cartRoot?.["key"]) return 0;
|
|
53
|
-
fetchCartItems(shopStore.state.cartRoot["key"]).then(() => {
|
|
53
|
+
fetchCartItems(shopStore.state.cartRoot["key"]).then(() => { // TODO: duplicate code
|
|
54
54
|
state.isLoading = false;
|
|
55
55
|
shopStore.state.cartReady = true;
|
|
56
56
|
});
|
package/src/translations/en.js
CHANGED
|
@@ -57,7 +57,7 @@ export default {
|
|
|
57
57
|
'order_step_verify': 'Review order',
|
|
58
58
|
'order_step_complete': 'Order complete',
|
|
59
59
|
'paypal_client_popup_info': 'Please make sure your browser allows the PayPal popup.',
|
|
60
|
-
'payment_link': 'Your browser does not open a popup? Then please click <a href="{
|
|
60
|
+
'payment_link': 'Your browser does not open a popup? Then please click <a href="{url}" target="_blank">here</a>.',
|
|
61
61
|
},
|
|
62
62
|
},
|
|
63
63
|
messages: {
|
package/src/translations/fr.js
CHANGED
|
@@ -57,7 +57,7 @@ export default {
|
|
|
57
57
|
'order_step_verify': 'Vérifier la commande',
|
|
58
58
|
'order_step_complete': 'Valider la commande',
|
|
59
59
|
'paypal_client_popup_info':"Assurez-vous que votre navigateur autorise la fenêtre contextuelle PayPal.",
|
|
60
|
-
'payment_link': 'Votre navigateur n\'ouvre pas de popup ? Alors cliquez <a href="{
|
|
60
|
+
'payment_link': 'Votre navigateur n\'ouvre pas de popup ? Alors cliquez <a href="{url}" target="_blank">ici</a>.',
|
|
61
61
|
},
|
|
62
62
|
},
|
|
63
63
|
messages: {
|