flowrix 1.0.1-beta.14 → 1.0.1-beta.141

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.
Files changed (275) hide show
  1. package/dist/module.d.mts +1 -6
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +169 -30
  4. package/dist/runtime/composables/Blog/useBlogIndex.d.ts +2 -5
  5. package/dist/runtime/composables/Blog/useBlogSingle.js +2 -4
  6. package/dist/runtime/composables/Brand/brand.d.ts +1 -1
  7. package/dist/runtime/composables/Brand/brand.js +30 -2
  8. package/dist/runtime/composables/Cart/useCart.d.ts +40 -0
  9. package/dist/runtime/composables/Cart/useCart.js +10 -0
  10. package/dist/runtime/composables/Cart/useCartComponent.d.ts +1 -0
  11. package/dist/runtime/composables/Cart/useCartComponent.js +11 -0
  12. package/dist/runtime/composables/Cart/useCartDetail.d.ts +15 -5
  13. package/dist/runtime/composables/Cart/useCartDetail.js +3 -0
  14. package/dist/runtime/composables/Category/useCategoryIndex.d.ts +25 -32
  15. package/dist/runtime/composables/Category/useCategoryIndex.js +63 -44
  16. package/dist/runtime/composables/Checkout/PaymentMethods/useDirectDeposit.js +8 -0
  17. package/dist/runtime/composables/Checkout/PaymentMethods/useEway.js +16 -6
  18. package/dist/runtime/composables/Checkout/PaymentMethods/useFlowrixpay.d.ts +40 -1
  19. package/dist/runtime/composables/Checkout/PaymentMethods/useFlowrixpay.js +10 -2
  20. package/dist/runtime/composables/Checkout/PaymentMethods/useOpayo.d.ts +40 -1
  21. package/dist/runtime/composables/Checkout/PaymentMethods/useOpayo.js +10 -2
  22. package/dist/runtime/composables/Checkout/PaymentMethods/usePaymentMethods.js +3 -14
  23. package/dist/runtime/composables/Checkout/PaymentMethods/usePaypal.js +8 -0
  24. package/dist/runtime/composables/Checkout/PaymentMethods/useStripe.d.ts +2 -2
  25. package/dist/runtime/composables/Checkout/PaymentMethods/useStripe.js +8 -0
  26. package/dist/runtime/composables/Checkout/PaymentMethods/useZippay.js +8 -0
  27. package/dist/runtime/composables/Checkout/useCheckout.d.ts +85 -73
  28. package/dist/runtime/composables/Checkout/useCheckout.js +84 -53
  29. package/dist/runtime/composables/Checkout/useCheckoutBillingAddress.d.ts +43 -0
  30. package/dist/runtime/composables/Checkout/useCheckoutBillingAddress.js +84 -0
  31. package/dist/runtime/composables/Checkout/useCheckoutShippingAddress.d.ts +55 -0
  32. package/dist/runtime/composables/Checkout/useCheckoutShippingAddress.js +196 -0
  33. package/dist/runtime/composables/Checkout/useCreateAccount.d.ts +7 -7
  34. package/dist/runtime/composables/Checkout/useCreateAccount.js +3 -1
  35. package/dist/runtime/composables/Checkout/useDeliveryMethod.d.ts +2 -2
  36. package/dist/runtime/composables/Checkout/useDeliveryMethod.js +18 -11
  37. package/dist/runtime/composables/Customer/useBillingAddress.d.ts +112 -0
  38. package/dist/runtime/composables/Customer/useBillingAddress.js +93 -0
  39. package/dist/runtime/composables/Customer/useLogin.d.ts +9 -0
  40. package/dist/runtime/composables/Customer/useLogin.js +34 -0
  41. package/dist/runtime/composables/Customer/useOrders.d.ts +29 -0
  42. package/dist/runtime/composables/Customer/useOrders.js +56 -0
  43. package/dist/runtime/composables/Customer/usePasswordReset.d.ts +26 -0
  44. package/dist/runtime/composables/Customer/usePasswordReset.js +258 -0
  45. package/dist/runtime/composables/Customer/useProfile.d.ts +75 -0
  46. package/dist/runtime/composables/Customer/useProfile.js +106 -0
  47. package/dist/runtime/composables/Customer/useQuotations.d.ts +32 -0
  48. package/dist/runtime/composables/Customer/useQuotations.js +40 -0
  49. package/dist/runtime/composables/Customer/useRegister.d.ts +121 -13
  50. package/dist/runtime/composables/Customer/useRegister.js +310 -35
  51. package/dist/runtime/composables/Customer/useShippingAddress.d.ts +121 -0
  52. package/dist/runtime/composables/Customer/useShippingAddress.js +145 -0
  53. package/dist/runtime/composables/Customer/useUpdatePassword.d.ts +21 -0
  54. package/dist/runtime/composables/Customer/useUpdatePassword.js +130 -0
  55. package/dist/runtime/composables/Customer/useUserCards.d.ts +22 -0
  56. package/dist/runtime/composables/Customer/useUserCards.js +65 -0
  57. package/dist/runtime/composables/{useWishlists.d.ts → Customer/useWishlists.d.ts} +7 -20
  58. package/dist/runtime/composables/{useWishlists.js → Customer/useWishlists.js} +21 -30
  59. package/dist/runtime/composables/Extras/useCountry.d.ts +11 -6
  60. package/dist/runtime/composables/Extras/useCountry.js +5 -4
  61. package/dist/runtime/composables/Footer/useFooter.d.ts +4 -4
  62. package/dist/runtime/composables/Footer/useFooter.js +12 -8
  63. package/dist/runtime/composables/Header/useHeader.d.ts +6 -20
  64. package/dist/runtime/composables/Header/useHeader.js +3 -2
  65. package/dist/runtime/composables/Product/CustomProduct/useCustomeScript.js +4 -5
  66. package/dist/runtime/composables/Product/CustomProduct/useSteps.d.ts +1 -1
  67. package/dist/runtime/composables/Product/useProductComponent.js +110 -0
  68. package/dist/runtime/composables/Product/useProductSlug.d.ts +8 -1
  69. package/dist/runtime/composables/Product/useQuickView.d.ts +8 -0
  70. package/dist/runtime/composables/Product/useQuickView.js +27 -0
  71. package/dist/runtime/composables/Product/useService.d.ts +42 -15
  72. package/dist/runtime/composables/Product/useService.js +137 -48
  73. package/dist/runtime/composables/Samples/useSamples.d.ts +5 -6
  74. package/dist/runtime/composables/Samples/useSamples.js +19 -15
  75. package/dist/runtime/composables/SideBar/Filters/useFilters.d.ts +2 -2
  76. package/dist/runtime/composables/SideBar/Filters/useSorting.d.ts +2 -2
  77. package/dist/runtime/composables/index.d.ts +18 -12
  78. package/dist/runtime/composables/index.js +18 -12
  79. package/dist/runtime/composables/useAddresses.js +6 -6
  80. package/dist/runtime/composables/useApp.d.ts +1 -0
  81. package/dist/runtime/composables/useApp.js +88 -0
  82. package/dist/runtime/composables/useCards.js +2 -2
  83. package/dist/runtime/composables/useDataLayer.js +1 -1
  84. package/dist/runtime/composables/useDotDigital.d.ts +3 -0
  85. package/dist/runtime/composables/useDotDigital.js +122 -0
  86. package/dist/runtime/composables/useLocation.d.ts +61 -19
  87. package/dist/runtime/composables/useLocation.js +353 -25
  88. package/dist/runtime/composables/useMetaLayer.js +11 -11
  89. package/dist/runtime/composables/useQuotationCheckout.d.ts +78 -0
  90. package/dist/runtime/composables/useQuotationCheckout.js +137 -0
  91. package/dist/runtime/composables/useSubscriptions.d.ts +17 -10
  92. package/dist/runtime/composables/useSubscriptions.js +68 -33
  93. package/dist/runtime/composables/useTikTokDatalayer.js +7 -7
  94. package/dist/runtime/composables/useWebforms.d.ts +38 -9
  95. package/dist/runtime/composables/useWebforms.js +93 -60
  96. package/dist/runtime/middleware/flowrix.d.ts +5 -4
  97. package/dist/runtime/middleware/flowrix.js +40 -22
  98. package/dist/runtime/pages/404.d.vue.ts +3 -0
  99. package/dist/runtime/pages/404.vue +6 -0
  100. package/dist/runtime/pages/404.vue.d.ts +3 -0
  101. package/dist/runtime/pages/flowrix-default.d.vue.ts +3 -0
  102. package/dist/runtime/pages/flowrix-default.vue +42 -0
  103. package/dist/runtime/pages/flowrix-default.vue.d.ts +3 -0
  104. package/dist/runtime/plugin.d.ts +1 -1
  105. package/dist/runtime/plugins/router.d.ts +2 -0
  106. package/dist/runtime/plugins/router.js +11 -0
  107. package/dist/runtime/server/api/albums.d.ts +1 -0
  108. package/dist/runtime/server/api/albums.js +35 -7
  109. package/dist/runtime/server/api/auth/forgot.js +1 -2
  110. package/dist/runtime/server/api/auth/login.d.ts +7 -0
  111. package/dist/runtime/server/api/auth/login.js +4 -16
  112. package/dist/runtime/server/api/auth/logout.js +1 -2
  113. package/dist/runtime/server/api/auth/register.js +1 -2
  114. package/dist/runtime/server/api/auth/session.get.js +1 -3
  115. package/dist/runtime/server/api/auth/user/reset-password.js +1 -2
  116. package/dist/runtime/server/api/auth/user/session.js +1 -2
  117. package/dist/runtime/server/api/auth/user/verify-token.js +1 -2
  118. package/dist/runtime/server/api/banners.js +20 -15
  119. package/dist/runtime/server/api/brand/[...slug].js +55 -0
  120. package/dist/runtime/server/api/brand/index.d.ts +3 -0
  121. package/dist/runtime/server/api/brand/index.js +46 -0
  122. package/dist/runtime/server/api/cache/[...slug].delete.d.ts +4 -1
  123. package/dist/runtime/server/api/cache/[...slug].delete.js +4 -7
  124. package/dist/runtime/server/api/cache/clean.get.d.ts +5 -0
  125. package/dist/runtime/server/api/cache/clean.get.js +4 -7
  126. package/dist/runtime/server/api/cart/[slug]/add.d.ts +1 -1
  127. package/dist/runtime/server/api/cart/[slug]/add.js +11 -11
  128. package/dist/runtime/server/api/cart/[slug]/update.d.ts +1 -1
  129. package/dist/runtime/server/api/cart/[slug]/update.js +11 -11
  130. package/dist/runtime/server/api/{v2/[...slug].d.ts → cart/related.d.ts} +0 -1
  131. package/dist/runtime/server/api/cart/related.js +21 -0
  132. package/dist/runtime/server/api/cart/remove.d.ts +1 -1
  133. package/dist/runtime/server/api/cart/remove.js +10 -10
  134. package/dist/runtime/server/api/cart/service/[slug]/add.d.ts +1 -1
  135. package/dist/runtime/server/api/cart/service/[slug]/add.js +12 -12
  136. package/dist/runtime/server/api/catalog/brands.d.ts +3 -0
  137. package/dist/runtime/server/api/catalog/brands.js +52 -0
  138. package/dist/runtime/server/api/catalog/categories.js +28 -19
  139. package/dist/runtime/server/api/catalog/categoriesall.d.ts +3 -0
  140. package/dist/runtime/server/api/catalog/categoriesall.js +52 -0
  141. package/dist/runtime/server/api/catalog/featured.js +28 -17
  142. package/dist/runtime/server/api/catalog/posts.d.ts +3 -0
  143. package/dist/runtime/server/api/catalog/posts.js +52 -0
  144. package/dist/runtime/server/api/catalog/samples.js +28 -19
  145. package/dist/runtime/server/api/catalog/search.js +28 -19
  146. package/dist/runtime/server/api/category/[...slug].js +31 -20
  147. package/dist/runtime/server/api/check-404.d.ts +4 -0
  148. package/dist/runtime/server/api/check-404.js +8 -0
  149. package/dist/runtime/server/api/checkout/applyCoupon.d.ts +1 -1
  150. package/dist/runtime/server/api/checkout/applyCoupon.js +13 -13
  151. package/dist/runtime/server/api/checkout/configs.d.ts +1 -1
  152. package/dist/runtime/server/api/checkout/configs.js +11 -11
  153. package/dist/runtime/server/api/checkout/countries.d.ts +1 -1
  154. package/dist/runtime/server/api/checkout/countries.js +5 -9
  155. package/dist/runtime/server/api/checkout/paymentmethod.d.ts +1 -1
  156. package/dist/runtime/server/api/checkout/paymentmethod.js +16 -11
  157. package/dist/runtime/server/api/{blog/blog.d.ts → checkout/quotation/[slug].d.ts} +0 -1
  158. package/dist/runtime/server/api/checkout/quotation/[slug].js +20 -0
  159. package/dist/runtime/server/api/checkout/quotation/guest/[slug].d.ts +2 -0
  160. package/dist/runtime/server/api/checkout/quotation/guest/[slug].js +35 -0
  161. package/dist/runtime/server/api/checkout/quotation/guest/customer.d.ts +2 -0
  162. package/dist/runtime/server/api/checkout/quotation/guest/customer.js +20 -0
  163. package/dist/runtime/server/api/checkout/quotation/submit/[slug].d.ts +2 -0
  164. package/dist/runtime/server/api/checkout/quotation/submit/[slug].js +22 -0
  165. package/dist/runtime/server/api/checkvariables.d.ts +3 -0
  166. package/dist/runtime/server/api/checkvariables.js +37 -0
  167. package/dist/runtime/server/api/cmspost/[...slug].js +54 -0
  168. package/dist/runtime/server/api/cmspost/all.d.ts +3 -0
  169. package/dist/runtime/server/api/cmspost/all.js +52 -0
  170. package/dist/runtime/server/api/company/profile.d.ts +1 -1
  171. package/dist/runtime/server/api/company/profile.js +12 -7
  172. package/dist/runtime/server/api/contact-center/webforms/[id]/details.d.ts +1 -1
  173. package/dist/runtime/server/api/contact-center/webforms/[id]/details.js +50 -15
  174. package/dist/runtime/server/api/contact-center/webforms/create.d.ts +1 -1
  175. package/dist/runtime/server/api/contact-center/webforms/create.js +13 -9
  176. package/dist/runtime/server/api/countries.d.ts +2 -0
  177. package/dist/runtime/server/api/countries.js +44 -0
  178. package/dist/runtime/server/api/customer/address/add.js +1 -2
  179. package/dist/runtime/server/api/customer/address/delete.js +2 -3
  180. package/dist/runtime/server/api/customer/address/setshipping.js +1 -2
  181. package/dist/runtime/server/api/customer/address/update.js +1 -2
  182. package/dist/runtime/server/api/customer/cards/delete.js +2 -3
  183. package/dist/runtime/server/api/customer/cards/get.js +2 -3
  184. package/dist/runtime/server/api/customer/change-password.js +2 -3
  185. package/dist/runtime/server/api/customer/checkout.js +1 -2
  186. package/dist/runtime/server/api/customer/orders.js +2 -3
  187. package/dist/runtime/server/api/customer/profile/update.js +1 -2
  188. package/dist/runtime/server/api/customer/quotations.js +2 -3
  189. package/dist/runtime/server/api/customer/search.js +1 -2
  190. package/dist/runtime/server/api/customer/tax-invoice.js +1 -2
  191. package/dist/runtime/server/api/customer/wishlist/add.js +1 -2
  192. package/dist/runtime/server/api/customer/wishlist/createWishList.js +1 -2
  193. package/dist/runtime/server/api/customer/wishlist/deleteFromWishList.js +1 -2
  194. package/dist/runtime/server/api/customer/wishlist/deleteWishList.js +1 -2
  195. package/dist/runtime/server/api/customer/wishlist/get.js +2 -3
  196. package/dist/runtime/server/api/customer/wishlist/getWishListItems.js +1 -2
  197. package/dist/runtime/server/api/customer/wishlist/updateWishList.js +2 -3
  198. package/dist/runtime/server/api/featured.d.ts +3 -0
  199. package/dist/runtime/server/api/featured.js +52 -0
  200. package/dist/runtime/server/api/generate/robots.get.d.ts +2 -0
  201. package/dist/runtime/server/api/generate/robots.get.js +20 -0
  202. package/dist/runtime/server/api/generate/sitemap.get.d.ts +2 -0
  203. package/dist/runtime/server/api/generate/sitemap.get.js +32 -0
  204. package/dist/runtime/server/api/location.d.ts +1 -1
  205. package/dist/runtime/server/api/location.js +24 -12
  206. package/dist/runtime/server/api/nav/[id]/links.d.ts +1 -0
  207. package/dist/runtime/server/api/nav/[id]/links.js +46 -10
  208. package/dist/runtime/server/api/page/[...slug].js +54 -0
  209. package/dist/runtime/server/api/product/[...slug].js +28 -13
  210. package/dist/runtime/server/api/quickview/[slug].d.ts +2 -0
  211. package/dist/runtime/server/api/quickview/[slug].js +21 -0
  212. package/dist/runtime/server/api/reviews.d.ts +2 -0
  213. package/dist/runtime/server/api/reviews.js +23 -0
  214. package/dist/runtime/server/api/samples.d.ts +3 -0
  215. package/dist/runtime/server/api/samples.js +53 -0
  216. package/dist/runtime/server/api/search.d.ts +3 -0
  217. package/dist/runtime/server/api/search.js +53 -0
  218. package/dist/runtime/server/api/service/[slug].js +22 -16
  219. package/dist/runtime/server/api/service/availability.d.ts +1 -1
  220. package/dist/runtime/server/api/service/availability.js +14 -12
  221. package/dist/runtime/server/api/service/getall.d.ts +3 -0
  222. package/dist/runtime/server/api/service/getall.js +57 -0
  223. package/dist/runtime/server/api/shop.d.ts +3 -0
  224. package/dist/runtime/server/api/shop.js +53 -0
  225. package/dist/runtime/server/api/subscribe.d.ts +1 -1
  226. package/dist/runtime/server/api/subscribe.js +23 -14
  227. package/dist/runtime/server/api/v2/[...slug].get.d.ts +2 -0
  228. package/dist/runtime/server/api/v2/[...slug].get.js +32 -0
  229. package/dist/runtime/server/api/webform.d.ts +3 -0
  230. package/dist/runtime/server/api/webform.js +54 -0
  231. package/dist/runtime/server/tsconfig.json +3 -3
  232. package/dist/runtime/stores/Cart.d.ts +12 -0
  233. package/dist/runtime/stores/Cart.js +62 -17
  234. package/dist/runtime/stores/Checkout.d.ts +9 -15
  235. package/dist/runtime/stores/Checkout.js +38 -45
  236. package/dist/runtime/stores/IpLocation.d.ts +95 -4
  237. package/dist/runtime/stores/IpLocation.js +93 -15
  238. package/dist/runtime/stores/Search.d.ts +1 -1
  239. package/dist/runtime/stores/Services.d.ts +5 -0
  240. package/dist/runtime/stores/Services.js +59 -8
  241. package/dist/runtime/stores/auth.d.ts +8 -11
  242. package/dist/runtime/stores/auth.js +385 -8
  243. package/dist/runtime/stores/countries.d.ts +1 -3
  244. package/dist/runtime/stores/countries.js +4 -8
  245. package/dist/runtime/stores/product/README.md +6 -6
  246. package/dist/runtime/stores/product/slug.d.ts +1 -17
  247. package/dist/runtime/stores/webforms.d.ts +24 -9
  248. package/dist/runtime/stores/webforms.js +105 -5
  249. package/dist/runtime/stores/wishlists.d.ts +125 -8
  250. package/dist/runtime/stores/wishlists.js +212 -20
  251. package/dist/runtime/utils/api.js +7 -13
  252. package/dist/runtime/utils/htmlCache.d.ts +2 -2
  253. package/dist/runtime/utils/htmlCache.js +23 -13
  254. package/dist/types.d.mts +6 -2
  255. package/package.json +16 -5
  256. package/dist/runtime/composables/Checkout/useBillingAddress.d.ts +0 -19
  257. package/dist/runtime/composables/Checkout/useBillingAddress.js +0 -82
  258. package/dist/runtime/composables/Checkout/useShippingAddress.d.ts +0 -9
  259. package/dist/runtime/composables/Checkout/useShippingAddress.js +0 -121
  260. package/dist/runtime/composables/useAuth.d.ts +0 -45
  261. package/dist/runtime/composables/useAuth.js +0 -180
  262. package/dist/runtime/composables/useCountries.d.ts +0 -12
  263. package/dist/runtime/composables/useCountries.js +0 -50
  264. package/dist/runtime/composables/useOrders.d.ts +0 -21
  265. package/dist/runtime/composables/useOrders.js +0 -82
  266. package/dist/runtime/composables/useQuotations.d.ts +0 -14
  267. package/dist/runtime/composables/useQuotations.js +0 -50
  268. package/dist/runtime/server/api/blog/[slug].js +0 -51
  269. package/dist/runtime/server/api/blog/blog.js +0 -17
  270. package/dist/runtime/server/api/brand/[slug].js +0 -58
  271. package/dist/runtime/server/api/page/[slug].js +0 -51
  272. package/dist/runtime/server/api/v2/[...slug].js +0 -9
  273. /package/dist/runtime/server/api/brand/{[slug].d.ts → [...slug].d.ts} +0 -0
  274. /package/dist/runtime/server/api/{blog/[slug].d.ts → cmspost/[...slug].d.ts} +0 -0
  275. /package/dist/runtime/server/api/page/{[slug].d.ts → [...slug].d.ts} +0 -0
