@wikala/spmkt 2.11.2 → 2.12.0

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.
@@ -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})
@@ -312,6 +329,13 @@ export default {
312
329
  },
313
330
 
314
331
  placeOrder() {
332
+ console.log('acceptTOS', this.acceptTOS)
333
+ this.acceptTOSError = ''
334
+ if(!this.acceptTOS) {
335
+ animateCSS('.cart-accept-tos', 'pulse')
336
+ this.acceptTOSError = this.$t('cart.acceptTOSError')
337
+ return false
338
+ }
315
339
  if(!this.paymentMethod.id) {
316
340
  this.paymentMethodError = true
317
341
  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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikala/spmkt",
3
- "version": "2.11.2",
3
+ "version": "2.12.0",
4
4
  "private": false,
5
5
  "description": "supermarket",
6
6
  "scripts": {