@wikala/spmkt 3.0.0-beta.1 → 4.0.0-alpha.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.
- package/README.md +88 -0
- package/dist/analytics/ga4.d.ts +44 -0
- package/dist/analytics/ga4.js +47 -0
- package/dist/analytics/ga4.js.map +1 -0
- package/dist/core/api/account.d.ts +25 -0
- package/dist/core/api/account.js +27 -0
- package/dist/core/api/account.js.map +1 -0
- package/dist/core/api/address.d.ts +10 -0
- package/dist/core/api/address.js +18 -0
- package/dist/core/api/address.js.map +1 -0
- package/dist/core/api/cart.d.ts +43 -0
- package/dist/core/api/cart.js +46 -0
- package/dist/core/api/cart.js.map +1 -0
- package/dist/core/api/checkout.d.ts +90 -0
- package/dist/core/api/checkout.js +75 -0
- package/dist/core/api/checkout.js.map +1 -0
- package/dist/core/api/index.d.ts +12 -0
- package/dist/core/api/location.d.ts +8 -0
- package/dist/core/api/location.js +16 -0
- package/dist/core/api/location.js.map +1 -0
- package/dist/core/api/product.d.ts +13 -0
- package/dist/core/api/product.js +19 -0
- package/dist/core/api/product.js.map +1 -0
- package/dist/core/api/questions.d.ts +3 -0
- package/dist/core/api/questions.js +9 -0
- package/dist/core/api/questions.js.map +1 -0
- package/dist/core/api/reviews.d.ts +17 -0
- package/dist/core/api/reviews.js +30 -0
- package/dist/core/api/reviews.js.map +1 -0
- package/dist/core/api/search.d.ts +3 -0
- package/dist/core/api/search.js +8 -0
- package/dist/core/api/search.js.map +1 -0
- package/dist/core/config.d.ts +16 -0
- package/dist/core/config.js +33 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/cookies.d.ts +5 -0
- package/dist/core/cookies.js +29 -0
- package/dist/core/cookies.js.map +1 -0
- package/dist/core/errors.d.ts +27 -0
- package/dist/core/errors.js +42 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/events.d.ts +137 -0
- package/dist/core/events.js +13 -0
- package/dist/core/events.js.map +1 -0
- package/dist/core/forms.d.ts +17 -0
- package/dist/core/forms.js +70 -0
- package/dist/core/forms.js.map +1 -0
- package/dist/core/i18n.d.ts +26 -0
- package/dist/core/i18n.js +82 -0
- package/dist/core/i18n.js.map +1 -0
- package/dist/core/index.d.ts +22 -0
- package/dist/core/index.js +156 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/money.d.ts +10 -0
- package/dist/core/money.js +30 -0
- package/dist/core/money.js.map +1 -0
- package/dist/core/page-events.d.ts +13 -0
- package/dist/core/page-events.js +76 -0
- package/dist/core/page-events.js.map +1 -0
- package/dist/core/recaptcha.d.ts +17 -0
- package/dist/core/recaptcha.js +44 -0
- package/dist/core/recaptcha.js.map +1 -0
- package/dist/core/request.d.ts +38 -0
- package/dist/core/request.js +170 -0
- package/dist/core/request.js.map +1 -0
- package/dist/core/session.d.ts +7 -0
- package/dist/core/session.js +16 -0
- package/dist/core/session.js.map +1 -0
- package/dist/core/state.d.ts +22 -0
- package/dist/core/state.js +120 -0
- package/dist/core/state.js.map +1 -0
- package/dist/core/stores/cart.d.ts +45 -0
- package/dist/core/stores/cart.js +102 -0
- package/dist/core/stores/cart.js.map +1 -0
- package/dist/core/stores/checkout-draft.d.ts +58 -0
- package/dist/core/stores/checkout-draft.js +67 -0
- package/dist/core/stores/checkout-draft.js.map +1 -0
- package/dist/core/stores/checkout.d.ts +85 -0
- package/dist/core/stores/checkout.js +299 -0
- package/dist/core/stores/checkout.js.map +1 -0
- package/dist/core/stores/compare.d.ts +17 -0
- package/dist/core/stores/compare.js +78 -0
- package/dist/core/stores/compare.js.map +1 -0
- package/dist/core/stores/customer.d.ts +2 -0
- package/dist/core/stores/customer.js +13 -0
- package/dist/core/stores/customer.js.map +1 -0
- package/dist/core/stores/index.d.ts +9 -0
- package/dist/core/stores/location.d.ts +13 -0
- package/dist/core/stores/location.js +32 -0
- package/dist/core/stores/location.js.map +1 -0
- package/dist/core/types.d.ts +251 -0
- package/dist/elements/account-form/account-form.d.ts +33 -0
- package/dist/elements/account-form/account-form.js +42 -0
- package/dist/elements/account-form/account-form.js.map +1 -0
- package/dist/elements/account-form/index.d.ts +3 -0
- package/dist/elements/account-form/index.js +6 -0
- package/dist/elements/account-form/index.js.map +1 -0
- package/dist/elements/add-to-cart/add-to-cart.d.ts +43 -0
- package/dist/elements/add-to-cart/add-to-cart.js +99 -0
- package/dist/elements/add-to-cart/add-to-cart.js.map +1 -0
- package/dist/elements/add-to-cart/index.d.ts +3 -0
- package/dist/elements/add-to-cart/index.js +6 -0
- package/dist/elements/add-to-cart/index.js.map +1 -0
- package/dist/elements/address-autocomplete/address-autocomplete.d.ts +65 -0
- package/dist/elements/address-autocomplete/address-autocomplete.js +124 -0
- package/dist/elements/address-autocomplete/address-autocomplete.js.map +1 -0
- package/dist/elements/address-autocomplete/index.d.ts +3 -0
- package/dist/elements/address-autocomplete/index.js +7 -0
- package/dist/elements/address-autocomplete/index.js.map +1 -0
- package/dist/elements/address-book/address-book.d.ts +61 -0
- package/dist/elements/address-book/address-book.js +184 -0
- package/dist/elements/address-book/address-book.js.map +1 -0
- package/dist/elements/address-book/index.d.ts +3 -0
- package/dist/elements/address-book/index.js +6 -0
- package/dist/elements/address-book/index.js.map +1 -0
- package/dist/elements/age-check/age-check.d.ts +89 -0
- package/dist/elements/age-check/age-check.js +195 -0
- package/dist/elements/age-check/age-check.js.map +1 -0
- package/dist/elements/age-check/index.d.ts +3 -0
- package/dist/elements/age-check/index.js +8 -0
- package/dist/elements/age-check/index.js.map +1 -0
- package/dist/elements/age-gate/age-gate.d.ts +21 -0
- package/dist/elements/age-gate/age-gate.js +24 -0
- package/dist/elements/age-gate/age-gate.js.map +1 -0
- package/dist/elements/age-gate/index.d.ts +3 -0
- package/dist/elements/age-gate/index.js +7 -0
- package/dist/elements/age-gate/index.js.map +1 -0
- package/dist/elements/back-in-stock/back-in-stock.d.ts +61 -0
- package/dist/elements/back-in-stock/back-in-stock.js +101 -0
- package/dist/elements/back-in-stock/back-in-stock.js.map +1 -0
- package/dist/elements/back-in-stock/index.d.ts +3 -0
- package/dist/elements/back-in-stock/index.js +6 -0
- package/dist/elements/back-in-stock/index.js.map +1 -0
- package/dist/elements/carousel/carousel.d.ts +51 -0
- package/dist/elements/carousel/carousel.js +133 -0
- package/dist/elements/carousel/carousel.js.map +1 -0
- package/dist/elements/carousel/index.d.ts +3 -0
- package/dist/elements/carousel/index.js +6 -0
- package/dist/elements/carousel/index.js.map +1 -0
- package/dist/elements/cart/cart.d.ts +50 -0
- package/dist/elements/cart/cart.js +153 -0
- package/dist/elements/cart/cart.js.map +1 -0
- package/dist/elements/cart/index.d.ts +3 -0
- package/dist/elements/cart/index.js +6 -0
- package/dist/elements/cart/index.js.map +1 -0
- package/dist/elements/cart-count/cart-count.d.ts +16 -0
- package/dist/elements/cart-count/cart-count.js +32 -0
- package/dist/elements/cart-count/cart-count.js.map +1 -0
- package/dist/elements/cart-count/index.d.ts +3 -0
- package/dist/elements/cart-count/index.js +6 -0
- package/dist/elements/cart-count/index.js.map +1 -0
- package/dist/elements/checkout/checkout.d.ts +65 -0
- package/dist/elements/checkout/checkout.js +144 -0
- package/dist/elements/checkout/checkout.js.map +1 -0
- package/dist/elements/checkout/index.d.ts +3 -0
- package/dist/elements/checkout/index.js +6 -0
- package/dist/elements/checkout/index.js.map +1 -0
- package/dist/elements/checkout-address/checkout-address.d.ts +41 -0
- package/dist/elements/checkout-address/checkout-address.js +105 -0
- package/dist/elements/checkout-address/checkout-address.js.map +1 -0
- package/dist/elements/checkout-address/index.d.ts +3 -0
- package/dist/elements/checkout-address/index.js +6 -0
- package/dist/elements/checkout-address/index.js.map +1 -0
- package/dist/elements/checkout-delivery/checkout-delivery.d.ts +75 -0
- package/dist/elements/checkout-delivery/checkout-delivery.js +293 -0
- package/dist/elements/checkout-delivery/checkout-delivery.js.map +1 -0
- package/dist/elements/checkout-delivery/index.d.ts +3 -0
- package/dist/elements/checkout-delivery/index.js +6 -0
- package/dist/elements/checkout-delivery/index.js.map +1 -0
- package/dist/elements/checkout-identity/checkout-identity.d.ts +34 -0
- package/dist/elements/checkout-identity/checkout-identity.js +49 -0
- package/dist/elements/checkout-identity/checkout-identity.js.map +1 -0
- package/dist/elements/checkout-identity/index.d.ts +3 -0
- package/dist/elements/checkout-identity/index.js +6 -0
- package/dist/elements/checkout-identity/index.js.map +1 -0
- package/dist/elements/checkout-payment/checkout-payment.d.ts +74 -0
- package/dist/elements/checkout-payment/checkout-payment.js +286 -0
- package/dist/elements/checkout-payment/checkout-payment.js.map +1 -0
- package/dist/elements/checkout-payment/index.d.ts +3 -0
- package/dist/elements/checkout-payment/index.js +6 -0
- package/dist/elements/checkout-payment/index.js.map +1 -0
- package/dist/elements/collection/collection.d.ts +66 -0
- package/dist/elements/collection/collection.js +179 -0
- package/dist/elements/collection/collection.js.map +1 -0
- package/dist/elements/collection/index.d.ts +3 -0
- package/dist/elements/collection/index.js +6 -0
- package/dist/elements/collection/index.js.map +1 -0
- package/dist/elements/combobox/combobox.d.ts +54 -0
- package/dist/elements/combobox/combobox.js +178 -0
- package/dist/elements/combobox/combobox.js.map +1 -0
- package/dist/elements/combobox/index.d.ts +2 -0
- package/dist/elements/combobox/index.js +5 -0
- package/dist/elements/combobox/index.js.map +1 -0
- package/dist/elements/compare-bar/compare-bar.d.ts +21 -0
- package/dist/elements/compare-bar/compare-bar.js +34 -0
- package/dist/elements/compare-bar/compare-bar.js.map +1 -0
- package/dist/elements/compare-bar/index.d.ts +3 -0
- package/dist/elements/compare-bar/index.js +6 -0
- package/dist/elements/compare-bar/index.js.map +1 -0
- package/dist/elements/compare-remove/compare-remove.d.ts +20 -0
- package/dist/elements/compare-remove/compare-remove.js +19 -0
- package/dist/elements/compare-remove/compare-remove.js.map +1 -0
- package/dist/elements/compare-remove/index.d.ts +3 -0
- package/dist/elements/compare-remove/index.js +6 -0
- package/dist/elements/compare-remove/index.js.map +1 -0
- package/dist/elements/compare-toggle/compare-toggle.d.ts +39 -0
- package/dist/elements/compare-toggle/compare-toggle.js +53 -0
- package/dist/elements/compare-toggle/compare-toggle.js.map +1 -0
- package/dist/elements/compare-toggle/index.d.ts +3 -0
- package/dist/elements/compare-toggle/index.js +6 -0
- package/dist/elements/compare-toggle/index.js.map +1 -0
- package/dist/elements/dialog/dialog.d.ts +23 -0
- package/dist/elements/dialog/dialog.js +61 -0
- package/dist/elements/dialog/dialog.js.map +1 -0
- package/dist/elements/dialog/index.d.ts +3 -0
- package/dist/elements/dialog/index.js +6 -0
- package/dist/elements/dialog/index.js.map +1 -0
- package/dist/elements/location-picker/index.d.ts +3 -0
- package/dist/elements/location-picker/index.js +6 -0
- package/dist/elements/location-picker/index.js.map +1 -0
- package/dist/elements/location-picker/location-picker.d.ts +28 -0
- package/dist/elements/location-picker/location-picker.js +88 -0
- package/dist/elements/location-picker/location-picker.js.map +1 -0
- package/dist/elements/mini-cart/index.d.ts +3 -0
- package/dist/elements/mini-cart/index.js +6 -0
- package/dist/elements/mini-cart/index.js.map +1 -0
- package/dist/elements/mini-cart/mini-cart.d.ts +29 -0
- package/dist/elements/mini-cart/mini-cart.js +102 -0
- package/dist/elements/mini-cart/mini-cart.js.map +1 -0
- package/dist/elements/mobile-nav/index.d.ts +3 -0
- package/dist/elements/mobile-nav/index.js +6 -0
- package/dist/elements/mobile-nav/index.js.map +1 -0
- package/dist/elements/mobile-nav/mobile-nav.d.ts +20 -0
- package/dist/elements/mobile-nav/mobile-nav.js +29 -0
- package/dist/elements/mobile-nav/mobile-nav.js.map +1 -0
- package/dist/elements/product-gallery/index.d.ts +3 -0
- package/dist/elements/product-gallery/index.js +6 -0
- package/dist/elements/product-gallery/index.js.map +1 -0
- package/dist/elements/product-gallery/product-gallery.d.ts +49 -0
- package/dist/elements/product-gallery/product-gallery.js +143 -0
- package/dist/elements/product-gallery/product-gallery.js.map +1 -0
- package/dist/elements/quantity/index.d.ts +3 -0
- package/dist/elements/quantity/index.js +6 -0
- package/dist/elements/quantity/index.js.map +1 -0
- package/dist/elements/quantity/quantity.d.ts +21 -0
- package/dist/elements/quantity/quantity.js +57 -0
- package/dist/elements/quantity/quantity.js.map +1 -0
- package/dist/elements/questions/index.d.ts +3 -0
- package/dist/elements/questions/index.js +6 -0
- package/dist/elements/questions/index.js.map +1 -0
- package/dist/elements/questions/questions.d.ts +28 -0
- package/dist/elements/questions/questions.js +65 -0
- package/dist/elements/questions/questions.js.map +1 -0
- package/dist/elements/quick-view/index.d.ts +2 -0
- package/dist/elements/quick-view/index.js +6 -0
- package/dist/elements/quick-view/index.js.map +1 -0
- package/dist/elements/quick-view/quick-view.d.ts +26 -0
- package/dist/elements/quick-view/quick-view.js +70 -0
- package/dist/elements/quick-view/quick-view.js.map +1 -0
- package/dist/elements/range/index.d.ts +3 -0
- package/dist/elements/range/index.js +6 -0
- package/dist/elements/range/index.js.map +1 -0
- package/dist/elements/range/range.d.ts +24 -0
- package/dist/elements/range/range.js +37 -0
- package/dist/elements/range/range.js.map +1 -0
- package/dist/elements/related/index.d.ts +3 -0
- package/dist/elements/related/index.js +6 -0
- package/dist/elements/related/index.js.map +1 -0
- package/dist/elements/related/related.d.ts +33 -0
- package/dist/elements/related/related.js +66 -0
- package/dist/elements/related/related.js.map +1 -0
- package/dist/elements/review-form/index.d.ts +3 -0
- package/dist/elements/review-form/index.js +6 -0
- package/dist/elements/review-form/index.js.map +1 -0
- package/dist/elements/review-form/review-form.d.ts +60 -0
- package/dist/elements/review-form/review-form.js +158 -0
- package/dist/elements/review-form/review-form.js.map +1 -0
- package/dist/elements/reviews/index.d.ts +3 -0
- package/dist/elements/reviews/index.js +6 -0
- package/dist/elements/reviews/index.js.map +1 -0
- package/dist/elements/reviews/reviews.d.ts +19 -0
- package/dist/elements/reviews/reviews.js +30 -0
- package/dist/elements/reviews/reviews.js.map +1 -0
- package/dist/elements/search/index.d.ts +3 -0
- package/dist/elements/search/index.js +6 -0
- package/dist/elements/search/index.js.map +1 -0
- package/dist/elements/search/search.d.ts +20 -0
- package/dist/elements/search/search.js +53 -0
- package/dist/elements/search/search.js.map +1 -0
- package/dist/elements/shared/folding-form.d.ts +15 -0
- package/dist/elements/shared/folding-form.js +35 -0
- package/dist/elements/shared/folding-form.js.map +1 -0
- package/dist/elements/shared/google-maps.d.ts +100 -0
- package/dist/elements/shared/google-maps.js +34 -0
- package/dist/elements/shared/google-maps.js.map +1 -0
- package/dist/elements/shared/json-form.d.ts +28 -0
- package/dist/elements/shared/json-form.js +85 -0
- package/dist/elements/shared/json-form.js.map +1 -0
- package/dist/elements/shared/paged-section.d.ts +28 -0
- package/dist/elements/shared/paged-section.js +93 -0
- package/dist/elements/shared/paged-section.js.map +1 -0
- package/dist/elements/shared/phone-mask.d.ts +9 -0
- package/dist/elements/shared/phone-mask.js +38 -0
- package/dist/elements/shared/phone-mask.js.map +1 -0
- package/dist/elements/shared/select-item.d.ts +7 -0
- package/dist/elements/shared/select-item.js +19 -0
- package/dist/elements/shared/select-item.js.map +1 -0
- package/dist/elements/store-availability/index.d.ts +3 -0
- package/dist/elements/store-availability/index.js +6 -0
- package/dist/elements/store-availability/index.js.map +1 -0
- package/dist/elements/store-availability/store-availability.d.ts +26 -0
- package/dist/elements/store-availability/store-availability.js +66 -0
- package/dist/elements/store-availability/store-availability.js.map +1 -0
- package/dist/elements/store-map/index.d.ts +4 -0
- package/dist/elements/store-map/index.js +8 -0
- package/dist/elements/store-map/index.js.map +1 -0
- package/dist/elements/store-map/store-map.d.ts +59 -0
- package/dist/elements/store-map/store-map.js +118 -0
- package/dist/elements/store-map/store-map.js.map +1 -0
- package/dist/elements/tabs/index.d.ts +3 -0
- package/dist/elements/tabs/index.js +6 -0
- package/dist/elements/tabs/index.js.map +1 -0
- package/dist/elements/tabs/tabs.d.ts +21 -0
- package/dist/elements/tabs/tabs.js +69 -0
- package/dist/elements/tabs/tabs.js.map +1 -0
- package/dist/elements/toaster/index.d.ts +3 -0
- package/dist/elements/toaster/index.js +7 -0
- package/dist/elements/toaster/index.js.map +1 -0
- package/dist/elements/toaster/toaster.d.ts +47 -0
- package/dist/elements/toaster/toaster.js +109 -0
- package/dist/elements/toaster/toaster.js.map +1 -0
- package/dist/elements/variant-picker/index.d.ts +3 -0
- package/dist/elements/variant-picker/index.js +6 -0
- package/dist/elements/variant-picker/index.js.map +1 -0
- package/dist/elements/variant-picker/variant-picker.d.ts +28 -0
- package/dist/elements/variant-picker/variant-picker.js +83 -0
- package/dist/elements/variant-picker/variant-picker.js.map +1 -0
- package/dist/elements/vote/index.d.ts +3 -0
- package/dist/elements/vote/index.js +6 -0
- package/dist/elements/vote/index.js.map +1 -0
- package/dist/elements/vote/vote.d.ts +33 -0
- package/dist/elements/vote/vote.js +72 -0
- package/dist/elements/vote/vote.js.map +1 -0
- package/dist/lit/forms.d.ts +8 -0
- package/dist/lit/forms.js +42 -0
- package/dist/lit/forms.js.map +1 -0
- package/dist/lit/fragments.d.ts +28 -0
- package/dist/lit/fragments.js +74 -0
- package/dist/lit/fragments.js.map +1 -0
- package/dist/lit/index.d.ts +7 -0
- package/dist/lit/index.js +21 -0
- package/dist/lit/index.js.map +1 -0
- package/dist/lit/lazy-define.d.ts +35 -0
- package/dist/lit/lazy-define.js +103 -0
- package/dist/lit/lazy-define.js.map +1 -0
- package/dist/lit/signal-controller.d.ts +19 -0
- package/dist/lit/signal-controller.js +30 -0
- package/dist/lit/signal-controller.js.map +1 -0
- package/dist/lit/spmkt-element.d.ts +40 -0
- package/dist/lit/spmkt-element.js +76 -0
- package/dist/lit/spmkt-element.js.map +1 -0
- package/dist/locales/en.json +125 -0
- package/dist/locales/sr.json +130 -0
- package/package.json +45 -55
- package/MIGRATION_GUIDE.md +0 -310
- package/api/address.js +0 -115
- package/api/affiliate.js +0 -12
- package/api/cart.js +0 -81
- package/api/compare.js +0 -47
- package/api/countries.js +0 -13
- package/api/order.js +0 -27
- package/api/product-questions.js +0 -36
- package/api/product-reviews.js +0 -35
- package/api/product.js +0 -59
- package/api/request.js +0 -118
- package/api/user.js +0 -71
- package/api.js +0 -26
- package/components/Account/AccountDashboard.vue +0 -136
- package/components/Account/AccountStore.js +0 -97
- package/components/Account/AffiliateReport.vue +0 -98
- package/components/Account/Orders/OrderDetail.vue +0 -169
- package/components/Account/Orders/Orders.vue +0 -124
- package/components/Account/Settings/AccountSettings.vue +0 -45
- package/components/Account/Settings/ChangeEmail.vue +0 -136
- package/components/Account/Settings/ChangeName.vue +0 -82
- package/components/Account/Settings/ChangePassword.vue +0 -91
- package/components/Address/Address.vue +0 -141
- package/components/Address/AddressBook.vue +0 -171
- package/components/Address/AddressSelect.vue +0 -203
- package/components/Address/Edit.vue +0 -527
- package/components/Address/PostalCode.vue +0 -67
- package/components/Address/address.schema.js +0 -84
- package/components/AgeGate.vue +0 -109
- package/components/Auth/Login.vue +0 -191
- package/components/Auth/Register.vue +0 -240
- package/components/Auth/ResetPassword.vue +0 -108
- package/components/Cart/AgeVerification/AgeChecker.vue +0 -141
- package/components/Cart/CartBadge.vue +0 -68
- package/components/Cart/CartBox.vue +0 -139
- package/components/Cart/CartItem.vue +0 -126
- package/components/Cart/CartMode.vue +0 -200
- package/components/Cart/CartPreview.vue +0 -166
- package/components/Cart/CartSummary.vue +0 -107
- package/components/Cart/Coupon.vue +0 -107
- package/components/Cart/CreditCard/Everyware.vue +0 -262
- package/components/Cart/CreditCard/ExtendedCreditCard.vue +0 -240
- package/components/Cart/CreditCard/SquarePay.vue +0 -296
- package/components/Cart/CreditCard/StandardCreditCard.vue +0 -241
- package/components/Cart/Delivery/Delivery.vue +0 -364
- package/components/Cart/Delivery/DeliveryAddress.vue +0 -195
- package/components/Cart/Delivery/DeliveryAddressGuest.vue +0 -204
- package/components/Cart/Delivery/DeliveryMethods.vue +0 -109
- package/components/Cart/Delivery/DeliveryOptions.vue +0 -171
- package/components/Cart/Delivery/DeliveryTypes.vue +0 -61
- package/components/Cart/Delivery/DeliveryWarning.vue +0 -14
- package/components/Cart/Delivery/ReservationSlots.vue +0 -88
- package/components/Cart/Delivery/reservation.schema.js +0 -35
- package/components/Cart/Disclaimer.vue +0 -56
- package/components/Cart/OrderConfirmation.vue +0 -187
- package/components/Cart/Payment/Payment.vue +0 -436
- package/components/Cart/Payment/PaymentMethods.vue +0 -59
- package/components/Cart/ReviewAndSubmit.vue +0 -159
- package/components/Cart/ShoppingCart.vue +0 -219
- package/components/Cart/Store/actions.js +0 -129
- package/components/Cart/Store/getters.js +0 -80
- package/components/Cart/Store/index.js +0 -14
- package/components/Cart/Store/mutations.js +0 -172
- package/components/Cart/Store/state.js +0 -80
- package/components/Cart/UserIdentity.vue +0 -178
- package/components/Category/CategoryFilter.vue +0 -330
- package/components/Category/CategorySort.vue +0 -77
- package/components/Category/FilterMixin.js +0 -70
- package/components/Category/LoadMore.vue +0 -98
- package/components/DeliverTo.vue +0 -51
- package/components/DeliveryNotice.vue +0 -123
- package/components/DobInput.vue +0 -294
- package/components/Gmaps/GmapsAutocomplete.vue +0 -166
- package/components/Gmaps/GmapsLocations.vue +0 -233
- package/components/Gmaps/GmapsSingleLocation.vue +0 -134
- package/components/MobileMenu/MobileMenu.vue +0 -224
- package/components/MobileMenu/components/MenuBurger.vue +0 -23
- package/components/MobileMenu/components/MenuPanel.vue +0 -80
- package/components/MobileMenu/components/MenuShadow.vue +0 -21
- package/components/MobileMenu/demo-data.js +0 -97
- package/components/MobileMenu/icons/LeftArrowIcon.vue +0 -25
- package/components/MobileMenu/icons/MenuIcon.vue +0 -27
- package/components/MobileMenu/icons/RightArrowIcon.vue +0 -25
- package/components/MobileMenu/index.js +0 -8
- package/components/MobileMenu/mixins/contentControl.mixin.js +0 -46
- package/components/MobileMenu/mixins/functionalityStyle.mixin.js +0 -59
- package/components/MobileMenu/mixins/panelControl.mixin.js +0 -51
- package/components/ModalContainer/ModalContainer.vue +0 -212
- package/components/ModalContainer/index.js +0 -103
- package/components/Oembed.vue +0 -46
- package/components/Product/AddToCart.vue +0 -284
- package/components/Product/BoxAddToCart.vue +0 -177
- package/components/Product/Compare.vue +0 -150
- package/components/Product/CompareBox.vue +0 -162
- package/components/Product/Lookup.vue +0 -132
- package/components/Product/Photo.vue +0 -115
- package/components/Product/Price.vue +0 -106
- package/components/Product/ProductAutocomplete.vue +0 -103
- package/components/Product/ProductBox.vue +0 -88
- package/components/Product/ProductImages.vue +0 -137
- package/components/Product/Quantity.vue +0 -126
- package/components/Product/QuickView.vue +0 -145
- package/components/Product/RelatedProducts.vue +0 -104
- package/components/Product/SKU.vue +0 -46
- package/components/Product/Variants.vue +0 -399
- package/components/Product/reviews-questions/ProductQuestions.vue +0 -319
- package/components/Product/reviews-questions/ProductReviews.vue +0 -182
- package/components/Product/reviews-questions/Review.vue +0 -126
- package/components/Product/reviews-questions/ReviewForm.vue +0 -313
- package/components/Product/reviews-questions/ReviewImages.vue +0 -229
- package/components/Product/reviews-questions/Vote.vue +0 -104
- package/components/QuantityInput.vue +0 -111
- package/components/RangeInput.vue +0 -141
- package/components/Recaptcha.vue +0 -104
- package/components/SelectShippingCountry.vue +0 -115
- package/components/TimedOffer.vue +0 -84
- package/composables/globals.js +0 -53
- package/config.js +0 -21
- package/index.js +0 -182
- package/install.js +0 -88
- package/locales/en.json +0 -288
- package/locales/sr.json +0 -288
- package/translations.js +0 -4
- package/utils/animate.css +0 -50
- package/utils/animate.js +0 -23
- package/utils/buefy.js +0 -62
- package/utils/custom-event-bus.js +0 -13
- package/utils/directives.js +0 -79
- package/utils/event-bus.js +0 -56
- package/utils/filters.js +0 -110
- package/utils/format-date.js +0 -17
- package/utils/google/gmaps.js +0 -269
- package/utils/google/google-analytics-eec.js +0 -108
- package/utils/native-dom.js +0 -27
- package/utils/objects.js +0 -19
- package/utils/random-id.js +0 -10
- package/utils/rc-token.js +0 -24
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<b-modal :can-cancel="true" v-model="showModal" @close="close" custom-class="wkl-modal-container quick-view-modal">
|
|
4
|
-
<div
|
|
5
|
-
ref="qvModal"
|
|
6
|
-
:class="['quick-view-main', 'product-main', 'product-container', { 'is-flower': product.class === 'flower' }]"
|
|
7
|
-
style="background: #fff; min-width: 960px; min-height: 400px; padding: 2rem"
|
|
8
|
-
>
|
|
9
|
-
<div class="product-head">
|
|
10
|
-
<div
|
|
11
|
-
v-if="meta.strain_classification"
|
|
12
|
-
class="product-flavor"
|
|
13
|
-
:style="{ backgroundColor: initialState.strain_classification_colors[meta.strain_classification] }"
|
|
14
|
-
>
|
|
15
|
-
{{ meta.strain_classification }}
|
|
16
|
-
</div>
|
|
17
|
-
<div class="product-title">
|
|
18
|
-
<h1>{{ product.name }}</h1>
|
|
19
|
-
</div>
|
|
20
|
-
<div v-if="product.brand && product.brand.name" class="product-brand has-text-grey product-price">
|
|
21
|
-
{{ $t('product.by') }} <a class="ml-1 has-text-grey" :href="'/brands/' + product.brand.slug">{{ product.brand.name }}</a>
|
|
22
|
-
<template v-if="product.type === 'virtual' || product.type === 'variant'">
|
|
23
|
-
<div v-if="product.in_stock" class="status-container in-stock-container">
|
|
24
|
-
<i class="fas fa-cart-plus"></i>
|
|
25
|
-
<p>{{ $t('product.inStock') }}</p>
|
|
26
|
-
</div>
|
|
27
|
-
<div v-else-if="product.available_elsewhere" class="status-container available-elsewhere-container">
|
|
28
|
-
<i class="fas fa-exclamation-circle"></i>
|
|
29
|
-
<p>{{ $t('product.notAvailableInSelectedStore') }}</p>
|
|
30
|
-
</div>
|
|
31
|
-
<div v-else class="status-container sold-out-container">
|
|
32
|
-
<i class="fas fa-exclamation-circle"></i>
|
|
33
|
-
<p>{{ $t('product.outOfStock') }}</p>
|
|
34
|
-
</div>
|
|
35
|
-
</template>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
<div class="product-details has-text-grey mt-4">
|
|
39
|
-
<span v-if="meta.thc_min || meta.thc_max">THC {{ meta.thc_min }}-{{ meta.thc_max }}{{ meta.measurement_unit }}</span>
|
|
40
|
-
<span class="ml-3" v-if="meta.cbd_min || meta.cbd_max">CBD {{ meta.cbd_min }}-{{ meta.cbd_max }}{{ meta.measurement_unit }}</span>
|
|
41
|
-
</div>
|
|
42
|
-
|
|
43
|
-
<div v-if="product.type === 'virtual' || product.type === 'variant'">
|
|
44
|
-
<Variants :product="product" :variant-id="variant_id" :render="product.class === 'flower' ? 'pricetags' : 'tags'" />
|
|
45
|
-
</div>
|
|
46
|
-
<div v-if="product.id && product.type !== 'virtual' && product.type !== 'variant'" class="product-price">
|
|
47
|
-
<price v-if="product.price_range" :compare-value="product.price_range" :value="product.price_coupon_applied"></price>
|
|
48
|
-
<price v-else :compare-value="product.compare_price" :value="product.price"></price>
|
|
49
|
-
|
|
50
|
-
<div v-if="product.in_stock" class="status-container in-stock-container">
|
|
51
|
-
<i class="fas fa-cart-plus"></i>
|
|
52
|
-
<p>{{ $t('product.inStock') }}</p>
|
|
53
|
-
</div>
|
|
54
|
-
<div v-else-if="product.available_elsewhere" class="status-container available-elsewhere-container">
|
|
55
|
-
<i class="fas fa-exclamation-circle"></i>
|
|
56
|
-
<p>{{ $t('product.notAvailableInSelectedStore') }}</p>
|
|
57
|
-
</div>
|
|
58
|
-
<div v-else class="status-container sold-out-container">
|
|
59
|
-
<i class="fas fa-exclamation-circle"></i>
|
|
60
|
-
<p>{{ $t('product.outOfStock') }}</p>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
|
|
65
|
-
<div class="product-options">
|
|
66
|
-
<add-to-cart
|
|
67
|
-
:quantity-enabled="true"
|
|
68
|
-
:buy-now-enabled="false"
|
|
69
|
-
:in-stock="product.in_stock"
|
|
70
|
-
:product="product"
|
|
71
|
-
:key="product.id"
|
|
72
|
-
@success="showModal = false"
|
|
73
|
-
></add-to-cart>
|
|
74
|
-
<div>
|
|
75
|
-
<a class="button see-details" :href="'/' + product.slug">See details</a>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
|
|
79
|
-
<ProductImages v-if="product.id" :product="product"></ProductImages>
|
|
80
|
-
</div>
|
|
81
|
-
<b-loading :is-full-page="false" v-model="isLoading" :can-cancel="true"></b-loading>
|
|
82
|
-
</b-modal>
|
|
83
|
-
<add-to-cart :headless="true" :product="product" @update="product = $event"></add-to-cart>
|
|
84
|
-
</div>
|
|
85
|
-
</template>
|
|
86
|
-
|
|
87
|
-
<script setup>
|
|
88
|
-
import { ref, onMounted, onBeforeUnmount } from 'vue'
|
|
89
|
-
import { useInitialState } from '../../composables/globals'
|
|
90
|
-
import config from '../../config'
|
|
91
|
-
import { request } from '../../api'
|
|
92
|
-
import { eventBus } from '../../utils/event-bus'
|
|
93
|
-
|
|
94
|
-
import AddToCart from './AddToCart.vue'
|
|
95
|
-
import Price from './Price.vue'
|
|
96
|
-
import ProductImages from './ProductImages.vue'
|
|
97
|
-
import Variants from './Variants.vue'
|
|
98
|
-
|
|
99
|
-
defineOptions({ name: 'QuickView' })
|
|
100
|
-
|
|
101
|
-
const initialState = useInitialState()
|
|
102
|
-
|
|
103
|
-
// Template refs
|
|
104
|
-
const qvModal = ref(null)
|
|
105
|
-
|
|
106
|
-
// Reactive state
|
|
107
|
-
const showModal = ref(false)
|
|
108
|
-
const isLoading = ref(false)
|
|
109
|
-
const product = ref({})
|
|
110
|
-
const variant_id = ref(null)
|
|
111
|
-
const meta = ref({})
|
|
112
|
-
|
|
113
|
-
// Methods
|
|
114
|
-
const close = () => {
|
|
115
|
-
product.value = {}
|
|
116
|
-
meta.value = {}
|
|
117
|
-
showModal.value = false
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
const handleQuickView = async (product_id, vid) => {
|
|
121
|
-
showModal.value = true
|
|
122
|
-
isLoading.value = true
|
|
123
|
-
if (vid) {
|
|
124
|
-
variant_id.value = vid
|
|
125
|
-
}
|
|
126
|
-
let resp = await request({
|
|
127
|
-
baseURL: config.BASE_URL,
|
|
128
|
-
url: '/products/' + product_id
|
|
129
|
-
})
|
|
130
|
-
isLoading.value = false
|
|
131
|
-
product.value = resp.data.product_resource
|
|
132
|
-
meta.value = resp.data.meta
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// Lifecycle hooks
|
|
136
|
-
onMounted(() => {
|
|
137
|
-
eventBus.on('quickView', handleQuickView)
|
|
138
|
-
})
|
|
139
|
-
|
|
140
|
-
onBeforeUnmount(() => {
|
|
141
|
-
eventBus.off('quickView', handleQuickView)
|
|
142
|
-
})
|
|
143
|
-
</script>
|
|
144
|
-
|
|
145
|
-
<style scoped></style>
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="related-products">
|
|
3
|
-
<div v-if="showRelated" class="columns is-mobile is-multiline">
|
|
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
|
-
/>
|
|
10
|
-
</div>
|
|
11
|
-
</div>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script setup>
|
|
15
|
-
import { computed, onMounted, ref, watch } from 'vue'
|
|
16
|
-
import { Product } from '../../api'
|
|
17
|
-
import ProductBox from './ProductBox.vue'
|
|
18
|
-
|
|
19
|
-
defineOptions({ name: 'RelatedProducts' })
|
|
20
|
-
|
|
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
|
-
})
|
|
39
|
-
|
|
40
|
-
const products = ref([...(props.initialProducts || [])])
|
|
41
|
-
const showRelated = ref(products.value.length > 0)
|
|
42
|
-
const isLoading = ref(false)
|
|
43
|
-
|
|
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
|
-
})
|
|
53
|
-
|
|
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
|
|
72
|
-
})
|
|
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
|
|
82
|
-
}
|
|
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 })
|
|
104
|
-
</script>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<span v-if="modelValue !== '-' && modelValue !== ''">
|
|
3
|
-
<span class="sku-label">{{ label }}</span>
|
|
4
|
-
<span class="sku-val">{{ modelValue }}</span>
|
|
5
|
-
</span>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script>
|
|
9
|
-
import { onMounted, onBeforeUnmount } from 'vue'
|
|
10
|
-
import { useBus } from '../../composables/globals'
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
name: 'SKU',
|
|
14
|
-
|
|
15
|
-
props: {
|
|
16
|
-
label: {
|
|
17
|
-
type: String,
|
|
18
|
-
default: 'SKU:'
|
|
19
|
-
},
|
|
20
|
-
modelValue: {
|
|
21
|
-
type: [String, Number],
|
|
22
|
-
default: '-'
|
|
23
|
-
}
|
|
24
|
-
},
|
|
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)
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
return {}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
</script>
|
|
@@ -1,399 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div v-if="productVariantOptions.length > 0" :class="['wkl-pp-variants', { highlight: highlight }]">
|
|
3
|
-
<div v-if="highlight" class="choose-variants">
|
|
4
|
-
<strong :class="{ 'has-text-danger': highlight }">{{ $t('product.chooseProductOptions') }}</strong>
|
|
5
|
-
</div>
|
|
6
|
-
<div class="variant-options">
|
|
7
|
-
<div v-for="vOption in productVariantOptions" :key="vOption.id" class="variant-option">
|
|
8
|
-
<div v-if="render !== 'pricetags'" class="voption-name">
|
|
9
|
-
{{ vOption.name }}
|
|
10
|
-
<span></span>
|
|
11
|
-
</div>
|
|
12
|
-
<div class="voption-values">
|
|
13
|
-
<div
|
|
14
|
-
v-for="(optionValue, index) in vOption.values"
|
|
15
|
-
v-show="render !== 'pricetags' || (vOption.prices && vOption.prices[optionValue] > 0)"
|
|
16
|
-
:key="index"
|
|
17
|
-
:class="['voption-value', 'is-flex', 'is-flex-direction-column', 'button', 'is-small', { 'pricetag': render === 'pricetags'}, { 'is-active': selectedOptions[vOption.id] === optionValue }]"
|
|
18
|
-
:disabled="isOptionDisabled(vOption.id + '-' + optionValue) || undefined"
|
|
19
|
-
@click="optionSelect(optionValue, vOption)"
|
|
20
|
-
>
|
|
21
|
-
<div>{{ optionValue }}<template v-if="render === 'pricetags'">{{ vOption.measurement_unit }}</template></div>
|
|
22
|
-
<div v-if="render === 'pricetags'">
|
|
23
|
-
<template v-if="getVariantByOption(vOption.id, optionValue).price">
|
|
24
|
-
<span class="price-old" v-if="getVariantByOption(vOption.id, optionValue).compare_price > 0 && getVariantByOption(vOption.id, optionValue).price !== getVariantByOption(vOption.id, optionValue).compare_price">{{ $filters.formatMoney(getVariantByOption(vOption.id, optionValue).compare_price) }}</span>
|
|
25
|
-
<span class="price">{{ $filters.formatMoney(getVariantByOption(vOption.id, optionValue).price) }}</span>
|
|
26
|
-
</template>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
</template>
|
|
34
|
-
|
|
35
|
-
<script setup>
|
|
36
|
-
import { ref, reactive, computed, watch, onMounted, onBeforeUnmount, nextTick } from 'vue'
|
|
37
|
-
import { formatMoney } from '../../utils/filters'
|
|
38
|
-
import { useBus } from '../../composables/globals'
|
|
39
|
-
import _ from 'underscore'
|
|
40
|
-
import formatDate from '../../utils/format-date'
|
|
41
|
-
|
|
42
|
-
const props = defineProps({
|
|
43
|
-
product: {
|
|
44
|
-
type: Object,
|
|
45
|
-
default: () => ({})
|
|
46
|
-
},
|
|
47
|
-
render: {
|
|
48
|
-
type: String,
|
|
49
|
-
default: 'tags'
|
|
50
|
-
},
|
|
51
|
-
variantId: {
|
|
52
|
-
type: Number
|
|
53
|
-
},
|
|
54
|
-
badgeSelector: {
|
|
55
|
-
type: String,
|
|
56
|
-
default: '.product-in-stock .discount.badge'
|
|
57
|
-
},
|
|
58
|
-
overridePriceNotificationSelector: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: '.override-price-active'
|
|
61
|
-
},
|
|
62
|
-
discountInfoSelector: {
|
|
63
|
-
type: String,
|
|
64
|
-
default: '.discount-notice'
|
|
65
|
-
}
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
const emit = defineEmits(['update'])
|
|
69
|
-
|
|
70
|
-
const $bus = useBus()
|
|
71
|
-
|
|
72
|
-
// Reactive state
|
|
73
|
-
const selectedVariant = ref(null)
|
|
74
|
-
const selectedOptions = reactive({})
|
|
75
|
-
const productVariantOptions = ref([])
|
|
76
|
-
const productVariants = ref([])
|
|
77
|
-
const optionCombinations = ref([])
|
|
78
|
-
const fittingUnselected = ref([])
|
|
79
|
-
const highlight = ref(false)
|
|
80
|
-
|
|
81
|
-
// Computed
|
|
82
|
-
const selectedEntries = computed(() => {
|
|
83
|
-
return Object.entries(selectedOptions)
|
|
84
|
-
.map((so) => so[0] + '-' + so[1])
|
|
85
|
-
.sort()
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
// Watch
|
|
89
|
-
watch(() => props.product, (val) => {
|
|
90
|
-
if (val && val.variant_options) {
|
|
91
|
-
productVariantOptions.value = val.variant_options
|
|
92
|
-
productVariants.value = val.variants
|
|
93
|
-
setOptionCombinations()
|
|
94
|
-
}
|
|
95
|
-
}, { deep: true })
|
|
96
|
-
|
|
97
|
-
// Methods
|
|
98
|
-
function setOptionCombinations() {
|
|
99
|
-
optionCombinations.value = []
|
|
100
|
-
let allOptions = _.pluck(productVariants.value, 'options')
|
|
101
|
-
allOptions.forEach((options) => {
|
|
102
|
-
let v = []
|
|
103
|
-
options.forEach((o) => {
|
|
104
|
-
v.push(o.attribute_id + '-' + o.value)
|
|
105
|
-
})
|
|
106
|
-
optionCombinations.value.push(v)
|
|
107
|
-
})
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function setFittingUnselected() {
|
|
111
|
-
let fitting = []
|
|
112
|
-
fittingUnselected.value = []
|
|
113
|
-
if (selectedEntries.value.length === 1) {
|
|
114
|
-
let selectedKey = parseInt(Object.keys(selectedOptions)[0])
|
|
115
|
-
let selectedKeyOptionValues = _.findWhere(productVariantOptions.value, { id: selectedKey }).values
|
|
116
|
-
fitting = selectedKeyOptionValues.map((skov) => selectedKey + '-' + skov)
|
|
117
|
-
}
|
|
118
|
-
selectedEntries.value.forEach((so) => {
|
|
119
|
-
fitting.push(_.filter(optionCombinations.value, (c) => c.includes(so)))
|
|
120
|
-
})
|
|
121
|
-
fittingUnselected.value = _.uniq(_.flatten(fitting))
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
function getMatchingVariant() {
|
|
125
|
-
if (selectedEntries.value.length !== productVariantOptions.value.length) {
|
|
126
|
-
return false
|
|
127
|
-
}
|
|
128
|
-
let match = false
|
|
129
|
-
_.each(productVariants.value, (pv) => {
|
|
130
|
-
let pvoptions = pv.options
|
|
131
|
-
.map((pvo) => {
|
|
132
|
-
return pvo.attribute_id + '-' + pvo.value
|
|
133
|
-
})
|
|
134
|
-
.sort()
|
|
135
|
-
if (_.difference(selectedEntries.value, pvoptions).length === 0) {
|
|
136
|
-
match = pv
|
|
137
|
-
}
|
|
138
|
-
})
|
|
139
|
-
if (match) {
|
|
140
|
-
highlight.value = false
|
|
141
|
-
}
|
|
142
|
-
return match
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function removeUnfitting(optionValue, optionId) {
|
|
146
|
-
let akv = optionId + '-' + optionValue
|
|
147
|
-
for (let selectedKey in selectedOptions) {
|
|
148
|
-
if (selectedKey === optionId) {
|
|
149
|
-
continue
|
|
150
|
-
}
|
|
151
|
-
let kv = selectedKey + '-' + selectedOptions[selectedKey]
|
|
152
|
-
let fits = _.any(optionCombinations.value, (c) => {
|
|
153
|
-
return c.includes(kv) && c.includes(akv)
|
|
154
|
-
})
|
|
155
|
-
if (fits === false) {
|
|
156
|
-
delete selectedOptions[selectedKey]
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
function optionSelect(optionValue, option) {
|
|
162
|
-
selectedVariant.value = null
|
|
163
|
-
fittingUnselected.value = []
|
|
164
|
-
updateDiscountBadge()
|
|
165
|
-
if (selectedOptions[option.id] === optionValue) {
|
|
166
|
-
delete selectedOptions[option.id]
|
|
167
|
-
} else {
|
|
168
|
-
selectedOptions[option.id] = optionValue
|
|
169
|
-
}
|
|
170
|
-
removeUnfitting(optionValue, option.id)
|
|
171
|
-
selectedVariant.value = getMatchingVariant()
|
|
172
|
-
if (!selectedVariant.value) {
|
|
173
|
-
setFittingUnselected()
|
|
174
|
-
} else {
|
|
175
|
-
updateDiscountBadge()
|
|
176
|
-
}
|
|
177
|
-
emitEvents()
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
function isOptionDisabled(opt) {
|
|
181
|
-
const hasPartialSelection = selectedEntries.value.length > 0 && selectedEntries.value.length < productVariantOptions.value.length
|
|
182
|
-
if (!hasPartialSelection) {
|
|
183
|
-
return false
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// If combinations are not built yet, keep options enabled to avoid blocking interaction
|
|
187
|
-
if (!optionCombinations.value.length || !fittingUnselected.value.length) {
|
|
188
|
-
return false
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
return !fittingUnselected.value.includes(opt)
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function setSelectedVariant(variant) {
|
|
195
|
-
if(!variant) {
|
|
196
|
-
return
|
|
197
|
-
}
|
|
198
|
-
console.log('preselecting variant', variant)
|
|
199
|
-
selectedVariant.value = variant
|
|
200
|
-
selectedVariant.value.options.forEach((vo) => {
|
|
201
|
-
selectedOptions[vo.attribute_id] = vo.value
|
|
202
|
-
})
|
|
203
|
-
|
|
204
|
-
updateDiscountBadge(variant)
|
|
205
|
-
|
|
206
|
-
nextTick(() => {
|
|
207
|
-
emitEvents('preselect')
|
|
208
|
-
})
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
function updateDiscountBadge() {
|
|
212
|
-
if (typeof document === 'undefined') {
|
|
213
|
-
return
|
|
214
|
-
}
|
|
215
|
-
let badge = document.querySelector(props.badgeSelector)
|
|
216
|
-
if(!badge) {
|
|
217
|
-
return
|
|
218
|
-
}
|
|
219
|
-
badge.style.visibility = 'hidden';
|
|
220
|
-
if(!selectedVariant.value) {
|
|
221
|
-
return
|
|
222
|
-
}
|
|
223
|
-
let discountPercent = Math.round((selectedVariant.value.compare_price - selectedVariant.value.price)/selectedVariant.value.compare_price * 100, 0)
|
|
224
|
-
|
|
225
|
-
if(discountPercent > 0) {
|
|
226
|
-
badge.style.visibility = 'visible';
|
|
227
|
-
badge.textContent = `-${discountPercent}%`
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
function updateOverridePriceNotification() {
|
|
232
|
-
if (typeof document === 'undefined') {
|
|
233
|
-
return
|
|
234
|
-
}
|
|
235
|
-
let opActiveContainer = document.querySelector(props.overridePriceNotificationSelector)
|
|
236
|
-
if(!opActiveContainer) {
|
|
237
|
-
return
|
|
238
|
-
}
|
|
239
|
-
opActiveContainer.textContent = ''
|
|
240
|
-
|
|
241
|
-
if(!selectedVariant.value) {
|
|
242
|
-
return
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
if(selectedVariant.value.override_price_active) {
|
|
246
|
-
opActiveContainer.textContent = 'Trajanje akcije od ' +
|
|
247
|
-
formatDate(new Date(selectedVariant.value.override_start_at), 'DD.MM.YYYY HH:mm') +
|
|
248
|
-
' do ' +
|
|
249
|
-
formatDate(new Date(selectedVariant.value.override_stop_at), 'DD.MM.YYYY HH:mm')
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
function updateDiscountInfo() {
|
|
254
|
-
if (typeof document === 'undefined' || typeof window === 'undefined') {
|
|
255
|
-
return
|
|
256
|
-
}
|
|
257
|
-
let discountInfoContainer = document.querySelector(props.discountInfoSelector)
|
|
258
|
-
if(!discountInfoContainer) {
|
|
259
|
-
return
|
|
260
|
-
}
|
|
261
|
-
let discountMessageContainer = discountInfoContainer.querySelector('.discount-message')
|
|
262
|
-
|
|
263
|
-
discountInfoContainer.classList.add('is-hidden')
|
|
264
|
-
discountMessageContainer.textContent = ''
|
|
265
|
-
|
|
266
|
-
if(!selectedVariant.value) {
|
|
267
|
-
return
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
const productDiscountInfo = window.wkl_product_discount_info
|
|
271
|
-
|
|
272
|
-
const variantDiscountInfo = productDiscountInfo.find(pdi => pdi.product_id == selectedVariant.value.id)
|
|
273
|
-
|
|
274
|
-
if(variantDiscountInfo) {
|
|
275
|
-
discountInfoContainer.classList.remove('is-hidden')
|
|
276
|
-
if(variantDiscountInfo.coupon_applied) {
|
|
277
|
-
discountMessageContainer.textContent = `U korpi će vam biti obračunat popust od ${formatMoney(variantDiscountInfo.discount_amount)} RSD`
|
|
278
|
-
} else {
|
|
279
|
-
if(variantDiscountInfo.description.trim() !== '') {
|
|
280
|
-
discountMessageContainer.innerHTML = `<p>${variantDiscountInfo.description}</p><hr>`
|
|
281
|
-
}
|
|
282
|
-
discountMessageContainer.innerHTML += `Iskoristi promo kod <strong>${variantDiscountInfo.coupon_code}</strong> za popust od <strong>${formatMoney(variantDiscountInfo.discount_amount)} RSD</strong>`
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
function getVariantByOption(optionId, optionValue) {
|
|
288
|
-
if (productVariantOptions.value.length !== 1) {
|
|
289
|
-
return {}
|
|
290
|
-
}
|
|
291
|
-
let match = {}
|
|
292
|
-
_.each(productVariants.value, (pv) => {
|
|
293
|
-
if(pv.in_stock && pv.options[0].attribute_id === optionId && pv.options[0].value === optionValue) {
|
|
294
|
-
match = pv
|
|
295
|
-
}
|
|
296
|
-
})
|
|
297
|
-
return match
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
function getVariantFromProp() {
|
|
301
|
-
if(!props.variantId) {
|
|
302
|
-
return
|
|
303
|
-
}
|
|
304
|
-
let variant = _.findWhere(productVariants.value, { id: props.variantId })
|
|
305
|
-
if (!variant) {
|
|
306
|
-
return
|
|
307
|
-
}
|
|
308
|
-
return variant
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
function getVariantFromURL() {
|
|
312
|
-
if (typeof window === 'undefined') {
|
|
313
|
-
return
|
|
314
|
-
}
|
|
315
|
-
let variant_id = parseInt(new URL(window.location.href).searchParams.get('variant'))
|
|
316
|
-
if (!variant_id) {
|
|
317
|
-
return
|
|
318
|
-
}
|
|
319
|
-
let variant = _.findWhere(productVariants.value, { id: variant_id })
|
|
320
|
-
if (!variant || !variant.in_stock) {
|
|
321
|
-
return
|
|
322
|
-
}
|
|
323
|
-
return variant
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
function preselect() {
|
|
327
|
-
let propVariant = getVariantFromProp()
|
|
328
|
-
if(propVariant) {
|
|
329
|
-
setSelectedVariant(propVariant)
|
|
330
|
-
return
|
|
331
|
-
}
|
|
332
|
-
let urlVariant = getVariantFromURL()
|
|
333
|
-
|
|
334
|
-
if(urlVariant) {
|
|
335
|
-
setSelectedVariant(urlVariant)
|
|
336
|
-
} else {
|
|
337
|
-
let inStockVariants = _.sortBy(
|
|
338
|
-
_.filter(productVariants.value, (item) => item.in_stock && item.price > 0),
|
|
339
|
-
'price'
|
|
340
|
-
)
|
|
341
|
-
|
|
342
|
-
if (inStockVariants.length === 0) {
|
|
343
|
-
return
|
|
344
|
-
}
|
|
345
|
-
if (props.render === 'pricetags' || inStockVariants.length === 1) {
|
|
346
|
-
setSelectedVariant(inStockVariants[0])
|
|
347
|
-
} else {
|
|
348
|
-
let discounted = inStockVariants.find(isv => isv.price !== isv.compare_price);
|
|
349
|
-
if(discounted) {
|
|
350
|
-
setSelectedVariant(discounted)
|
|
351
|
-
} else {
|
|
352
|
-
setSelectedVariant(inStockVariants[0])
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
function emitEvents(context='') {
|
|
359
|
-
if (!selectedVariant.value) {
|
|
360
|
-
$bus.emit('selectVariant', false)
|
|
361
|
-
$bus.emit('updateSKU', '')
|
|
362
|
-
return
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
$bus.emit('selectVariant', selectedVariant.value.id)
|
|
366
|
-
$bus.emit('changePhoto', selectedVariant.value.default_image_id)
|
|
367
|
-
$bus.emit('updateSKU', selectedVariant.value.sku || selectedVariant.value.id)
|
|
368
|
-
if(context !== 'preselect') {
|
|
369
|
-
$bus.emit('updatePrice', selectedVariant.value.price, selectedVariant.value.compare_price)
|
|
370
|
-
}
|
|
371
|
-
updateOverridePriceNotification()
|
|
372
|
-
updateDiscountInfo()
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
const onNoVariantSelected = () => {
|
|
376
|
-
highlight.value = true
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
// Lifecycle
|
|
380
|
-
onMounted(() => {
|
|
381
|
-
if (props.product.id) {
|
|
382
|
-
productVariantOptions.value = props.product.variant_options
|
|
383
|
-
productVariants.value = props.product.variants
|
|
384
|
-
} else if (typeof window !== 'undefined' && window.wkl_product) {
|
|
385
|
-
emit('update', window.wkl_product)
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
$bus.on('noVariantSelected', onNoVariantSelected)
|
|
389
|
-
|
|
390
|
-
nextTick(() => {
|
|
391
|
-
preselect()
|
|
392
|
-
setOptionCombinations()
|
|
393
|
-
})
|
|
394
|
-
})
|
|
395
|
-
|
|
396
|
-
onBeforeUnmount(() => {
|
|
397
|
-
$bus.off('noVariantSelected', onNoVariantSelected)
|
|
398
|
-
})
|
|
399
|
-
</script>
|