@@ -1,14 +1,24 @@
1
1
  import { ref, computed, watch, onMounted, defineAsyncComponent } from "vue";
2
+ import { useCompanyProfile } from "../../stores/useCompanyProfile.js";
3
+ import { useCartStore } from "../../stores/Cart.js";
4
+ import { GTM_begin_checkout, GTM_add_shipping_info, GTM_add_payment_info } from "../../composables/useDataLayer.js";
5
+ import { META_begin_checkout, META_add_shipping_info, META_add_payment_info } from "../../composables/useMetaLayer.js";
6
+ import { TikTok_begin_checkout, TikTok_add_payment_info } from "../../composables/useTikTokDatalayer.js";
7
+ import { useCheckoutStore } from "../../stores/Checkout.js";
8
+ import { useCountry } from "../Extras/useCountry.js";
9
+ import { useRouter, useRoute } from "vue-router";
10
+ import { useAuthStore } from "../../stores/auth.js";
2
11
  export default function() {
3
12
  const router = useRouter();
4
13
  const route = useRoute();
5
14
  const {
6
- status,
7
- data
8
- } = useAuth();
15
+ user,
16
+ token,
17
+ isAuthenticated
18
+ } = useAuthStore();
9
19
  const { profile } = useCompanyProfile();
10
20
  const cartStore = useCartStore();
