@wikala/spmkt 2.31.0 → 3.0.0-beta.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.
- package/MIGRATION_GUIDE.md +261 -0
- package/api/product.js +1 -0
- package/api/request.js +9 -4
- package/api/user.js +1 -1
- package/components/Account/AccountDashboard.vue +101 -101
- package/components/Account/AccountStore.js +57 -31
- package/components/Account/AffiliateReport.vue +56 -60
- package/components/Account/{OrderDetail.vue → Orders/OrderDetail.vue} +44 -30
- package/components/Account/Orders/Orders.vue +124 -0
- package/components/Account/{AccountSettings.vue → Settings/AccountSettings.vue} +4 -4
- package/components/Account/Settings/ChangeEmail.vue +136 -0
- package/components/Account/Settings/ChangeName.vue +82 -0
- package/components/Account/Settings/ChangePassword.vue +91 -0
- package/components/Address/Address.vue +38 -57
- package/components/Address/AddressBook.vue +77 -57
- package/components/Address/AddressSelect.vue +94 -87
- package/components/Address/Edit.vue +253 -265
- package/components/Address/PostalCode.vue +22 -21
- package/components/AgeGate.vue +11 -5
- package/components/Auth/Login.vue +62 -44
- package/components/Auth/Register.vue +82 -60
- package/components/Auth/ResetPassword.vue +45 -30
- package/components/Cart/AgeVerification/AgeChecker.vue +3 -3
- package/components/Cart/CartBadge.vue +15 -4
- package/components/Cart/CartBox.vue +19 -11
- package/components/Cart/CartItem.vue +3 -3
- package/components/Cart/CartMode.vue +6 -5
- package/components/Cart/CartPreview.vue +24 -18
- package/components/Cart/Coupon.vue +4 -5
- package/components/Cart/CreditCard/Everyware.vue +10 -10
- package/components/Cart/CreditCard/ExtendedCreditCard.vue +5 -5
- package/components/Cart/CreditCard/SquarePay.vue +18 -16
- package/components/Cart/CreditCard/StandardCreditCard.vue +9 -9
- package/components/Cart/Delivery/Delivery.vue +16 -12
- package/components/Cart/Delivery/DeliveryAddress.vue +1 -1
- package/components/Cart/Delivery/DeliveryMethods.vue +1 -1
- package/components/Cart/Delivery/DeliveryOptions.vue +15 -9
- package/components/Cart/Delivery/DeliveryTypes.vue +8 -5
- package/components/Cart/Delivery/ReservationSlots.vue +14 -8
- package/components/Cart/Disclaimer.vue +1 -1
- package/components/Cart/OrderConfirmation.vue +1 -1
- package/components/Cart/Payment/Payment.vue +37 -33
- package/components/Cart/Payment/PaymentMethods.vue +6 -4
- package/components/Cart/ReviewAndSubmit.vue +9 -7
- package/components/Cart/ShoppingCart.vue +42 -31
- package/components/Cart/Store/actions.js +1 -1
- package/components/Cart/Store/getters.js +2 -1
- package/components/Cart/Store/index.js +1 -1
- package/components/Cart/Store/mutations.js +7 -5
- package/components/Cart/UserIdentity.vue +1 -1
- package/components/Category/CategoryFilter.vue +128 -114
- package/components/Category/CategorySort.vue +44 -32
- package/components/Category/LoadMore.vue +39 -23
- package/components/DeliverTo.vue +10 -15
- package/components/DeliveryNotice.vue +72 -68
- package/components/DobInput.vue +23 -23
- package/components/Gmaps/GmapsAutocomplete.vue +139 -78
- package/components/Gmaps/GmapsLocations.vue +1 -1
- package/components/Gmaps/GmapsSingleLocation.vue +121 -87
- package/components/ModalContainer/ModalContainer.vue +12 -9
- package/components/ModalContainer/index.js +61 -18
- package/components/Product/AddToCart.vue +237 -221
- package/components/Product/BoxAddToCart.vue +114 -86
- package/components/Product/Compare.vue +68 -48
- package/components/Product/CompareBox.vue +128 -123
- package/components/Product/Lookup.vue +92 -65
- package/components/Product/Photo.vue +105 -66
- package/components/Product/Price.vue +64 -43
- package/components/Product/ProductAutocomplete.vue +52 -57
- package/components/Product/ProductBox.vue +61 -38
- package/components/Product/ProductImages.vue +83 -86
- package/components/Product/Quantity.vue +115 -53
- package/components/Product/QuickView.vue +52 -45
- package/components/Product/RelatedProducts.vue +88 -23
- package/components/Product/SKU.vue +27 -8
- package/components/Product/Variants.vue +335 -341
- package/components/Product/reviews-questions/ProductQuestions.vue +226 -198
- package/components/Product/reviews-questions/ProductReviews.vue +122 -107
- package/components/Product/reviews-questions/Review.vue +54 -59
- package/components/Product/reviews-questions/ReviewForm.vue +222 -170
- package/components/Product/reviews-questions/ReviewImages.vue +197 -216
- package/components/Product/reviews-questions/Vote.vue +83 -57
- package/components/QuantityInput.vue +18 -8
- package/components/RangeInput.vue +15 -8
- package/components/Recaptcha.vue +8 -1
- package/components/SelectShippingCountry.vue +81 -62
- package/components/TimedOffer.vue +59 -74
- package/composables/globals.js +53 -0
- package/config.js +5 -2
- package/index.js +41 -10
- package/install.js +75 -0
- package/locales/en.json +2 -1
- package/locales/sr.json +2 -1
- package/package.json +43 -30
- package/utils/directives.js +28 -45
- package/utils/event-bus.js +56 -0
- package/utils/filters.js +24 -7
- package/utils/{gmaps.js → google/gmaps.js} +43 -10
- package/utils/{google-analytics-eec.js → google/google-analytics-eec.js} +7 -7
- package/babel.config.js +0 -5
- package/components/Account/ChangeEmail.vue +0 -133
- package/components/Account/ChangeName.vue +0 -92
- package/components/Account/ChangePassword.vue +0 -94
- package/components/Account/CreditCards.vue +0 -18
- package/components/Account/Orders.vue +0 -110
- package/components/Account/Settings.vue +0 -18
- package/components/Cart/Delivery/DeliveryAddressGuest.spec.js +0 -128
- package/components/Cart/Delivery/DeliveryTypes.spec.js +0 -83
- package/components/Cart/PCIBadge/SecurityMetrics.vue +0 -11
- package/components/Instagram.vue +0 -49
- package/components/ProductImageModal.vue +0 -41
- package/jest.config.js +0 -16
- package/test/e2e/.babelrc.js +0 -8
- package/test/e2e/.eslintrc.js +0 -11
- package/test/e2e/accAuth.spec.js +0 -64
- package/test/e2e/ageGate.spec.js +0 -26
- package/test/e2e/checkout.spec.js +0 -106
- package/test/e2e/compare.spec.js +0 -52
- package/test/e2e/config/data.js +0 -21
- package/test/e2e/config/routes.js +0 -11
- package/test/e2e/region.spec.js +0 -46
- package/test/e2e/search.spec.js +0 -32
- package/tests/vueBuefy.js +0 -4
- package/tsconfig.json +0 -8
|
@@ -1,39 +1,104 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="related-products">
|
|
3
|
-
<!--div v-if="!showRelated" class="has-text-centered">
|
|
4
|
-
<button class="button" @click="showRelated = true">Load More</button>
|
|
5
|
-
</div-->
|
|
6
|
-
|
|
7
3
|
<div v-if="showRelated" class="columns is-mobile is-multiline">
|
|
8
|
-
<ProductBox
|
|
4
|
+
<ProductBox
|
|
5
|
+
v-for="product in products"
|
|
6
|
+
:key="product.id"
|
|
7
|
+
:product="product"
|
|
8
|
+
grid="column is-2-desktop is-half-mobile"
|
|
9
|
+
/>
|
|
9
10
|
</div>
|
|
10
11
|
</div>
|
|
11
12
|
</template>
|
|
12
13
|
|
|
13
|
-
<script>
|
|
14
|
+
<script setup>
|
|
15
|
+
import { computed, onMounted, ref, watch } from 'vue'
|
|
16
|
+
import { Product } from '../../api'
|
|
17
|
+
import ProductBox from './ProductBox.vue'
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
import ProductBox from './ProductBox'
|
|
19
|
+
defineOptions({ name: 'RelatedProducts' })
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
const props = defineProps({
|
|
22
|
+
productId: {
|
|
23
|
+
type: [Number, String],
|
|
24
|
+
default: null
|
|
25
|
+
},
|
|
26
|
+
relatedIds: {
|
|
27
|
+
type: Array,
|
|
28
|
+
default: () => []
|
|
29
|
+
},
|
|
30
|
+
initialProducts: {
|
|
31
|
+
type: Array,
|
|
32
|
+
default: () => []
|
|
33
|
+
},
|
|
34
|
+
autoLoad: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: true
|
|
37
|
+
}
|
|
38
|
+
})
|
|
20
39
|
|
|
21
|
-
|
|
40
|
+
const products = ref([...(props.initialProducts || [])])
|
|
41
|
+
const showRelated = ref(products.value.length > 0)
|
|
42
|
+
const isLoading = ref(false)
|
|
22
43
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
44
|
+
const resolvedProductId = computed(() => {
|
|
45
|
+
if (props.productId !== null && props.productId !== undefined) {
|
|
46
|
+
return props.productId
|
|
47
|
+
}
|
|
48
|
+
if (typeof window !== 'undefined' && window.wkl_product?.id) {
|
|
49
|
+
return window.wkl_product.id
|
|
50
|
+
}
|
|
51
|
+
return null
|
|
52
|
+
})
|
|
29
53
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
54
|
+
const resolvedRelatedIds = computed(() => {
|
|
55
|
+
if (props.relatedIds && props.relatedIds.length) {
|
|
56
|
+
return props.relatedIds
|
|
57
|
+
}
|
|
58
|
+
if (typeof window !== 'undefined' && Array.isArray(window.wkl_product?.relatedIds)) {
|
|
59
|
+
return window.wkl_product.relatedIds
|
|
60
|
+
}
|
|
61
|
+
return []
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
async function loadRelatedProducts() {
|
|
65
|
+
if (!resolvedProductId.value || isLoading.value) {
|
|
66
|
+
return
|
|
67
|
+
}
|
|
68
|
+
isLoading.value = true
|
|
69
|
+
try {
|
|
70
|
+
const response = await Product.relatedProducts(resolvedProductId.value, {
|
|
71
|
+
relatedIds: resolvedRelatedIds.value
|
|
33
72
|
})
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
73
|
+
const payload = Array.isArray(response?.data?.data) ? response.data.data : []
|
|
74
|
+
products.value = payload
|
|
75
|
+
showRelated.value = products.value.length > 0
|
|
76
|
+
} catch (error) {
|
|
77
|
+
console.error('Failed to load related products', error)
|
|
78
|
+
products.value = []
|
|
79
|
+
showRelated.value = false
|
|
80
|
+
} finally {
|
|
81
|
+
isLoading.value = false
|
|
37
82
|
}
|
|
38
83
|
}
|
|
84
|
+
|
|
85
|
+
onMounted(() => {
|
|
86
|
+
if (props.autoLoad && !products.value.length) {
|
|
87
|
+
loadRelatedProducts()
|
|
88
|
+
} else if (products.value.length) {
|
|
89
|
+
showRelated.value = true
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
watch([resolvedProductId, resolvedRelatedIds], () => {
|
|
94
|
+
if (props.autoLoad) {
|
|
95
|
+
loadRelatedProducts()
|
|
96
|
+
}
|
|
97
|
+
}, { deep: true })
|
|
98
|
+
|
|
99
|
+
watch(() => props.initialProducts, (nextProducts) => {
|
|
100
|
+
const incoming = Array.isArray(nextProducts) ? nextProducts : []
|
|
101
|
+
products.value = [...incoming]
|
|
102
|
+
showRelated.value = products.value.length > 0
|
|
103
|
+
}, { deep: true })
|
|
39
104
|
</script>
|
|
@@ -1,27 +1,46 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<span v-if="
|
|
3
|
-
<span class="sku-label">{{label}}</span>
|
|
4
|
-
<span class="sku-val">{{
|
|
2
|
+
<span v-if="modelValue !== '-' && modelValue !== ''">
|
|
3
|
+
<span class="sku-label">{{ label }}</span>
|
|
4
|
+
<span class="sku-val">{{ modelValue }}</span>
|
|
5
5
|
</span>
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
8
|
<script>
|
|
9
|
+
import { onMounted, onBeforeUnmount } from 'vue'
|
|
10
|
+
import { useBus } from '../../composables/globals'
|
|
11
|
+
|
|
9
12
|
export default {
|
|
10
|
-
name: '
|
|
13
|
+
name: 'SKU',
|
|
14
|
+
|
|
11
15
|
props: {
|
|
12
16
|
label: {
|
|
13
17
|
type: String,
|
|
14
18
|
default: 'SKU:'
|
|
15
19
|
},
|
|
16
|
-
|
|
20
|
+
modelValue: {
|
|
17
21
|
type: [String, Number],
|
|
18
22
|
default: '-'
|
|
19
23
|
}
|
|
20
24
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
|
|
26
|
+
emits: ['update:modelValue'],
|
|
27
|
+
|
|
28
|
+
setup(props, { emit }) {
|
|
29
|
+
const eventBus = useBus()
|
|
30
|
+
|
|
31
|
+
const handleUpdateSKU = (sku) => {
|
|
32
|
+
emit('update:modelValue', sku)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
onMounted(() => {
|
|
36
|
+
eventBus.on('updateSKU', handleUpdateSKU)
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
onBeforeUnmount(() => {
|
|
40
|
+
eventBus.off('updateSKU', handleUpdateSKU)
|
|
24
41
|
})
|
|
42
|
+
|
|
43
|
+
return {}
|
|
25
44
|
}
|
|
26
45
|
}
|
|
27
46
|
</script>
|