@viur/shop-components 0.14.5 → 0.14.7

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.14.5",
3
+ "version": "0.14.7",
4
4
  "description": "Frontend Vue components for the shop module of ViUR",
5
5
  "repository": {
6
6
  "type": "git",
@@ -3,10 +3,11 @@
3
3
  ref="stepper"
4
4
  class="viur-shop-order-tabgroup"
5
5
  no-scroll-controls
6
+ :data-steppervisible="shopStore.state.stepperVisible"
6
7
  >
7
8
  <template v-for="(tab,name) in shopStore.state.tabs">
8
9
  <StepperTab
9
- v-show="shopStore.state.currentTab!=='complete'"
10
+ v-show="shopStore.state.stepperVisible"
10
11
  :tab="name"
11
12
  >
12
13
  </StepperTab>
@@ -106,4 +107,8 @@ sl-tab-panel {
106
107
  }
107
108
  }
108
109
 
110
+ .viur-shop-order-tabgroup[data-steppervisible='false']::part(nav){
111
+ visibility: hidden;
112
+ }
113
+
109
114
  </style>
@@ -113,7 +113,7 @@ const state = reactive({
113
113
  return "-"
114
114
  }
115
115
  }),
116
- discount:computed(()=> (state.cartTotal - shopStore.state.cartRoot.total_discount_price)*-1),
116
+ discount:computed(() => (shopStore.state.cartRoot.total - shopStore.state.cartRoot.total_discount_price)*-1),
117
117
  total: computed(() => {
118
118
  return shopStore.state.cartRoot.total_discount_price
119
119
  }),
@@ -96,7 +96,12 @@ export const useAddress = defineStore('useAddressStore', () => {
96
96
  // The address skel is the same, we just need to reload the relation
97
97
  fetchCart();
98
98
  } else {
99
- await updateCart({shipping_address_key: key});
99
+ let resp = await updateCart({shipping_address_key: key});
100
+ const data = await resp.json()
101
+ shopStore.state.cartRoot['shipping_address'] = data['shipping_address']
102
+ if (shopStore.state.cartRoot.discount){
103
+ shopStore.state.discounts = {[shopStore.state.cartRoot.discount.dest.key]:shopStore.state.cartRoot.discount}
104
+ }
100
105
  }
101
106
  } else if (type === 'billing') {
102
107
  const {addOrUpdateOrder, fetchOrder, billingAddressKey} = useOrder();
package/src/shop.js CHANGED
@@ -125,7 +125,13 @@ export const useViurShopStore = defineStore("viurshopStore", () => {
125
125
  paymentProviderData:null,
126
126
  UserDataLayout: shallowRef(AddressFormLayout),
127
127
  discounts:{},
128
- stepperActionComponent:shallowRef(ShopOrderStepperAction)
128
+ stepperActionComponent:shallowRef(ShopOrderStepperAction),
129
+
130
+ //stepper rules:
131
+ stepperVisible: computed(()=>{
132
+ return state.currentTab!=='complete'
133
+ })
134
+
129
135
  })
130
136
 
131
137
  function addTab({name, component, displayname, iconname, iconlibrary,active})