@wikala/spmkt 2.23.0 → 2.24.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.
@@ -5,58 +5,61 @@
5
5
  <Coupon />
6
6
  </div>
7
7
 
8
- <table class="table is-fullwidth">
9
- <tr>
10
- <td colspan="2">
11
- <div class="ca-title ct-summary">{{ $t('cart.orderSummary') }}</div>
12
- </td>
13
- </tr>
14
- <tr>
15
- <td>{{ $t('global.subtotal') }}</td>
16
- <td class="has-text-right">
17
- <transition name="slide-fade-up">
18
- <span :key="cart.subtotal">{{ formatMoney(cart.subtotal, { precision: 2 }) }} </span>
19
- </transition>
20
- </td>
21
- </tr>
22
- <tr v-if="cart.discount">
23
- <td>{{ $t('global.discount') }}</td>
24
- <td class="has-text-right">
25
- <transition name="slide-fade-up">
26
- <span :key="cart.discount">{{ formatMoney(cart.discount, { precision: 2 }) }}</span>
27
- </transition>
28
- </td>
29
- </tr>
30
- <tr v-if="activeStep <= 1 && cart.shipping > 0 || activeStep > 1">
31
- <td>{{ $t('global.shipping') }}</td>
32
- <td class="has-text-right">
33
- <transition name="slide-fade-up">
34
- <span v-if="cart.free_shipping" :key="cart.shipping">FREE</span>
35
- <span v-else :key="cart.shipping">{{ formatMoney(cart.shipping, { precision: 2 }) }}</span>
36
- </transition>
37
- </td>
38
- </tr>
39
- <tr>
40
- <td>{{ $t('global.tax') }}</td>
41
- <td class="has-text-right">
42
- <transition name="slide-fade-up">
43
- <span :key="cart.tax_amount">{{ formatMoney(cart.tax_amount, { precision: 2 }) }}</span>
44
- </transition>
45
- </td>
46
- </tr>
47
- <tr>
48
- <td>
49
- <strong>{{ totalLabel }}</strong>
50
- </td>
51
- <td class="has-text-right">
52
- <transition name="slide-fade-up">
53
- <span :key="cart.total">
54
- <strong>{{ formatMoney(cart.total, { precision: 2 }) }}</strong>
55
- </span>
56
- </transition>
57
- </td>
58
- </tr>
59
- </table>
8
+ <div class="cart-summary-table">
9
+ <table class="table is-fullwidth">
10
+ <tr>
11
+ <td colspan="2">
12
+ <div class="ca-title ct-summary">{{ $t('cart.orderSummary') }}</div>
13
+ </td>
14
+ </tr>
15
+ <tr>
16
+ <td>{{ $t('global.subtotal') }}</td>
17
+ <td class="has-text-right">
18
+ <transition name="slide-fade-up">
19
+ <span :key="cart.subtotal">{{ formatMoney(cart.subtotal, { precision: 2 }) }} </span>
20
+ </transition>
21
+ </td>
22
+ </tr>
23
+ <tr v-if="cart.discount">
24
+ <td>{{ $t('global.discount') }}</td>
25
+ <td class="has-text-right">
26
+ <transition name="slide-fade-up">
27
+ <span :key="cart.discount">{{ formatMoney(cart.discount, { precision: 2 }) }}</span>
28
+ </transition>
29
+ </td>
30
+ </tr>
31
+ <tr v-if="activeStep <= 1 && cart.shipping > 0 || activeStep > 1">
32
+ <td>{{ $t('global.shipping') }}</td>
33
+ <td class="has-text-right">
34
+ <transition name="slide-fade-up">
35
+ <span v-if="cart.free_shipping" :key="cart.shipping">FREE</span>
36
+ <span v-else :key="cart.shipping">{{ formatMoney(cart.shipping, { precision: 2 }) }}</span>
37
+ </transition>
38
+ </td>
39
+ </tr>
40
+ <tr>
41
+ <td>{{ $t('global.tax') }}</td>
42
+ <td class="has-text-right">
43
+ <transition name="slide-fade-up">
44
+ <span :key="cart.tax_amount">{{ formatMoney(cart.tax_amount, { precision: 2 }) }}</span>
45
+ </transition>
46
+ </td>
47
+ </tr>
48
+ <tr>
49
+ <td>
50
+ <strong>{{ totalLabel }}</strong>
51
+ </td>
52
+ <td class="has-text-right">
53
+ <transition name="slide-fade-up">
54
+ <span :key="cart.total">
55
+ <strong>{{ formatMoney(cart.total, { precision: 2 }) }}</strong>
56
+ </span>
57
+ </transition>
58
+ </td>
59
+ </tr>
60
+ </table>
61
+ </div>
62
+
60
63
  </div>
61
64
  </template>
62
65
 
@@ -2,7 +2,7 @@
2
2
  <div class="container">
3
3
 
4
4
  <div class="columns">
5
- <div class="is-offset-1-desktop is-10 column">
5
+ <div class="column">
6
6
  <div class="cart-top"></div>
7
7
  <b-tabs v-if="!showOrderConfirmation" v-model="activeStep" @click="tabClick" type="is-toggle" expanded>
8
8
  <b-tab-item>
@@ -236,6 +236,44 @@ export default {
236
236
  GoogleAnalyticsEEC.productView(this.eecProduct())
237
237
  //console.log('addtocart ', this.selectedVariant, this.product_id)
238
238
  }
239
+ },
240
+
241
+ handleScroll() {
242
+ if (this.$mq !== 'mobile') {
243
+ return;
244
+ }
245
+ const element = this.$el
246
+ const pagetop = document.querySelector('#pagetop')
247
+ const elementPosition = element.getBoundingClientRect().top
248
+
249
+ function checkPosition() {
250
+ const scrollPosition = window.scrollY
251
+
252
+ if (scrollPosition > elementPosition) {
253
+ element.classList.add('add-to-cart-fixed-footer')
254
+ pagetop.classList.add('pos2');
255
+ } else {
256
+ element.classList.remove('add-to-cart-fixed-footer');
257
+ pagetop.classList.remove('pos2');
258
+ }
259
+ }
260
+
261
+ window.addEventListener('scroll', checkPosition);
262
+ checkPosition();
263
+ },
264
+
265
+ handleBusEvents() {
266
+ this.$bus.$on('selectVariant', this.onSelectVariant)
267
+
268
+ if (!this.headless) {
269
+ this.$bus.$on('updateQty', (qty) => {
270
+ console.log('received updateQty', qty)
271
+ this.qty = qty
272
+ })
273
+ }
274
+ if (this.headless) {
275
+ this.initHeadless()
276
+ }
239
277
  }
240
278
  },
241
279
 
@@ -254,17 +292,9 @@ export default {
254
292
  }
255
293
  })
256
294
 
257
- this.$bus.$on('selectVariant', this.onSelectVariant)
258
-
259
- if (!this.headless) {
260
- this.$bus.$on('updateQty', (qty) => {
261
- console.log('received updateQty', qty)
262
- this.qty = qty
263
- })
264
- }
265
- if (this.headless) {
266
- this.initHeadless()
267
- }
295
+ this.handleBusEvents()
296
+ this.handleScroll()
297
+
268
298
  }
269
299
  }
270
300
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikala/spmkt",
3
- "version": "2.23.0",
3
+ "version": "2.24.1",
4
4
  "private": false,
5
5
  "description": "supermarket",
6
6
  "scripts": {