11
- const companyCountryId = computed(() => profile?.value?.country_id || 235);
21
+ const companyCountryId = computed(() => profile?.data.country_id || "");
12
22
  const checkoutStore = useCheckoutStore();
13
23
  const AuthStore = ref();
14
24
  const shippingFormEnabled = ref(true);
@@ -75,14 +85,13 @@ export default function() {
75
85
  save_card_details: 0
76
86
  });
77
87
  const updateUserFieldsIfuserLogin = (async (sameasbilling = false) => {
78
- const LoggedInUser = data;
79
- if (Object.keys(LoggedInUser).length > 0 && LoggedInUser.value !== void 0) {
80
- const billingAddres = LoggedInUser.value.addresses?.filter((address) => address.billing == 1)[0];
81
- const shippingAddres = LoggedInUser.value.addresses?.filter((address) => address.shipping == 1)[0];
88
+ if (isAuthenticated) {
89
+ const billingAddres = user.addresses?.filter((address) => address.billing == 1)[0];
90
+ const shippingAddres = user.addresses?.filter((address) => address.shipping == 1)[0];
82
91
  inputData.value.billing_firstname = billingAddres.firstname;
83
92
  inputData.value.billing_lastname = billingAddres.lastname;
84
- inputData.value.email = LoggedInUser.value.email;
85
- inputData.value.billing_mobile = LoggedInUser.value.mobile;
93
+ inputData.value.email = user.email;
94
+ inputData.value.billing_mobile = user.mobile;
86
95
  if (sameasbilling == true) {
87
96
  } else {
88
97
  if (billingAddres != void 0) {
@@ -96,15 +105,6 @@ export default function() {
96
105
  inputData.value.billing_mobile = inputData.value.billing_mobile ? inputData.value.billing_mobile : billingAddres.mobile;
97
106
  }
98
107
  if (shippingAddres != void 0) {
99
- inputData.value.shipping_fullname = "";
100
- inputData.value.shipping_firstname = "";
101
- inputData.value.shipping_lastname = "";
102
- inputData.value.shipping_address = "";
103
- inputData.value.shipping_postcode = "";
104
- inputData.value.shipping_state = "";
105
- inputData.value.shipping_country = "";
106
- inputData.value.shipping_suburb = "";
107
- inputData.value.shipping_mobile = "";
108
108
  inputData.value.shipping_fullname = shippingAddres.fullname;
109
109
  inputData.value.shipping_firstname = shippingAddres.firstname;
110
110
  inputData.value.shipping_lastname = shippingAddres.lastname;
@@ -116,7 +116,7 @@ export default function() {
116
116
  inputData.value.shipping_mobile = shippingAddres.mobile;
117
117
  }
118
118
  }
119
- } else if (Object.keys(LoggedInUser).length == 0 && sameasbilling == true) {
119
+ } else if (isAuthenticated && sameasbilling == true) {
120
120
  inputData.value.shipping_firstname = inputData.value.billing_firstname ? inputData.value.billing_firstname : "";
121
121
  inputData.value.shipping_lastname = inputData.value.billing_lastname ? inputData.value.billing_lastname : "";
122
122
  inputData.value.shipping_address = inputData.value.billing_address ? inputData.value.billing_address : "";
@@ -126,25 +126,57 @@ export default function() {
126
126
  inputData.value.shipping_suburb = inputData.value.billing_suburb ? inputData.value.billing_suburb : "";
127
127
  inputData.value.shipping_mobile = inputData.value.billing_mobile ? inputData.value.billing_mobile : "";
128
128
  } else {
129
- inputData.value.shipping_fullname = "";
130
- inputData.value.shipping_firstname = "";
131
- inputData.value.shipping_lastname = "";
132
- inputData.value.shipping_address = "";
133
- inputData.value.shipping_postcode = "";
134
- inputData.value.shipping_state = "";
135
- inputData.value.shipping_country = "";
136
- inputData.value.shipping_suburb = "";
137
- inputData.value.shipping_mobile = "";
138
129
  }
139
130
  checkoutStore.saveToCheckoutSession(inputData.value);
140
131
  });
141
132
  onMounted(() => {
142
133
  checkoutStore.getConfig();
143
134
  updateUserFieldsIfuserLogin(inputData.value.shippingasbilling);
144
- const cart = [];
145
- cart.items = checkoutStore.config.cart;
135
+ const cartInfo = [];
136
+ cartInfo.items = checkoutStore.config.cartInfo;
137
+ cartInfo.totals = checkoutStore?.config?.calculations ? checkoutStore?.config?.calculations : "";
138
+ let shippingmethods = checkoutStore.config.shippingmethods;
139
+ let shipping_method = shippingmethods.filter((method) => method.selected == true)[0];
146
140
  let deliverymethods = checkoutStore.config.preferences;
147
141
  let deliverymethod = false;
142
+ let delivery_method = deliverymethods.filter((method) => method.selected == true)[0];
143
+ if (delivery_method) {
144
+ if (delivery_method.id == 1) {
145
+ if (shipping_method) {
146
+ GTM_add_shipping_info(cartStore?.cart, shipping_method);
147
+ META_add_shipping_info(cartStore?.cart, shipping_method);
148
+ }
149
+ } else if (delivery_method.id == 2) {
150
+ shipping_method = {
151
+ "id": 0,
152
+ "title": "Click and Collect",
153
+ "details": "",
154
+ "available": 1,
155
+ "price": 0,
156
+ "selected": true
157
+ };
158
+ GTM_add_shipping_info(cartStore?.cart, shipping_method);
159
+ META_add_shipping_info(cartStore?.cart, shipping_method);
160
+ }
161
+ }
162
+ if (cartStore?.cart) {
163
+ GTM_begin_checkout(cartStore?.cart);
164
+ META_begin_checkout(cartStore?.cart);
165
+ TikTok_begin_checkout(cartStore?.cart);
166
+ GTM_add_payment_info(cartStore?.cart, inputData.value.paymentmethod);
167
+ META_add_payment_info(cartStore?.cart, inputData.value.paymentmethod);
168
+ TikTok_add_payment_info(cartStore?.cart, inputData.value.paymentmethod);
169
+ }
170
+ });
171
+ watch(() => cartStore?.cart, (newCartData) => {
172
+ if (newCartData) {
173
+ GTM_begin_checkout(newCartData);
174
+ META_begin_checkout(newCartData);
175
+ TikTok_begin_checkout(newCartData);
176
+ GTM_add_payment_info(cartStore?.cart, inputData.value.paymentmethod);
177
+ META_add_payment_info(cartStore?.cart, inputData.value.paymentmethod);
178
+ TikTok_add_payment_info(cartStore?.cart, inputData.value.paymentmethod);
179
+ }
148
180
  });
149
181
  const totalPrice = computed(() => {
150
182
  return checkoutStore.config ? checkoutStore.config?.calculations?.total : 0;
@@ -162,11 +194,11 @@ export default function() {
162
194
  }
163
195
  return states.value;
164
196
  });
165
- watch(inputData.value, async (newData, oldValue) => {
197
+ watch(() => inputData.value, async (newData, oldValue) => {
166
198
  });
167
199
  const shippingMethods = computed(() => {
168
200
  if (checkoutStore.config) {
169
- return checkoutStore.config.shippingmethods.filter((method) => method.available == 1);
201
+ return checkoutStore.config?.shippingmethods?.filter((method) => method.available == 1);
170
202
  }
171
203
  });
172
204
  watch(() => checkoutStore.config.shippingmethods, (newValue, oldValue) => {
@@ -212,28 +244,27 @@ export default function() {
212
244
  }
213
245
  };
214
246
  const CheckFlowrixPayment = ((inputData2, payment) => {
215
- let status2 = {};
216
- var data2 = {
247
+ let status = {};
248
+ var data = {
217
249
  card_holder: inputData2.till_cardname,
218
250
  month: inputData2.till_expirymonth,
219
251
  year: inputData2.till_expiryyear
220
252
  };
221
253
  payment.tokenize(
222
- data2,
223
- //additional data, MUST include card_holder (or first_name & last_name), month and year
224
- function(token, cardData) {
225
- inputData2.clientsceret = token;
226
- checkoutStore.publishableKey.clientsceret = token;
254
+ data,
255
+ function(token2, cardData) {
256
+ inputData2.clientsceret = token2;
257
+ checkoutStore.publishableKey.clientsceret = token2;
227
258
  checkoutStore.saveToCheckoutSession(inputData2);
228
- if (token != "") {
229
- status2 = {};
259
+ if (token2 != "") {
260
+ status = {};
230
261
  }
231
262
  },
232
263
  function(errors) {
233
- status2 = errors;
264
+ status = errors;
234
265
  }
235
266
  );
236
- return status2;
267
+ return status;
237
268
  });
238
269
  const handleSubmit = async (url_cancel, url_success, url_booking) => {
239
270
  try {
@@ -250,8 +281,7 @@ export default function() {
250
281
  return false;
251
282
  }
252
283
  }
253
- const LoggedInUser = "";
254
- if (Object.keys(LoggedInUser).length == 0) {
284
+ if (isAuthenticated) {
255
285
  sessiondata.value.fields.firstname = inputData.value.billing_firstname;
256
286
  sessiondata.value.fields.lastname = inputData.value.billing_lastname;
257
287
  }
@@ -266,8 +296,8 @@ export default function() {
266
296
  sessiondata.value.fields.eway_cardnumber = cardnumber;
267
297
  sessiondata.value.fields.eway_cvn = eway_cvn;
268
298
  }
269
- await checkoutStore.submitCheckout();
270
- if (checkoutStore.errorResponseData.status != "Error") {
299
+ const chckoutResponse = await checkoutStore.submitCheckout();
300
+ if (chckoutResponse.status == "Success") {
271
301
  if (inputData.value.paymentmethod == "web-stripe") {
272
302
  const { stripe, elements } = await getStripeElements(
273
303
  checkoutStore.publishableKey.key,
@@ -277,21 +307,21 @@ export default function() {
277
307
  const { error: error2 } = await stripe.confirmPayment({
278
308
  elements,
279
309
  confirmParams: {
280
- // Make sure to change this to your payment completion page
281
310
  return_url: checkoutStore.responseData.booking ? `${window.location.origin}${url_booking}?calendar=${checkoutStore.responseData.calendar}&order_no=${checkoutStore.responseData.order_no}` : `${window.location.origin}${url_success}`,
282
311
  receipt_email: inputData.value.email
283
312
  }
284
313
  });
285
314
  if (error2.type === "card_error" || error2.type === "validation_error") {
286
315
  showMessage(error2.message);
287
- } else {
288
316
  }
289
317
  } else {
290
318
  showMessage(error.message);
291
319
  }
292
- } else if (checkoutStore.response.data.url) {
293
- var url = checkoutStore.response.data.url;
320
+ } else if (chckoutResponse.data.url) {
321
+ var url = chckoutResponse.data.url;
322
+ window.location.href = url;
294
323
  } else {
324
+ window.location.href = url_success;
295
325
  }
296
326
  removeLoading();
297
327
  } else if (checkoutStore.errorResponseData.status == "Error") {
@@ -361,6 +391,7 @@ export default function() {
361
391
  step1Valid,
362
392
  step2Valid,
363
393
  PaymentMethods,
364
- ipLocation
394
+ ipLocation,
395
+ isAuthenticated
365
396
  };
366
397
  }
@@ -0,0 +1,43 @@
1
+ export default function (inputData: any): {
2
+ checkoutStore: import("pinia").Store<"checkout", import("../../stores/Checkout.js").CheckoutState, {}, {}>;
3
+ Countries: import("vue").Ref<never[], never[]>;
4
+ ChangeCountry: (billingfield: any) => Promise<void>;
5
+ States: import("vue").Ref<never[], never[]>;
6
+ getUserBillingAddresses: import("vue").ComputedRef<{
7
+ id: number;
8
+ fullname: string | null;
9
+ firstname: string;
10
+ middlename: string | null;
11
+ lastname: string;
12
+ address: string;
13
+ suburb: string;
14
+ state: string | null;
15
+ state_id: number | null;
16
+ country: string;
17
+ country_id: number;
18
+ postcode: string;
19
+ mobile: string;
20
+ shipping: number;
21
+ billing: number;
22
+ }[]>;
23
+ getPrimaryBillingAddress: import("vue").ComputedRef<{
24
+ id: number;
25
+ fullname: string | null;
26
+ firstname: string;
27
+ middlename: string | null;
28
+ lastname: string;
29
+ address: string;
30
+ suburb: string;
31
+ state: string | null;
32
+ state_id: number | null;
33
+ country: string;
34
+ country_id: number;
35
+ postcode: string;
36
+ mobile: string;
37
+ shipping: number;
38
+ billing: number;
39
+ } | null>;
40
+ fillBillingAddressFields: (billingAddress: any) => void;
41
+ handleBillingAddressSelect: (event: Event) => void;
42
+ updateBillingAddress: (billingfield: any) => void;
43
+ };
@@ -0,0 +1,84 @@
1
+ import { ref, computed, onMounted } from "vue";
2
+ import { useCheckoutStore } from "../../stores/Checkout.js";
3
+ import { useCountry } from "../Extras/useCountry.js";
4
+ import { useCompanyProfile } from "../../stores/useCompanyProfile.js";
5
+ import { useAuthStore } from "../../stores/auth.js";
6
+ export default function(inputData) {
7
+ const checkoutStore = useCheckoutStore();
8
+ const authStore = useAuthStore();
9
+ const CountryData = useCountry().data;
10
+ const States = ref([]);
11
+ const Countries = ref([]);
12
+ const getUserBillingAddresses = computed(() => {
13
+ if (!authStore.user || !authStore.user.addresses) return [];
14
+ return authStore.user.addresses.filter((address) => address.billing === 1);
15
+ });
16
+ const getPrimaryBillingAddress = computed(() => {
17
+ const billingAddresses = getUserBillingAddresses.value;
18
+ return billingAddresses.length > 0 ? billingAddresses[0] : null;
19
+ });
20
+ const GetStates = async (countryID) => {
21
+ return States.value;
22
+ };
23
+ onMounted(() => {
24
+ GetStates(inputData.billing_country);
25
+ if (authStore.isAuthenticated && getPrimaryBillingAddress.value) {
26
+ const billingAddr = getPrimaryBillingAddress.value;
27
+ inputData.billing_firstname = billingAddr.firstname || "";
28
+ inputData.billing_lastname = billingAddr.lastname || "";
29
+ inputData.billing_fullname = billingAddr.fullname || "";
30
+ inputData.billing_address = billingAddr.address || "";
31
+ inputData.billing_suburb = billingAddr.suburb || "";
32
+ inputData.billing_state = billingAddr.state_id || "";
33
+ inputData.billing_country = billingAddr.country_id || "";
34
+ inputData.billing_postcode = billingAddr.postcode || "";
35
+ inputData.billing_mobile = billingAddr.mobile || "";
36
+ inputData.billing_address_id = billingAddr.id || "";
37
+ updateBillingAddress(inputData);
38
+ }
39
+ });
40
+ const ChangeCountry = async (billingfield) => {
41
+ if (billingfield.billing_country == void 0) {
42
+ billingfield.billing_country = useCompanyProfile().profile.country_id;
43
+ }
44
+ let newstates = await GetStates(billingfield.billing_country);
45
+ checkoutStore.saveToCheckoutSession(billingfield);
46
+ };
47
+ const fillBillingAddressFields = (billingAddress) => {
48
+ if (!billingAddress) return;
49
+ inputData.billing_firstname = billingAddress.firstname || "";
50
+ inputData.billing_lastname = billingAddress.lastname || "";
51
+ inputData.billing_fullname = billingAddress.fullname || "";
52
+ inputData.billing_address = billingAddress.address || "";
53
+ inputData.billing_suburb = billingAddress.suburb || "";
54
+ inputData.billing_state = billingAddress.state_id || "";
55
+ inputData.billing_country = billingAddress.country_id || "";
56
+ inputData.billing_postcode = billingAddress.postcode || "";
57
+ inputData.billing_mobile = billingAddress.mobile || "";
58
+ inputData.billing_address_id = billingAddress.id || "";
59
+ updateBillingAddress(inputData);
60
+ };
61
+ const updateBillingAddress = ((billingfield) => {
62
+ checkoutStore.saveToCheckoutSession(billingfield);
63
+ });
64
+ const handleBillingAddressSelect = (event) => {
65
+ const selectedAddressId = event.target.value;
66
+ if (selectedAddressId) {
67
+ const selectedAddress = getUserBillingAddresses.value.find((addr) => addr.id == parseInt(selectedAddressId));
68
+ if (selectedAddress) {
69
+ fillBillingAddressFields(selectedAddress);
70
+ }
71
+ }
72
+ };
73
+ return {
74
+ checkoutStore,
75
+ Countries,
76
+ ChangeCountry,
77
+ States,
78
+ getUserBillingAddresses,
79
+ getPrimaryBillingAddress,
80
+ fillBillingAddressFields,
81
+ handleBillingAddressSelect,
82
+ updateBillingAddress
83
+ };
84
+ }
@@ -0,0 +1,55 @@
1
+ export default function (inputData: any): {
2
+ checkoutStore: import("pinia").Store<"checkout", import("../../stores/Checkout.js").CheckoutState, {}, {}>;
3
+ updateShippingAddress: (shippingfield: any) => void;
4
+ sameAsBilling: (sameasbilling: boolean | undefined, inputData: any) => Promise<void>;
5
+ UpdateStripe: (inputData: any) => Promise<void>;
6
+ Countries: import("vue").ComputedRef<any>;
7
+ ChangeCountry: (shippingfield: any) => Promise<void>;
8
+ States: import("vue").Ref<never[], never[]>;
9
+ getUserShippingAddresses: import("vue").ComputedRef<{
10
+ id: number;
11
+ fullname: string | null;
12
+ firstname: string;
13
+ middlename: string | null;
14
+ lastname: string;
15
+ address: string;
16
+ suburb: string;
17
+ state: string | null;
18
+ state_id: number | null;
19
+ country: string;
20
+ country_id: number;
21
+ postcode: string;
22
+ mobile: string;
23
+ shipping: number;
24
+ billing: number;
25
+ }[]>;
26
+ getPrimaryShippingAddress: import("vue").ComputedRef<{
27
+ id: number;
28
+ fullname: string | null;
29
+ firstname: string;
30
+ middlename: string | null;
31
+ lastname: string;
32
+ address: string;
33
+ suburb: string;
34
+ state: string | null;
35
+ state_id: number | null;
36
+ country: string;
37
+ country_id: number;
38
+ postcode: string;
39
+ mobile: string;
40
+ shipping: number;
41
+ billing: number;
42
+ } | null>;
43
+ passwordShow: import("vue").Ref<string, string>;
44
+ password: import("vue").Ref<string, string>;
45
+ password_confirmationShow: import("vue").Ref<string, string>;
46
+ updateBillingAddress: (billingfield: any) => void;
47
+ UserAccount: import("vue").Ref<boolean, boolean>;
48
+ CheckUserAccount: (billingDetails: any, userEmail: string) => Promise<void>;
49
+ CheckingUserAccount: import("vue").Ref<boolean, boolean>;
50
+ passwordStrength: import("vue").ComputedRef<"Password must be 8 characters" | "Strong" | "Medium" | "Weak">;
51
+ passwordStrengthClass: import("vue").ComputedRef<"bg-danger" | "bg-success" | "bg-warning">;
52
+ passwordStrengthValue: import("vue").ComputedRef<number>;
53
+ passwordStrengthWidth: import("vue").ComputedRef<string>;
54
+ passwordStrengthTextColor: import("vue").ComputedRef<"text-danger" | "text-success" | "text-black">;
55
+ };
@@ -0,0 +1,196 @@
1
+ import { ref, computed, onMounted } from "vue";
2
+ import { useCheckoutStore } from "../../stores/Checkout.js";
3
+ import { useCountry } from "../Extras/useCountry.js";
4
+ import { useCompanyProfile } from "../../stores/useCompanyProfile.js";
5
+ import useStripe from "./PaymentMethods/useStripe.js";
6
+ import { useAuthStore } from "../../stores/auth.js";
7
+ import { usePasswordFormatter } from "../Extras/usePasswordFormatter.js";
8
+ export default function(inputData) {
9
+ const authStore = useAuthStore();
10
+ const checkoutStore = useCheckoutStore();
11
+ const CountryData = useCountry().data;
12
+ const Countries = computed(() => CountryData.countries);
13
+ const States = ref([]);
14
+ const passwordShow = ref("password");
15
+ const password = ref("");
16
+ const password_confirmationShow = ref("password");
17
+ const UserAccount = ref(true);
18
+ const timeout = ref("");
19
+ const CheckingUserAccount = ref(false);
20
+ const { passwordStrength, passwordStrengthClass, passwordStrengthValue, passwordStrengthWidth, passwordStrengthTextColor } = usePasswordFormatter(password, inputData);
21
+ const getUserShippingAddresses = computed(() => {
22
+ if (!authStore.user || !authStore.user.addresses) return [];
23
+ return authStore.user.addresses.filter(
24
+ (address) => address.shipping === 1 || address.shipping === 1 && address.billing === 1
25
+ );
26
+ });
27
+ const getPrimaryShippingAddress = computed(() => {
28
+ const shippingAddresses = getUserShippingAddresses.value;
29
+ return shippingAddresses.length > 0 ? shippingAddresses[0] : null;
30
+ });
31
+ const getUserBillingAddress = computed(() => {
32
+ if (!authStore.user || !authStore.user.addresses) return null;
33
+ const billingAddress = authStore.user.addresses.find((address) => address.billing === 1);
34
+ if (billingAddress) return billingAddress;
35
+ return authStore.user.addresses[0] || null;
36
+ });
37
+ const GetStates = async (countryID) => {
38
+ return States.value;
39
+ };
40
+ onMounted(() => {
41
+ GetStates(inputData.shipping_country);
42
+ if (authStore.isAuthenticated && getPrimaryShippingAddress.value) {
43
+ const shippingAddr = getPrimaryShippingAddress.value;
44
+ inputData.shipping_fullname = shippingAddr.fullname || "";
45
+ inputData.shipping_firstname = shippingAddr.firstname || "";
46
+ inputData.shipping_lastname = shippingAddr.lastname || "";
47
+ inputData.shipping_address = shippingAddr.address || "";
48
+ inputData.shipping_suburb = shippingAddr.suburb || "";
49
+ inputData.shipping_state = shippingAddr.state_id || "";
50
+ inputData.shipping_country = shippingAddr.country_id || "";
51
+ inputData.shipping_postcode = shippingAddr.postcode || "";
52
+ inputData.shipping_mobile = shippingAddr.mobile || "";
53
+ inputData.shipping_address_id = shippingAddr.id || "";
54
+ updateShippingAddress(inputData);
55
+ }
56
+ });
57
+ const ChangeCountry = async (shippingfield) => {
58
+ if (shippingfield.shipping_country == void 0) {
59
+ shippingfield.shipping_country = useCompanyProfile().profile.country_id;
60
+ }
61
+ let newstates = await GetStates(shippingfield.shipping_country);
62
+ checkoutStore.saveToCheckoutSession(shippingfield);
63
+ };
64
+ const updateShippingAddress = ((shippingfield) => {
65
+ checkoutStore.saveToCheckoutSession(shippingfield);
66
+ });
67
+ const CheckUserAccount = (async (billingDetails, userEmail) => {
68
+ if (timeout.value) {
69
+ clearTimeout(timeout.value);
70
+ }
71
+ timeout.value = setTimeout(async () => {
72
+ billingDetails.register = false;
73
+ billingDetails.password = "";
74
+ billingDetails.password_confirmation = "";
75
+ if (userEmail != "") {
76
+ CheckingUserAccount.value = true;
77
+ await checkoutStore.CheckUserAccount(userEmail);
78
+ if (checkoutStore.checkCustomer.status == "Error") {
79
+ UserAccount.value = true;
80
+ } else {
81
+ UserAccount.value = false;
82
+ }
83
+ } else {
84
+ UserAccount.value = true;
85
+ }
86
+ CheckingUserAccount.value = false;
87
+ }, 1e3);
88
+ });
89
+ const updateBillingAddress = ((billingfield) => {
90
+ if (billingfield.register == false) {
91
+ billingfield.password = "";
92
+ billingfield.password_confirmation = "";
93
+ }
94
+ checkoutStore.saveToCheckoutSession(billingfield);
95
+ });
96
+ const sameAsBilling = (async (sameasbilling = false, inputData2) => {
97
+ const isAuthenticated = authStore.isAuthenticated;
98
+ if (isAuthenticated) {
99
+ const billingAddress = getUserBillingAddress.value;
100
+ const shippingAddress = getPrimaryShippingAddress.value;
101
+ inputData2.billing_firstname = authStore.user?.firstname || "";
102
+ inputData2.billing_lastname = authStore.user?.lastname || "";
103
+ inputData2.email = authStore.user?.email || "";
104
+ inputData2.billing_mobile = authStore.user?.mobile || "";
105
+ if (sameasbilling == true) {
106
+ inputData2.billing_firstname = inputData2.shipping_firstname || billingAddress?.firstname || "";
107
+ inputData2.billing_lastname = inputData2.shipping_lastname || billingAddress?.lastname || "";
108
+ inputData2.billing_address = inputData2.shipping_address || billingAddress?.address || "";
109
+ inputData2.billing_postcode = inputData2.shipping_postcode || billingAddress?.postcode || "";
110
+ inputData2.billing_state = inputData2.shipping_state || billingAddress?.state_id || "";
111
+ inputData2.billing_suburb = inputData2.shipping_suburb || billingAddress?.suburb || "";
112
+ inputData2.billing_mobile = inputData2.shipping_mobile || billingAddress?.mobile || "";
113
+ } else {
114
+ if (billingAddress) {
115
+ inputData2.billing_firstname = inputData2.billing_firstname || billingAddress.firstname || "";
116
+ inputData2.billing_lastname = inputData2.billing_lastname || billingAddress.lastname || "";
117
+ inputData2.billing_address = inputData2.billing_address || billingAddress.address || "";
118
+ inputData2.billing_postcode = inputData2.billing_postcode || billingAddress.postcode || "";
119
+ inputData2.billing_state = inputData2.billing_state || billingAddress.state_id || "";
120
+ inputData2.billing_suburb = inputData2.billing_suburb || billingAddress.suburb || "";
121
+ inputData2.billing_mobile = inputData2.billing_mobile || billingAddress.mobile || "";
122
+ }
123
+ if (shippingAddress) {
124
+ inputData2.shipping_fullname = shippingAddress.fullname || "";
125
+ inputData2.shipping_firstname = shippingAddress.firstname || "";
126
+ inputData2.shipping_lastname = shippingAddress.lastname || "";
127
+ inputData2.shipping_address = shippingAddress.address || "";
128
+ inputData2.shipping_postcode = shippingAddress.postcode || "";
129
+ inputData2.shipping_state = shippingAddress.state_id || "";
130
+ inputData2.shipping_suburb = shippingAddress.suburb || "";
131
+ inputData2.shipping_mobile = shippingAddress.mobile || "";
132
+ inputData2.shipping_address_id = shippingAddress.id || "";
133
+ } else {
134
+ inputData2.shipping_fullname = "";
135
+ inputData2.shipping_firstname = "";
136
+ inputData2.shipping_lastname = "";
137
+ inputData2.shipping_address = "";
138
+ inputData2.shipping_postcode = "";
139
+ inputData2.shipping_state = "";
140
+ inputData2.shipping_suburb = "";
141
+ inputData2.shipping_mobile = "";
142
+ }
143
+ }
144
+ } else if (!isAuthenticated && sameasbilling == true) {
145
+ inputData2.shipping_firstname = inputData2.billing_firstname || "";
146
+ inputData2.shipping_lastname = inputData2.billing_lastname || "";
147
+ inputData2.shipping_address = inputData2.billing_address || "";
148
+ inputData2.shipping_postcode = inputData2.billing_postcode || "";
149
+ inputData2.shipping_state = inputData2.billing_state || "";
150
+ inputData2.shipping_suburb = inputData2.billing_suburb || "";
151
+ inputData2.shipping_mobile = inputData2.billing_mobile || "";
152
+ } else {
153
+ inputData2.shipping_fullname = "";
154
+ inputData2.shipping_firstname = "";
155
+ inputData2.shipping_lastname = "";
156
+ inputData2.shipping_address = "";
157
+ inputData2.shipping_postcode = "";
158
+ inputData2.shipping_state = "";
159
+ inputData2.shipping_suburb = "";
160
+ inputData2.shipping_mobile = "";
161
+ }
162
+ UpdateStripe(inputData2);
163
+ updateShippingAddress(inputData2);
164
+ });
165
+ const UpdateStripe = (async (inputData2) => {
166
+ await checkoutStore.saveToCheckoutSession(inputData2);
167
+ const { getpaymentMethod } = useStripe();
168
+ const totalPrice = computed(() => {
169
+ return checkoutStore.config ? checkoutStore.config.calculations.total : checkoutStore.config.total;
170
+ });
171
+ getpaymentMethod("web-stripe", inputData2, totalPrice.value);
172
+ });
173
+ return {
174
+ checkoutStore,
175
+ updateShippingAddress,
176
+ sameAsBilling,
177
+ UpdateStripe,
178
+ Countries,
179
+ ChangeCountry,
180
+ States,
181
+ getUserShippingAddresses,
182
+ getPrimaryShippingAddress,
183
+ passwordShow,
184
+ password,
185
+ password_confirmationShow,
186
+ updateBillingAddress,
187
+ UserAccount,
188
+ CheckUserAccount,
189
+ CheckingUserAccount,
190
+ passwordStrength,
191
+ passwordStrengthClass,
192
+ passwordStrengthValue,
193
+ passwordStrengthWidth,
194
+ passwordStrengthTextColor
195
+ };
196
+ }
@@ -1,5 +1,5 @@
1
- export default function (): {
2
- checkoutStore: any;
1
+ export default function (inputData: any): {
2
+ checkoutStore: import("pinia").Store<"checkout", import("../../stores/Checkout.js").CheckoutState, {}, {}>;
3
3
  passwordShow: import("vue").Ref<string, string>;
4
4
  password: import("vue").Ref<string, string>;
5
5
  password_confirmationShow: import("vue").Ref<string, string>;
@@ -7,9 +7,9 @@ export default function (): {
7
7
  UserAccount: import("vue").Ref<boolean, boolean>;
8
8
  CheckUserAccount: (billingDetails: any, userEmail: string) => Promise<void>;
9
9
  CheckingUserAccount: import("vue").Ref<boolean, boolean>;
10
- passwordStrength: any;
11
- passwordStrengthClass: any;
12
- passwordStrengthValue: any;
13
- passwordStrengthWidth: any;
14
- passwordStrengthTextColor: any;
10
+ passwordStrength: import("vue").ComputedRef<"Password must be 8 characters" | "Strong" | "Medium" | "Weak">;
11
+ passwordStrengthClass: import("vue").ComputedRef<"bg-danger" | "bg-success" | "bg-warning">;
12
+ passwordStrengthValue: import("vue").ComputedRef<number>;
13
+ passwordStrengthWidth: import("vue").ComputedRef<string>;
14
+ passwordStrengthTextColor: import("vue").ComputedRef<"text-danger" | "text-success" | "text-black">;
15
15
  };
@@ -1,5 +1,7 @@
1
1
  import { ref } from "vue";
2
- export default function() {
2
+ import { useCheckoutStore } from "../../stores/Checkout.js";
3
+ import { usePasswordFormatter } from "../Extras/usePasswordFormatter.js";
4
+ export default function(inputData) {
3
5
  const checkoutStore = useCheckoutStore();
4
6
  const passwordShow = ref("password");
5
7
  const password = ref("");
@@ -1,4 +1,4 @@
1
- export default function (): {
2
- checkoutStore: any;
1
+ export default function (inputData: any): {
2
+ checkoutStore: import("pinia").Store<"checkout", import("../../stores/Checkout.js").CheckoutState, {}, {}>;
3
3
  updateDeliveryMethod: (inputData: any) => Promise<void>;
4
4
  };