@viur/shop-components 0.15.0 → 0.15.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viur/shop-components",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "Frontend Vue components for the shop module of ViUR",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,7 +28,7 @@
28
28
  </sl-format-number>
29
29
  </div>
30
30
  <div class="viur-shop-cart-sidebar-info" v-if="shopStore.state.cartRoot.discount">
31
- <span v-html="$t('viur.shop.summary_discount')"></span>
31
+ <span>{{ shopStore.state.cartRoot.discount.dest.name }}</span>
32
32
  <sl-format-number lang="de" type="currency" currency="EUR" :value="state.discount">
33
33
  </sl-format-number>
34
34
  </div>
@@ -76,7 +76,7 @@ import LoadingHandler from "./components/LoadingHandler.vue"
76
76
  import DiscountInput from './components/DiscountInput.vue';
77
77
 
78
78
  const shopStore = useViurShopStore();
79
- const { fetchCart, addItem, state: cartState } = useCart();
79
+ const { fetchCart, fetchCartRoot, addItem, state: cartState } = useCart();
80
80
 
81
81
  const props = defineProps({
82
82
  showFeatures: {type: Boolean, default: true},
@@ -138,7 +138,7 @@ onBeforeMount(() => {
138
138
  if (!shopStore.state.cartList.length) {
139
139
  fetchCart().then(()=>state.loading=false).catch(()=>state.loading=false)
140
140
  }else{
141
- state.loading=false
141
+ fetchCartRoot().then(()=>state.loading=false).catch(()=>state.loading=false)
142
142
  }
143
143
  })
144
144
 
@@ -13,11 +13,22 @@
13
13
  error-style="decent"
14
14
  >
15
15
  </ViForm>
16
+ <ShopAlert
17
+ v-if="state.showCountryChangeHint"
18
+ class="country-change-hint"
19
+ variant="warning"
20
+ icon-name="exclamation-triangle"
21
+ :closeable="true"
22
+ duration="Infinity"
23
+ :msg="$t('viur.shop.country_change_vat_hint')"
24
+ @on-hide="state.showCountryChangeHint = false"
25
+ />
16
26
  </template>
17
27
 
18
28
  <script setup>
19
29
  import {computed, onMounted, reactive, watch} from 'vue'
20
30
  import LoadingHandler from './LoadingHandler.vue';
31
+ import ShopAlert from './ShopAlert.vue';
21
32
  import ViForm from "@viur/vue-utils/forms/ViForm.vue";
22
33
  import {useViurShopStore} from "../shop";
23
34
  import {useAddress} from "../composables/address";
@@ -68,11 +79,14 @@ const state = reactive({
68
79
  }
69
80
  return [state.formtype]
70
81
  }),
71
- language: "de"
82
+ language: "de",
83
+ initialCountry: null,
84
+ showCountryChangeHint: false
72
85
  })
73
86
 
74
87
  function formChange(data){
75
88
  if (data.name === "country"){
89
+ state.showCountryChangeHint = data.value !== state.initialCountry
76
90
  state.language = data.value
77
91
  if (state.formtype === 'billing'){
78
92
  fetchPaymentData()
@@ -87,6 +101,7 @@ onMounted(()=>{
87
101
  }else{
88
102
  state.language = shopStore.state.language
89
103
  }
104
+ state.initialCountry = state.language
90
105
  })
91
106
 
92
107
 
@@ -104,5 +119,7 @@ watch(()=>addressState.billingIsShipping, (newVal,oldVal)=>{
104
119
  </script>
105
120
 
106
121
  <style scoped>
107
-
122
+ .country-change-hint {
123
+ margin: 1em 0;
124
+ }
108
125
  </style>
@@ -61,6 +61,7 @@ export default {
61
61
  'payment_link': 'Ihr Browser öffnet kein Popup? Dann klicken Sie bitte <a href="{url}" target="_blank">hier</a>.',
62
62
  'birthdate': 'Geburtsdatum',
63
63
  'missing_birthdate': 'Bei der ausgewählten Bezahlmethode benötigen wir zur Rechnungsadresse noch das Geburtsdatum von <i>{firstname}&nbsp;{lastname}</i>.',
64
+ 'country_change_vat_hint': 'Bitte beachten Sie, dass bei Lieferung in ein anderes Land die Mehrwertsteuer abweichen kann.',
64
65
  },
65
66
  },
66
67
  messages: {
@@ -60,6 +60,7 @@ export default {
60
60
  'payment_link': 'Your browser does not open a popup? Then please click <a href="{url}" target="_blank">here</a>.',
61
61
  'birthdate': 'date of birth',
62
62
  'missing_birthdate': 'For the selected payment method, we require the date of birth of <i>{firstname}&nbsp;{lastname}</i> in addition to the billing address.',
63
+ 'country_change_vat_hint': 'Please note that VAT may differ when shipping to a different country.',
63
64
  },
64
65
  },
65
66
  messages: {
@@ -61,6 +61,7 @@ export default {
61
61
  'payment_link': 'Votre navigateur n\'ouvre pas de popup ? Alors cliquez <a href="{url}" target="_blank">ici</a>.',
62
62
  'birthdate': 'date de naissance',
63
63
  'missing_birthdate': 'Pour le mode de paiement sélectionné, nous avons besoin, en plus de l\'adresse de facturation, de la date de naissance de <i>{firstname}&nbsp;{lastname}</i>.',
64
+ 'country_change_vat_hint': 'Veuillez noter que la TVA peut varier en cas de livraison dans un autre pays.',
64
65
  },
65
66
  },
66
67
  messages: {