@wikala/spmkt 2.24.1 → 2.25.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.
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="cart-badge-container has-text-white button is-text text-decoration-none">
3
3
  <span class="icon is-small" @click="qtyClick">
4
- <i class="fas fa-shopping-cart"></i>
4
+ <i class="fa-light fa-basket-shopping-simple"></i>
5
5
  <div class="cart-qty">{{ badgeQty }}</div>
6
6
  </span>
7
7
  <span class="cart-badge" @click="qtyClick">{{ label }}</span>
@@ -2,7 +2,7 @@
2
2
  <div v-click-outside="hide" v-if="product" :class="['cart-box-container', { active: isActive }]">
3
3
  <div v-if="isActive" class="cart-box-triangle"></div>
4
4
  <div class="cart-box-content">
5
- <span class="close" @click="isActive = false">
5
+ <span class="close" @click="hide()">
6
6
  <i class="far fa-times"></i>
7
7
  </span>
8
8
  <div class="cart-box-content-inner">
@@ -60,7 +60,8 @@ export default {
60
60
  isActive: true,
61
61
  product: null,
62
62
  cartTotal: null,
63
- sumQty: 0
63
+ sumQty: 0,
64
+ addToCartButton: null,
64
65
  }
65
66
  },
66
67
 
@@ -69,6 +70,9 @@ export default {
69
70
 
70
71
  hide() {
71
72
  this.isActive = false
73
+ if (this.addToCartButton) {
74
+ this.addToCartButton.classList.remove('is-hidden')
75
+ }
72
76
  },
73
77
 
74
78
  goToCart() {
@@ -77,6 +81,9 @@ export default {
77
81
  },
78
82
 
79
83
  mounted() {
84
+
85
+ this.addToCartButton = document.querySelector('.add-to-cart')
86
+
80
87
  this.$bus.$on('addToCart', (product) => {
81
88
  this.product = product
82
89
  this.isActive = true
@@ -106,6 +113,10 @@ export default {
106
113
  if (this.$mq === 'mobile') {
107
114
  this.$nextTick(() => {
108
115
  animateCSS('.cart-box-container', 'slideInUp')
116
+ console.log('atcb', this.addToCartButton)
117
+ if (this.addToCartButton) {
118
+ this.addToCartButton.classList.add('is-hidden')
119
+ }
109
120
  })
110
121
  }
111
122
  })
@@ -4,7 +4,7 @@
4
4
  <div class="column shop-cart-left-col is-8-desktop is-7-tablet">
5
5
  <div v-if="cart.items && cart.items.length === 0" class="continueShopping is-block has-text-centered">
6
6
  <p>{{ $t('cart.cartEmpty') }}</p>
7
- <a href="/shop" class="button is-primary">{{ $t('cart.continueShopping') }}</a>
7
+ <a href="/" class="button is-primary">{{ $t('cart.continueShopping') }}</a>
8
8
  </div>
9
9
 
10
10
  <div v-else>
@@ -18,7 +18,7 @@
18
18
  />
19
19
  </div>
20
20
 
21
- <div v-if="deliveryType === 'delivery'" class="c-delivery-address scroll-target mt-5">
21
+ <div v-if="deliveryType === 'delivery'" class="c-delivery-address scroll-target">
22
22
  <DeliveryAddressGuest
23
23
  v-if="cartMode === 'guest'"
24
24
  @nextStep="nextStep"
@@ -32,7 +32,7 @@
32
32
  />
33
33
  </div>
34
34
 
35
- <div v-if="deliveryType === 'pickup'" class="c-delivery-address scroll-target mt-5">
35
+ <div v-if="deliveryType === 'pickup'" class="c-delivery-address scroll-target">
36
36
  <div class="ca-title">{{ $t('cart.contactInfo') }}</div>
37
37
  <EditAddress
38
38
  :hidden-fields="{ address1: true, address2: true, city: true, state_id: true, country_id: true }"
@@ -135,7 +135,9 @@ export default {
135
135
  this.setBillingAddress(this.checkoutRequestData.shipping_address)
136
136
  try {
137
137
  await this.getAvailableDeliveryMethods(this.checkoutRequestData.shipping_address)
138
- this.scrollToElement('.delivery-method')
138
+ if(this.$mq === 'mobile') {
139
+ this.scrollToElement('.delivery-method')
140
+ }
139
141
  } catch (error) {
140
142
  this.addressValid = false
141
143
  this.$emit('addressValidation', false)
@@ -190,7 +190,7 @@ export default {
190
190
  let cartResponse = await this.updateCart()
191
191
  if (cartResponse) {
192
192
  this.$emit('success')
193
- this.$bus.$emit('addToCart', this.productDetails())
193
+ this.$bus.$emit('addToCart', this.productDetails(), this.el$)
194
194
  if (!!window.google_tag_manager) {
195
195
  GoogleAnalyticsEEC.addToCart(this.eecProduct(), () => {
196
196
  this.loadingAddToCart = false
@@ -239,7 +239,7 @@ export default {
239
239
  },
240
240
 
241
241
  handleScroll() {
242
- if (this.$mq !== 'mobile') {
242
+ if (this.$mq !== 'mobile' || this.headless) {
243
243
  return;
244
244
  }
245
245
  const element = this.$el
@@ -284,16 +284,17 @@ export default {
284
284
 
285
285
  this.$nextTick(() => {
286
286
  if (!this.product_id && this.product.id) {
287
- //console.log('setting product_id to ', this.product.id)
288
287
  this.product_id = this.product.id
289
288
  if (this.product.variants.length > 0) {
290
289
  this.variantIds = _.pluck(this.product.variants, 'id')
291
290
  }
292
291
  }
292
+ this.handleScroll()
293
293
  })
294
294
 
295
295
  this.handleBusEvents()
296
- this.handleScroll()
296
+
297
+
297
298
 
298
299
  }
299
300
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikala/spmkt",
3
- "version": "2.24.1",
3
+ "version": "2.25.1",
4
4
  "private": false,
5
5
  "description": "supermarket",
6
6
  "scripts": {