@osimart/create-storefront 1.0.2 → 1.0.4
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/app/app.vue +0 -1
- package/app/composables/useCheckout.js +927 -48
- package/app/pages/checkout.vue +370 -1242
- package/app/services/CheckoutServices.js +7 -5
- package/nuxt.config.ts +7 -1
- package/package.json +1 -1
|
@@ -59,16 +59,18 @@ const getOrder = async (orderId) => {
|
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
const
|
|
62
|
+
const applyPromoCode = async (code) => {
|
|
63
63
|
try {
|
|
64
64
|
const baseUrl = getBaseUrl();
|
|
65
65
|
const responseData = await apiService(
|
|
66
|
-
`${baseUrl}store/apis/promocodes
|
|
67
|
-
{
|
|
66
|
+
`${baseUrl}store/apis/promocodes/apply/`,
|
|
67
|
+
{ method: "POST",
|
|
68
|
+
headers: cartHeaders(),
|
|
69
|
+
body: JSON.stringify({ code }), },
|
|
68
70
|
);
|
|
69
71
|
return responseData;
|
|
70
72
|
} catch (error) {
|
|
71
|
-
console.error("Promo
|
|
73
|
+
console.error("Promo apply error:", error);
|
|
72
74
|
throw error;
|
|
73
75
|
}
|
|
74
76
|
};
|
|
@@ -107,7 +109,7 @@ export default {
|
|
|
107
109
|
fetchCart,
|
|
108
110
|
placeOrder,
|
|
109
111
|
getOrder,
|
|
110
|
-
|
|
112
|
+
applyPromoCode,
|
|
111
113
|
freeDeliveries,
|
|
112
114
|
extraFees,
|
|
113
115
|
};
|
package/nuxt.config.ts
CHANGED
|
@@ -22,7 +22,13 @@ const appDir = fileURLToPath(new URL("./app", import.meta.url));
|
|
|
22
22
|
|
|
23
23
|
export default defineNuxtConfig({
|
|
24
24
|
compatibilityDate: "2025-07-15",
|
|
25
|
-
|
|
25
|
+
app: {
|
|
26
|
+
head: {
|
|
27
|
+
meta: [
|
|
28
|
+
{ name: "viewport", content: "width=device-width, initial-scale=1" }
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
26
32
|
alias: {
|
|
27
33
|
"#osi": appDir,
|
|
28
34
|
"#logic": `${appDir}/logic`,
|
package/package.json
CHANGED