@wikala/spmkt 2.11.1 → 2.12.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.
@@ -2,7 +2,9 @@
2
2
  <div :class="['cart-item', { 'ci-error': item.error }]">
3
3
  <div class="ci-product">
4
4
  <div class="ci-product-image">
5
- <a :href="item.slug" :class="[{ 'is-link-passive': !item.storefront_visibility }]"><img :src="item.image_url" class="image is-64x64" /></a>
5
+ <a :href="item.slug" :class="[{ 'is-link-passive': !item.storefront_visibility }]">
6
+ <img v-if="item.storefront_visibility && !item.image_url.includes('image_not_found')" :src="item.image_url" class="image is-64x64" />
7
+ </a>
6
8
  </div>
7
9
  <div class="ci-name">
8
10
  <div class="ci-product-name">
@@ -82,7 +84,9 @@ export default {
82
84
  this.$bus.$emit('updateTotalQty', response.data.sumQty)
83
85
  cqLoading.close()
84
86
  let responseItem = response.data.items.find(item => item.id === productId)
85
- this.itemQty = responseItem.qty
87
+ if(responseItem) {
88
+ this.itemQty = responseItem.qty
89
+ }
86
90
  this.setCart(response.data)
87
91
  } catch (error) {
88
92
  cqLoading.close()
@@ -60,6 +60,15 @@
60
60
  </div>
61
61
  </div>
62
62
 
63
+ <div class="cart-accept-tos mt-6 mb-6" v-if="initialState.acceptTOSAtCheckout">
64
+ <b-checkbox name="accept_tos" v-model="acceptTOS" @input="acceptTOSChange">
65
+ <span v-html="$t('cart.acceptTOS')"></span>
66
+ </b-checkbox>
67
+ <p class="help is-danger" v-if="acceptTOSError">
68
+ {{ acceptTOSError }}
69
+ </p>
70
+ </div>
71
+
63
72
  <div class="cc-submit">
64
73
  <button type="button" @click="placeOrder" class="button is-primary is-large">{{ $t('cart.placeYourOrder') }}</button>
65
74
  </div>
@@ -75,6 +84,7 @@
75
84
 
76
85
  import { mapState, mapMutations, mapActions } from 'vuex'
77
86
  import _ from 'underscore'
87
+ import animateCSS from '../../../utils/animate'
78
88
 
79
89
  import { zsig } from '../../../utils/rc-token'
80
90
  import { Cart, Address as AddressRepository } from '../../../api'
@@ -121,7 +131,9 @@ export default {
121
131
  billing_address: {},
122
132
  validationErrors: {},
123
133
  paymentMethodError: false,
124
- recaptchaToken: ''
134
+ recaptchaToken: '',
135
+ acceptTOS: '',
136
+ acceptTOSError: ''
125
137
  }
126
138
  },
127
139
 
@@ -148,11 +160,16 @@ export default {
148
160
  statePaymentMethod: 'paymentMethod'
149
161
  })
150
162
  },
163
+
151
164
  methods: {
152
165
  ...mapMutations(['setActiveStep', 'setCreditCard', 'setCardToken', 'setBillingAddress', 'setRecaptchaToken', 'setIdempotencyKey', 'setPaymentMethod']),
153
166
 
154
167
  ...mapActions(['getAddresses']),
155
168
 
169
+ acceptTOSChange() {
170
+ this.acceptTOSError = ''
171
+ },
172
+
156
173
  onPaymentMethodsInput(pl) {
157
174
  this.paymentMethodError = false
158
175
  this.paymentMethod = _.findWhere(this.paymentMethods, {id: pl})
@@ -316,6 +333,16 @@ export default {
316
333
  this.paymentMethodError = true
317
334
  return
318
335
  }
336
+
337
+ if(this.initialState.acceptTOSAtCheckout) {
338
+ this.acceptTOSError = ''
339
+ if(!this.acceptTOS) {
340
+ animateCSS('.cart-accept-tos', 'pulse')
341
+ this.acceptTOSError = this.$t('cart.acceptTOSError')
342
+ return false
343
+ }
344
+ }
345
+
319
346
  if (this.statePaymentMethod.type === 'offline') {
320
347
  this.submitPayment()
321
348
  return
package/locales/en.json CHANGED
@@ -87,6 +87,8 @@
87
87
  "userIdentityPhoneErr": "Enter your mobile phone number"
88
88
  },
89
89
  "cart": {
90
+ "acceptTOS": "I accept TOS",
91
+ "acceptTOSError": "Accept TOS error",
90
92
  "acceptedPaymentMethods": "Accepted Payment Methods",
91
93
  "accountExistsError": "There is an existing account associated with this email address. Please sign in to continue or use a different email address.",
92
94
  "addToCart": "Add to cart",
package/locales/sr.json CHANGED
@@ -87,6 +87,8 @@
87
87
  "userIdentityPhoneErr": "Unesite broj telefona"
88
88
  },
89
89
  "cart": {
90
+ "acceptTOS": "Prihvatam <a href=\"/politika-privatnosti\" target=\"blank\">politiku privatnosti</a>, <a href=\"/uslovi-koriscenja\" target=\"blank\">uslove korišćenja</a> i <a href=\"/obavestenje-o-pravima-potrosaca\" target=\"blank\">obaveštenje o pravima potrošača</a>",
91
+ "acceptTOSError": "Da bi završili kupovinu neophodno je da prihvatite politiku privatnosti, uslove korišćenja i obaveštenje o pravima potrošača",
90
92
  "acceptedPaymentMethods": "Načini plaćanja",
91
93
  "accountExistsError": "Već postoji nalog sa unetom email adresom. Molimo vas da se ulogujete ili da unesete drugu email adresu.",
92
94
  "addToCart": "Dodaj u korpu",
@@ -124,7 +126,7 @@
124
126
  "orderDate": "Datum narudžbenice:",
125
127
  "orderInfo": "\n Potvrda će biti poslata na \n <strong>{0}</strong> kada vaša narudžbenica bude obrađena. Dobićete još jedan mail kada kurirska služba preuzme pošiljku. U slučaju da nastupi neki problem takođe ćemo vas obavestiti na email.\n",
126
128
  "orderNumber": "Broj narudžbenice:",
127
- "orderSummary": "Ukupno",
129
+ "orderSummary": "",
128
130
  "payment": "Plaćanje",
129
131
  "pickupDelivery": "Isporuka",
130
132
  "placeYourOrder": "Izvrši plaćanje",
@@ -197,7 +199,7 @@
197
199
  "subtotal": "Ukupno",
198
200
  "tax": "PDV",
199
201
  "to": "do",
200
- "total": "Za plaćanje",
202
+ "total": "Za plaćanje (RSD)",
201
203
  "unconfirmed": "Nepotvrđeno",
202
204
  "unexpectedResponse": "Neočekivani odgovor",
203
205
  "update": "Ažuriraj",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikala/spmkt",
3
- "version": "2.11.1",
3
+ "version": "2.12.2",
4
4
  "private": false,
5
5
  "description": "supermarket",
6
6
  "scripts": {