PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.20
Booking for Appointments and Events Calendar – Amelia v1.2.20
2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / v3 / src / store / modules / coupon.js
ameliabooking / v3 / src / store / modules Last commit date
appointment.js 1 year ago attendee.js 1 year ago auth.js 1 year ago bookableType.js 3 years ago booking.js 1 year ago cabinet.js 1 year ago cabinetFilters.js 1 year ago coupon.js 2 years ago customFields.js 2 years ago customerInfo.js 1 year ago employee.js 1 year ago entities.js 1 year ago event.js 1 year ago eventBooking.js 3 years ago eventEntities.js 1 year ago eventWaitingListOptions.js 1 year ago pagination.js 3 years ago params.js 1 year ago payment.js 2 years ago persons.js 1 year ago recurring.js 1 year ago shortcodeParams.js 2 years ago tickets.js 1 year ago
coupon.js
103 lines
1 export default {
2 namespaced: true,
3
4 state: () => ({
5 code: '',
6 discount: '',
7 deduction: '',
8 limit: '',
9 error: '',
10 loading: false,
11 required: false,
12 payPalActions: null,
13 servicesIds: [],
14 }),
15
16 getters: {
17 getCoupon (state) {
18 return {
19 code: state.code,
20 discount: state.discount,
21 deduction: state.deduction,
22 limit: state.limit,
23 required: state.required,
24 servicesIds: state.servicesIds,
25 }
26 },
27
28 getCouponValidated (state) {
29 return !state.required || (state.code !== '')
30 },
31
32 getCode (state) {
33 return state.code
34 },
35
36 getError (state) {
37 return state.error
38 },
39
40 getLoading (state) {
41 return state.loading
42 },
43
44 getPayPalActions (state) {
45 return state.payPalActions
46 },
47 },
48
49 mutations: {
50 setCoupon (state, payload) {
51 state.code = payload.code
52 state.discount = payload.discount
53 state.deduction = payload.deduction
54 state.limit = payload.limit
55 state.servicesIds = payload.servicesIds
56 },
57
58 setCode (state, payload) {
59 state.code = payload
60 },
61
62 setError (state, payload) {
63 state.error = payload
64 },
65
66 setLoading (state, payload) {
67 state.loading = payload
68 },
69
70 setCouponRequired (state, payload) {
71 state.required = payload
72 },
73
74 setPayPalActions (state, payload) {
75 state.payPalActions = payload
76 },
77
78 enablePayPalActions (state) {
79 if (state.payPalActions) {
80 state.payPalActions.enable()
81 }
82 },
83
84 disablePayPalActions (state) {
85 if (state.payPalActions) {
86 state.payPalActions.disable()
87 }
88 },
89 },
90
91 actions: {
92 resetCoupon ({commit}) {
93 commit('setCoupon', {
94 code: '',
95 discount: '',
96 deduction: '',
97 limit: '',
98 servicesIds: [],
99 })
100 }
101 }
102 }
103