flowrix 1.0.1-beta.118 → 1.0.1-beta.119
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/dist/module.json +1 -1
- package/dist/runtime/composables/Checkout/useCheckout.d.ts +1 -0
- package/dist/runtime/composables/Checkout/useCheckout.js +2 -19
- package/dist/runtime/composables/Product/useProductComponent.js +31 -12
- package/dist/runtime/stores/Checkout.js +2 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -105,15 +105,6 @@ export default function() {
|
|
|
105
105
|
inputData.value.billing_mobile = inputData.value.billing_mobile ? inputData.value.billing_mobile : billingAddres.mobile;
|
|
106
106
|
}
|
|
107
107
|
if (shippingAddres != void 0) {
|
|
108
|
-
inputData.value.shipping_fullname = "";
|
|
109
|
-
inputData.value.shipping_firstname = "";
|
|
110
|
-
inputData.value.shipping_lastname = "";
|
|
111
|
-
inputData.value.shipping_address = "";
|
|
112
|
-
inputData.value.shipping_postcode = "";
|
|
113
|
-
inputData.value.shipping_state = "";
|
|
114
|
-
inputData.value.shipping_country = "";
|
|
115
|
-
inputData.value.shipping_suburb = "";
|
|
116
|
-
inputData.value.shipping_mobile = "";
|
|
117
108
|
inputData.value.shipping_fullname = shippingAddres.fullname;
|
|
118
109
|
inputData.value.shipping_firstname = shippingAddres.firstname;
|
|
119
110
|
inputData.value.shipping_lastname = shippingAddres.lastname;
|
|
@@ -135,15 +126,6 @@ export default function() {
|
|
|
135
126
|
inputData.value.shipping_suburb = inputData.value.billing_suburb ? inputData.value.billing_suburb : "";
|
|
136
127
|
inputData.value.shipping_mobile = inputData.value.billing_mobile ? inputData.value.billing_mobile : "";
|
|
137
128
|
} else {
|
|
138
|
-
inputData.value.shipping_fullname = "";
|
|
139
|
-
inputData.value.shipping_firstname = "";
|
|
140
|
-
inputData.value.shipping_lastname = "";
|
|
141
|
-
inputData.value.shipping_address = "";
|
|
142
|
-
inputData.value.shipping_postcode = "";
|
|
143
|
-
inputData.value.shipping_state = "";
|
|
144
|
-
inputData.value.shipping_country = "";
|
|
145
|
-
inputData.value.shipping_suburb = "";
|
|
146
|
-
inputData.value.shipping_mobile = "";
|
|
147
129
|
}
|
|
148
130
|
checkoutStore.saveToCheckoutSession(inputData.value);
|
|
149
131
|
});
|
|
@@ -409,6 +391,7 @@ export default function() {
|
|
|
409
391
|
step1Valid,
|
|
410
392
|
step2Valid,
|
|
411
393
|
PaymentMethods,
|
|
412
|
-
ipLocation
|
|
394
|
+
ipLocation,
|
|
395
|
+
isAuthenticated
|
|
413
396
|
};
|
|
414
397
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { defineAsyncComponent } from "vue";
|
|
2
|
-
import { useHead } from "#imports";
|
|
2
|
+
import { useHead, useRequestEvent, useRoute } from "#imports";
|
|
3
|
+
import { getRequestURL } from "h3";
|
|
3
4
|
import { GTM_view_item } from "../useDataLayer.js";
|
|
4
5
|
import { META_view_item } from "../useMetaLayer.js";
|
|
5
6
|
import { TikTok_view_item } from "../useTikTokDatalayer.js";
|
|
6
7
|
import { useCompanyProfile } from "../../stores/useCompanyProfile.js";
|
|
7
8
|
export function useProductComponent(product) {
|
|
9
|
+
const route = useRoute();
|
|
8
10
|
const templateName = "Template-" + product.template;
|
|
9
11
|
const companyProfile = useCompanyProfile();
|
|
10
12
|
const components = import.meta.glob(
|
|
@@ -21,6 +23,13 @@ export function useProductComponent(product) {
|
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
});
|
|
26
|
+
let websiteurl = "";
|
|
27
|
+
if (process.server) {
|
|
28
|
+
const event = useRequestEvent();
|
|
29
|
+
websiteurl = getRequestURL(event).origin;
|
|
30
|
+
} else {
|
|
31
|
+
websiteurl = window.location.origin;
|
|
32
|
+
}
|
|
24
33
|
const ifPromotioned = () => {
|
|
25
34
|
if (product.rpfloat > product.pricefloat) {
|
|
26
35
|
return {
|
|
@@ -71,7 +80,17 @@ export function useProductComponent(product) {
|
|
|
71
80
|
{
|
|
72
81
|
name: "description",
|
|
73
82
|
content: product?.meta_description || ""
|
|
74
|
-
}
|
|
83
|
+
},
|
|
84
|
+
{ property: "og:title", content: product?.meta_title || product?.name || "" },
|
|
85
|
+
{ property: "og:description", content: product?.meta_description },
|
|
86
|
+
{ property: "og:type", content: "website" },
|
|
87
|
+
{ property: "og:url", content: `${websiteurl}${route.path}` },
|
|
88
|
+
{ property: "og:image", content: product?.image },
|
|
89
|
+
// Optional but recommended
|
|
90
|
+
{ name: "twitter:card", content: "summary_large_image" },
|
|
91
|
+
{ name: "twitter:title", content: product?.meta_title || product?.name || "" },
|
|
92
|
+
{ name: "twitter:description", content: product?.meta_description },
|
|
93
|
+
{ name: "twitter:image", content: product?.image }
|
|
75
94
|
],
|
|
76
95
|
script: [
|
|
77
96
|
{
|
|
@@ -80,21 +99,21 @@ export function useProductComponent(product) {
|
|
|
80
99
|
children: JSON.stringify({
|
|
81
100
|
"@context": "https://schema.org/",
|
|
82
101
|
"@type": "Product",
|
|
83
|
-
"name": product
|
|
102
|
+
"name": product?.name || "",
|
|
84
103
|
"image": [
|
|
85
|
-
product
|
|
104
|
+
product?.image || ""
|
|
86
105
|
],
|
|
87
|
-
"description": product
|
|
88
|
-
"sku": product
|
|
106
|
+
"description": product?.description || "",
|
|
107
|
+
"sku": product?.sku || "",
|
|
89
108
|
"brand": {
|
|
90
109
|
"@type": "Brand",
|
|
91
|
-
"name": product
|
|
110
|
+
"name": product?.brand || ""
|
|
92
111
|
},
|
|
93
112
|
"offers": {
|
|
94
113
|
"@type": "Offer",
|
|
95
|
-
"url":
|
|
114
|
+
"url": `${websiteurl}${route.path}`,
|
|
96
115
|
"priceCurrency": companyProfile.profile?.data?.currencyCode || "",
|
|
97
|
-
"price": product
|
|
116
|
+
"price": product?.pricefloat || 0,
|
|
98
117
|
"availability": "https://schema.org/InStock",
|
|
99
118
|
"itemCondition": "https://schema.org/NewCondition",
|
|
100
119
|
...ifPromotioned()
|
|
@@ -103,9 +122,9 @@ export function useProductComponent(product) {
|
|
|
103
122
|
}
|
|
104
123
|
]
|
|
105
124
|
});
|
|
106
|
-
GTM_view_item(product, product
|
|
107
|
-
META_view_item(product, product
|
|
108
|
-
TikTok_view_item(product, product
|
|
125
|
+
GTM_view_item(product, product?.rrpfloat, product?.rpfloat);
|
|
126
|
+
META_view_item(product, product?.rrpfloat, product?.rpfloat);
|
|
127
|
+
TikTok_view_item(product, product?.rrpfloat, product?.rpfloat);
|
|
109
128
|
return {
|
|
110
129
|
Template
|
|
111
130
|
};
|
|
@@ -132,6 +132,8 @@ export const useCheckoutStore = defineStore("checkout", {
|
|
|
132
132
|
const formData = this.checkoutSession.fields || {};
|
|
133
133
|
const apiUrl = `customer/checkout`;
|
|
134
134
|
formData.billing_address2 = formData.billing_address;
|
|
135
|
+
delete formData.fields;
|
|
136
|
+
delete formData.calculations;
|
|
135
137
|
const config = useRuntimeConfig();
|
|
136
138
|
const response = await flowrixApi.post(apiUrl, config, { body: formData });
|
|
137
139
|
if (response?.data?.order || response?.data?.order_no) {
|