@viur/shop-components 0.0.1-dev.6 → 0.0.1-dev.61

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 (131) hide show
  1. package/.editorconfig +16 -0
  2. package/.github/workflows/npm-publish.yml +42 -0
  3. package/.gitmodules +3 -0
  4. package/LICENSE +21 -0
  5. package/README.md +13 -2
  6. package/old/client/HttpClient.js +111 -0
  7. package/old/client/ViURShopClient.js +472 -0
  8. package/old/client/index.js +23 -0
  9. package/old/client/types.js +10 -0
  10. package/old/components/ExampleUsage.vue +95 -0
  11. package/old/components/ShopCart.vue +91 -0
  12. package/old/components/ShopOrderComplete.vue +73 -0
  13. package/old/components/ShopOrderConfirm.vue +311 -0
  14. package/old/components/ShopOrderStepper.vue +352 -0
  15. package/old/components/ShopPaymentProvider.vue +113 -0
  16. package/old/components/ShopShippingMethod.vue +52 -0
  17. package/old/components/ShopSummary.vue +138 -0
  18. package/old/components/ShopUserData.vue +218 -0
  19. package/old/components/cart/CartLeaf.vue +277 -0
  20. package/old/components/cart/CartLeafModel.vue +312 -0
  21. package/old/components/cart/CartNode.vue +26 -0
  22. package/old/components/cart/CartTree.vue +67 -0
  23. package/old/components/cart/CartTreeWrapper.vue +73 -0
  24. package/old/components/cart/CartView.vue +82 -0
  25. package/old/components/cart/Discount.vue +91 -0
  26. package/old/components/generic/loadinghandler.vue +76 -0
  27. package/old/components/paymentProvider/paypalplus.vue +0 -0
  28. package/old/components/paymentProvider/prepayment.vue +0 -0
  29. package/old/components/paymentProvider/unzerPayment.vue +140 -0
  30. package/old/components/simple/ShopUserData.vue +161 -0
  31. package/old/components/simple/SimpleDefaultLayout.vue +116 -0
  32. package/old/components/ui/generic/CardSelector.vue +52 -0
  33. package/old/components/ui/generic/CartList.vue +69 -0
  34. package/old/components/ui/generic/ShippingInfo.vue +56 -0
  35. package/old/components/ui/generic/ShopPriceFormatter.vue +41 -0
  36. package/old/components/ui/generic/alerts/ShopAlert.vue +30 -0
  37. package/old/components/ui/payment/PaymentOption.vue +79 -0
  38. package/old/components/ui/payment/PaymentSelector.vue +158 -0
  39. package/old/components/ui/stepper/StepperItem.vue +90 -0
  40. package/old/components/ui/stepper/StepperTab.vue +161 -0
  41. package/old/components/ui/stepper/StepperTrigger.vue +69 -0
  42. package/old/components/ui/userdata/AddForm.vue +160 -0
  43. package/old/components/ui/userdata/AddressBox.vue +137 -0
  44. package/old/components/ui/userdata/BaseLayout.vue +77 -0
  45. package/old/components/ui/userdata/CustomBooleanBone.vue +58 -0
  46. package/old/components/ui/userdata/CustomSelectBone.vue +91 -0
  47. package/old/components/ui/userdata/CustomStringBone.vue +71 -0
  48. package/old/components/ui/userdata/DefaultLayout.vue +126 -0
  49. package/old/components/ui/userdata/SelectAddress.vue +21 -0
  50. package/old/components/ui/userdata/multi/ActionBar.vue +38 -0
  51. package/old/components/ui/userdata/multi/CartSelection.vue +42 -0
  52. package/old/ignite/.editorconfig +20 -0
  53. package/old/ignite/.github/workflows/ignite.yml +64 -0
  54. package/old/ignite/.github/workflows/node.yml +30 -0
  55. package/old/ignite/.postcssrc.cjs +25 -0
  56. package/old/ignite/CHANGELOG.md +244 -0
  57. package/old/ignite/LICENSE +21 -0
  58. package/old/ignite/README.md +92 -0
  59. package/old/ignite/dist/ignite.css +2019 -0
  60. package/old/ignite/dist/ignite.min.css +4 -0
  61. package/old/ignite/foundation/basic.css +371 -0
  62. package/old/ignite/foundation/color.css +323 -0
  63. package/old/ignite/foundation/config.css +188 -0
  64. package/old/ignite/foundation/grid.css +78 -0
  65. package/old/ignite/foundation/mediaqueries.css +71 -0
  66. package/old/ignite/foundation/reset.css +261 -0
  67. package/old/ignite/ignite.css +29 -0
  68. package/old/ignite/ignite.css.map +1 -0
  69. package/old/ignite/package-lock.json +5530 -0
  70. package/old/ignite/package.json +58 -0
  71. package/old/ignite/shoelace.css +19 -0
  72. package/old/ignite/themes/dark.css +12 -0
  73. package/old/ignite/themes/light.css +11 -0
  74. package/old/ignite/utilities/shoelace.css +537 -0
  75. package/old/ignite/utilities/utilities.css +24 -0
  76. package/old/stores/address.js +122 -0
  77. package/old/stores/cart.js +266 -0
  78. package/old/stores/message.js +21 -0
  79. package/old/stores/order.js +202 -0
  80. package/old/stores/payment.js +79 -0
  81. package/old/stores/shipping.js +78 -0
  82. package/package.json +23 -23
  83. package/src/Shop.vue +212 -0
  84. package/src/ShopOrderStepper.vue +89 -0
  85. package/src/ShopSummary.vue +170 -0
  86. package/src/Steps/ShopCart.vue +60 -0
  87. package/src/Steps/ShopOrderComplete.vue +24 -0
  88. package/src/Steps/ShopOrderConfirm.vue +295 -0
  89. package/src/Steps/ShopPaymentProvider.vue +53 -0
  90. package/src/Steps/ShopShippingMethod.vue +53 -0
  91. package/src/Steps/ShopUserDataGuest.vue +78 -0
  92. package/src/Steps/index.js +15 -0
  93. package/src/components/AddressForm.vue +84 -0
  94. package/src/components/AddressFormLayout.vue +107 -0
  95. package/src/components/CardSelector.vue +68 -0
  96. package/src/components/CartItem.vue +325 -0
  97. package/src/components/CartItemSmall.vue +257 -0
  98. package/src/components/LoadingHandler.vue +76 -0
  99. package/src/components/PaymentOption.vue +78 -0
  100. package/src/components/PaymentProviderUnzer.vue +201 -0
  101. package/src/components/PaymentSelector.vue +55 -0
  102. package/src/components/ShopAlert.vue +30 -0
  103. package/src/components/StepperTab.vue +132 -0
  104. package/src/components/dialogButton.vue +49 -0
  105. package/src/composables/address.js +95 -0
  106. package/src/composables/cart.js +132 -0
  107. package/src/composables/order.js +80 -0
  108. package/src/composables/payment.js +75 -0
  109. package/src/composables/shipping.js +32 -0
  110. package/src/main.js +44 -0
  111. package/src/shop.js +251 -0
  112. package/src/translations/de.js +15 -0
  113. package/src/translations/en.js +5 -0
  114. package/src/utils.js +49 -0
  115. package/vite.config.js +51 -0
  116. package/src/components/cart/CartView.vue +0 -692
  117. package/src/components/cart/ConfirmView.vue +0 -314
  118. package/src/components/order/category/CategoryList.vue +0 -83
  119. package/src/components/order/category/CategoryView.vue +0 -143
  120. package/src/components/order/information/UserInfoMulti.vue +0 -427
  121. package/src/components/order/information/UserInformation.vue +0 -332
  122. package/src/components/order/information/adress/ShippingAdress.vue +0 -143
  123. package/src/components/order/item/ItemCard.vue +0 -168
  124. package/src/components/order/item/ItemView.vue +0 -233
  125. package/src/components/order/process/ExampleUsage.vue +0 -100
  126. package/src/components/order/process/OrderComplete.vue +0 -41
  127. package/src/components/order/process/OrderTabHeader.vue +0 -7
  128. package/src/components/order/process/OrderView.vue +0 -210
  129. package/src/router/index.js +0 -103
  130. package/src/stores/cart.js +0 -111
  131. package/src/views/ViewMissing.vue +0 -20
@@ -0,0 +1,78 @@
1
+ import { reactive, computed, watch } from "vue";
2
+ import { defineStore } from "pinia";
3
+ import { Request } from "@viur/vue-utils";
4
+ import {useCartStore} from "./cart";
5
+ import { useOrderStore } from './order';
6
+
7
+ export const useShippingStore = defineStore("shop-shipping", () => {
8
+ const cartStore = useCartStore()
9
+ const orderStore = useOrderStore()
10
+
11
+ const state = reactive({
12
+ shippingData: [], //shippingoptions
13
+ selectedShippingMethod:null,
14
+ isLoading:false,
15
+ isUpdating:false,
16
+ hasError:false,
17
+ errorMessage:"",
18
+ init:true //fetch onMount or store is ready
19
+ })
20
+
21
+ async function getShippingData() {
22
+ state.shippingSelection = null
23
+ state.isLoading = true
24
+ state.isUpdating = false
25
+ state.hasError = false
26
+ try{
27
+ state.shippingData = await cartStore.state.shopClient.shipping_list({
28
+ cart_key: cartStore.state.currentbasketKey,
29
+ })
30
+ state.isLoading = false
31
+ if(state.shippingData.length===0){
32
+ state.hasError = true
33
+ state.errorMessage = "Keine gültige Versandart gefunden."
34
+ }
35
+ } catch (error) {
36
+ state.isLoading = false
37
+ state.hasError = true
38
+ state.errorMessage = "Keine gültige Versandart gefunden."
39
+ }
40
+ }
41
+
42
+ async function updateCart(){
43
+ if (!state.selectedShippingMethod) return false
44
+ let result = await cartStore.state.shopClient.cart_update({
45
+ cart_key: orderStore.state.currentOrder.cart.dest.key,
46
+ shipping_key: state.selectedShippingMethod['dest']['key']
47
+ })
48
+ if (!result?.['shipping']){
49
+ return false
50
+ }
51
+ return true
52
+ }
53
+
54
+
55
+ async function initShipping(){
56
+ if (! state.init) return false
57
+
58
+ await cartStore.init() // ensure store config starts loading
59
+ if (cartStore.state.isReady){
60
+ await getShippingData() // request shipping data based on current cart
61
+ }
62
+
63
+ return true
64
+ }
65
+
66
+ watch(()=>cartStore.state.isReady, async(newVal, oldVal)=>{
67
+ if (state.init){
68
+ await getShippingData() // auto fetch if shop is ready
69
+ }
70
+ })
71
+
72
+ return {
73
+ state,
74
+ getShippingData,
75
+ initShipping,
76
+ updateCart
77
+ }
78
+ })
package/package.json CHANGED
@@ -1,12 +1,7 @@
1
1
  {
2
2
  "name": "@viur/shop-components",
3
- "version": "0.0.1-dev.6",
3
+ "version": "0.0.1-dev.61",
4
4
  "description": "Frontend Vue components for the shop module of ViUR",
5
- "scripts": {
6
- "build": "vite build",
7
- "dev": "vite",
8
- "serve": "vite preview"
9
- },
10
5
  "repository": {
11
6
  "type": "git",
12
7
  "url": "git+https://github.com/viur-framework/shop-components.git"
@@ -22,24 +17,29 @@
22
17
  "url": "https://github.com/viur-framework/shop-components/issues"
23
18
  },
24
19
  "homepage": "https://github.com/viur-framework/shop-components#readme",
25
- "devDependencies": {
26
- "@vitejs/plugin-vue": "^5.0.3",
27
- "postcss-custom-media": "^10.0.0",
28
- "postcss-nesting": "^12.0.0",
29
- "rollup-plugin-copy": "^3.4.0",
30
- "rollup-plugin-visualizer": "^5.9.2",
31
- "typescript": "^5.1.6",
32
- "vite": "^5.2.8",
33
- "prettier": "^3.2.5",
34
- "vue-tsc": "^2.0.17"
20
+ "main": "src/main.js",
21
+ "scripts": {
22
+ "build": "vite build",
23
+ "watch": "vite build --watch"
35
24
  },
36
25
  "dependencies": {
37
- "@viur/ignite": "^5.0.2",
38
- "@viur/shoelace": "^1.0.6-v2.15.0",
39
- "@viur/vue-utils": "^1.4.5",
40
- "pinia": "^2.1.7",
41
- "vue": "^3.4.27",
42
- "vue-i18n": "^9.13.1",
43
- "vue-router": "^4.3.2"
26
+ "@tanstack/vue-table": "^8.20.5",
27
+ "@viur/ignite": "^5.1.2",
28
+ "@viur/shoelace": "^1.0.8-v2.19.0",
29
+ "@viur/vue-utils": "^1.7.22",
30
+ "@vueuse/core": "^11.1.0",
31
+ "pinia": "^2.2.4",
32
+ "primevue": "^4.1.1",
33
+ "vue": "^3.5.12",
34
+ "vue-i18n": "^10.0.4",
35
+ "vue-router": "^4.4.5"
36
+ },
37
+ "devDependencies": {
38
+ "@faker-js/faker": "^9.0.3",
39
+ "@vitejs/plugin-vue": "^5.1.4",
40
+ "postcss-custom-media": "^11.0.3",
41
+ "postcss-nesting": "^13.0.0",
42
+ "prettier": "^3.3.3",
43
+ "vite": "^5.4.9"
44
44
  }
45
45
  }
package/src/Shop.vue ADDED
@@ -0,0 +1,212 @@
1
+ <template>
2
+ <div class="bind viur-shop-wrap">
3
+ <div class="viur-shop-stepper-wrap"
4
+ :class="{ 'full-width': (!summary || summary==='bottom' || shopStore.state.currentTab==='complete') }"
5
+ >
6
+ <shop-order-stepper v-if="shopStore.state.cartReady && shopStore.state.orderReady">
7
+ </shop-order-stepper>
8
+ </div>
9
+
10
+ <div class="viur-shop-sidebar-wrap" v-if="false" :class="{ bottom: (summary==='bottom') }">
11
+ <shop-summary></shop-summary>
12
+ </div>
13
+ </div>
14
+
15
+ <sl-details summary="Debug" open>
16
+ language: {{shopStore.state.language}} <br>
17
+ order: {{ shopStore.state.orderKey }}<br>
18
+ cart: {{ shopStore.state.cartRoot?.['key'] }}<br><br>
19
+
20
+ shippingaddress: {{shopStore.state.cartRoot?.['shipping_address']}}<br>
21
+ billingaddress: {{shopStore.state.order?.['billing_address']}}<br><br>
22
+
23
+ shipping: {{shopStore.state.cartRoot?.['shipping']}}<br><br>
24
+ Payment: {{shopStore.state.order?.['payment_provider']}}<br><br>
25
+
26
+ Order Status<br>
27
+ ------<br>
28
+ canCheckout: {{ shopStore.state.canCheckout }}<br>
29
+ canOrder: {{ shopStore.state.canOrder }}<br>
30
+ CheckoutStarted: {{ shopStore.state.order?.['is_checkout_in_progress'] }}<br><br>
31
+
32
+ ordered: {{ shopStore.state.order?.['is_ordered'] }}<br>
33
+ readytoship: {{ shopStore.state.order?.['is_rts'] }}<br>
34
+ paid: {{ shopStore.state.order?.['is_paid'] }}<br><br>
35
+
36
+ OrderObject: {{shopStore.state.order}}
37
+
38
+
39
+ </sl-details>
40
+
41
+ <div id="dialogs"></div>
42
+ </template>
43
+
44
+
45
+ <script setup>
46
+ import { onBeforeMount } from 'vue';
47
+ import ShopOrderStepper from './ShopOrderStepper.vue'
48
+ import ShopSummary from "./ShopSummary.vue"
49
+ import {useViurShopStore} from './shop'
50
+ import { useUrlSearchParams } from '@vueuse/core'
51
+ import { useOrder } from './composables/order';
52
+ import { useCart } from './composables/cart';
53
+
54
+
55
+ const shopStore = useViurShopStore()
56
+ const {fetchOrder} = useOrder()
57
+ const {fetchCart} = useCart()
58
+
59
+ const props = defineProps({
60
+ summary:{
61
+ default:false
62
+ }, // bottom, sidebar
63
+ initTab:{
64
+ default:'cart'
65
+ },
66
+ modulename:{
67
+ default:'shop'
68
+ },
69
+ language:{
70
+ default:"de"
71
+ }
72
+ })
73
+
74
+
75
+ onBeforeMount(()=>{
76
+ shopStore.state.language=props.language
77
+ if(props.tabs){
78
+ shopStore.state.tabs = props.tabs
79
+ }
80
+
81
+ shopStore.state.moduleName= props.modulename
82
+ fetchCart()
83
+ shopStore.fetchMetaData()
84
+ const params = useUrlSearchParams('hash')
85
+ if (Object.keys(params).includes('order')){
86
+ shopStore.state.orderKey = params['order']
87
+ fetchOrder(shopStore.state.orderKey).then(()=>{
88
+ shopStore.state.orderReady = true
89
+ // navigate to order state
90
+ if(shopStore.state.order?.['is_ordered']){
91
+ shopStore.navigateToTab('complete')
92
+ } else if (shopStore.state.order?.['is_checkout_in_progress']){
93
+ shopStore.navigateToTab('confirm')
94
+ }
95
+ })
96
+ }else{
97
+ shopStore.state.orderReady = true
98
+ }
99
+
100
+
101
+ if (Object.keys(params).includes('step')){
102
+ shopStore.navigateToTab(params['step'])
103
+ }else{
104
+ shopStore.navigateToTab('cart')
105
+ }
106
+
107
+
108
+
109
+
110
+ })
111
+
112
+
113
+
114
+ </script>
115
+
116
+ <style scoped>
117
+
118
+ * {
119
+ box-sizing: border-box;
120
+ }
121
+
122
+ .viur-shop-wrap {
123
+ --shop-sidebar-background: var(--sl-color-neutral-100);
124
+ --shop-sidebar-columns: 4;
125
+ --shop-main-columns: 8;
126
+ --shop-tab-color: var(--sl-color-neutral-400);
127
+ --shop-tab-color-active: var(--ignt-color-primary);
128
+
129
+ --shop-form-headline-size: 1.5em;
130
+ --shop-success-headline-size: var(--shop-form-headline-size);
131
+
132
+ display: grid;
133
+ grid-template-columns: repeat(12, minmax(0, 1fr));
134
+ grid-template-rows: 1fr max-content;
135
+ grid-gap: var(--ignt-spacing-2x-large);
136
+
137
+ width: 100%;
138
+ border: 0 white solid;
139
+ }
140
+
141
+ @layer foundation.shop {
142
+ .viur-shop-sidebar-wrap {
143
+ --padding: var(--sl-spacing-large);
144
+
145
+ display: flex;
146
+ flex-direction: column;
147
+ background-color: var(--shop-sidebar-background);
148
+ padding: var(--sl-spacing-medium);
149
+ overflow: hidden;
150
+ border-radius: var(--sl-border-radius-medium);
151
+ grid-column: auto / span var(--shop-sidebar-columns);
152
+ /* height has to be set or sidebar grows until infinity... */
153
+ height: min-content;
154
+ @media (min-width: 1024px) {
155
+ position: sticky;
156
+ max-height: calc(100vh - 2 * var(--padding));
157
+ top: var(--padding);
158
+ bottom: var(--padding);
159
+ }
160
+ }
161
+
162
+ .viur-shop-stepper-wrap {
163
+ display: flex;
164
+ flex-direction: column;
165
+ grid-column: auto / span var(--shop-main-columns);
166
+
167
+ @media (max-width: 1024px) {
168
+ grid-column: auto / span 12;
169
+ }
170
+
171
+ @media (max-width: 600px) {
172
+ &::part(active-tab-indicator) {
173
+ display: none;
174
+ }
175
+ }
176
+ }
177
+
178
+ .viur-shop-form-footer {
179
+ height: fit-content;
180
+
181
+ /* TODO: sticky Trigger yes no? */
182
+ /* position: sticky;
183
+ bottom: 2rem; */
184
+ }
185
+
186
+ :deep(.viur-shop-form-footer) {
187
+ display: flex;
188
+ justify-content: space-between;
189
+ margin-top: var(--sl-spacing-large);
190
+ }
191
+
192
+ .flex-end {
193
+ justify-content: flex-end;
194
+ }
195
+
196
+ .bottom {
197
+ grid-column: auto / span 12;
198
+ grid-row-start: 2;
199
+ }
200
+
201
+ .full-width {
202
+ grid-column: auto / span 12;
203
+ }
204
+
205
+ .last-row {
206
+ grid-row-start: 3;
207
+ }
208
+ }
209
+
210
+
211
+
212
+ </style>
@@ -0,0 +1,89 @@
1
+ <template>
2
+ <sl-tab-group
3
+ class="viur-shop-order-tabgroup"
4
+ noScrollControls
5
+ ref="stepper"
6
+ >
7
+ <template v-for="(tab,name) in shopStore.state.tabs">
8
+ <StepperTab
9
+ :tab="name"
10
+ >
11
+ </StepperTab>
12
+
13
+ <sl-tab-panel :name="name">
14
+ <template v-if="tab?.['loaded']">
15
+ <component :is="tab['component']">
16
+ <template v-slot="slotProps">
17
+ <sl-bar>
18
+ <div slot="right">
19
+ <sl-button
20
+ variant="primary"
21
+ :disabled="active(slotProps)"
22
+ @click="nextStep(slotProps)"
23
+ :loading="tab['validating']"
24
+ >
25
+ {{slotProps.nextName}}
26
+ </sl-button>
27
+ </div>
28
+ </sl-bar>
29
+ </template>
30
+ </component>
31
+ </template>
32
+ </sl-tab-panel>
33
+ </template>
34
+ </sl-tab-group>
35
+ </template>
36
+
37
+ <script setup>
38
+ import {reactive, shallowRef, watch, ref, onBeforeMount, onMounted} from 'vue'
39
+ import {useViurShopStore} from './shop'
40
+ import StepperTab from './components/StepperTab.vue'
41
+
42
+ const shopStore = useViurShopStore()
43
+ const stepper = ref()
44
+
45
+
46
+ // Activate Tab if currentTab changes
47
+ watch(()=>shopStore.state.currentTab, (newVal, oldVal)=>{
48
+ stepper.value.show(shopStore.state.currentTab)
49
+ shopStore.state.tabs[shopStore.state.currentTab]['loaded'] = true
50
+ })
51
+
52
+ onMounted(()=>{
53
+ // wait shoelace component is ready
54
+ stepper.value.updateComplete.then(() => {
55
+ shopStore.state.tabs[shopStore.state.currentTab]['loaded'] = true
56
+ stepper.value.show(shopStore.state.currentTab)
57
+ })
58
+ })
59
+
60
+ function nextStep(obj){
61
+ shopStore.state.tabs[shopStore.state.currentTab]['valid']=false
62
+ shopStore.state.tabs[shopStore.state.currentTab]['validating']=true
63
+ //validate step, like send forms or something like this
64
+ Promise.resolve(obj.nextfunction()).then((resp)=>{
65
+ if (resp){
66
+ shopStore.state.tabs[shopStore.state.currentTab]['valid']=true
67
+ shopStore.state.tabs[shopStore.state.currentTab]['validating']=false
68
+ shopStore.navigateToNext()
69
+ }else{
70
+ shopStore.state.tabs[shopStore.state.currentTab]['valid']=false
71
+ shopStore.state.tabs[shopStore.state.currentTab]['validating']=false
72
+ }
73
+ }).catch(error=>{
74
+ shopStore.state.tabs[shopStore.state.currentTab]['valid']=false
75
+ shopStore.state.tabs[shopStore.state.currentTab]['validating']=false
76
+ })
77
+ console.log("----")
78
+ }
79
+
80
+ function active(obj){
81
+ return !obj.activefunction()
82
+ }
83
+
84
+ </script>
85
+
86
+ <style scoped>
87
+
88
+
89
+ </style>
@@ -0,0 +1,170 @@
1
+ <template>
2
+ <h2 class="viur-shop-cart-sidebar-headline headline">Zusammenfassung</h2>
3
+
4
+ <div class="viur-shop-cart-sidebar-summary">
5
+ <template v-for="i in 10">
6
+ <div class="viur-shop-cart-sidebar-summary-item">
7
+ <div class="viur-shop-cart-sidebar-summary-item-amount">1x</div>
8
+ <div class="viur-shop-cart-sidebar-summary-item-name">Item Name auch noch etwas länger zum testen</div>
9
+ <div class="viur-shop-cart-sidebar-summary-item-price">1.333,00€</div>
10
+ </div>
11
+
12
+ <div class="viur-shop-cart-sidebar-summary-item">
13
+ <div class="viur-shop-cart-sidebar-summary-item-amount">1x</div>
14
+ <div class="viur-shop-cart-sidebar-summary-item-name">Item Name</div>
15
+ <div class="viur-shop-cart-sidebar-summary-item-price">1.333,00€</div>
16
+ </div>
17
+ </template>
18
+ </div>
19
+
20
+ <div class="viur-shop-cart-sidebar-info-line">
21
+ <span>Zwischensumme</span>
22
+
23
+ <sl-format-number
24
+ lang="de"
25
+ type="currency"
26
+ currency="EUR"
27
+ :value="shopStore.state.order?.total"
28
+ >
29
+ </sl-format-number>
30
+ </div>
31
+
32
+ <div class="viur-shop-cart-sidebar-info-line">
33
+ <span>Versandkosten</span>
34
+
35
+ <sl-format-number
36
+ lang="de"
37
+ type="currency"
38
+ currency="EUR"
39
+ :value="shopStore.state.order?.cart?.dest?.shipping?.dest?.shipping_cost"
40
+ >
41
+ </sl-format-number>
42
+ </div>
43
+ <div class="viur-shop-cart-shipping-item">
44
+ <span>Lieferzeit </span>
45
+ <template v-if="shopStore.state.order?.cart?.dest?.shipping?.dest?.delivery_time_range === 1">
46
+ {{shopStore.state.order?.cart?.dest?.shipping?.dest?.delivery_time_range}} Tag
47
+ </template>
48
+ <template v-else>
49
+ {{shopStore.state.order?.cart?.dest?.shipping?.dest?.delivery_time_range}} Tage
50
+ </template>
51
+ </div>
52
+
53
+ <div class="viur-shop-cart-sidebar-info-line">
54
+ <span>Rabatt</span>
55
+
56
+ <sl-format-number
57
+ lang="de"
58
+ type="currency"
59
+ currency="EUR"
60
+ :value="0"
61
+ >
62
+ </sl-format-number>
63
+ </div>
64
+ <div class="viur-shop-cart-sidebar-info-line">
65
+
66
+ </div>
67
+ <div class="viur-shop-cart-sidebar-info-line total">
68
+ <span>Gesamt:</span>
69
+ <sl-format-number
70
+ lang="de"
71
+ type="currency"
72
+ currency="EUR"
73
+ :value="state.total"
74
+ >
75
+ </sl-format-number>
76
+ </div>
77
+
78
+ <slot name="action-buttons">
79
+ <div class="viur-shop-cart-sidebar-btn-wrap" v-if="!shopStore.state.order?.['is_paid']">
80
+ <sl-button variant="primary" size="medium">Bestellen</sl-button>
81
+ </div>
82
+ </slot>
83
+ </template>
84
+ <script setup>
85
+ import {reactive, computed} from 'vue'
86
+ import {useViurShopStore} from "./shop";
87
+ const shopStore = useViurShopStore();
88
+ console.log(shopStore.state.order)
89
+
90
+ const state = reactive({
91
+ total:computed(()=>{
92
+ return shopStore.state.order?.total + (shopStore.state.order?.cart?.dest?.shipping?.dest?.shipping_cost?shopStore.state.order?.cart?.dest?.shipping?.dest?.shipping_cost:0)
93
+ })
94
+ })
95
+
96
+
97
+ </script>
98
+
99
+ <style scoped>
100
+ .viur-shop-cart-sidebar-info-line {
101
+ display: flex;
102
+ flex-direction: row;
103
+ flex-wrap: nowrap;
104
+ margin: var(--sl-spacing-2x-small) 0;
105
+
106
+ &.total {
107
+ font-weight: 600;
108
+ border-top: 1px solid var(--sl-color-neutral-300);
109
+ border-bottom: 1px solid var(--sl-color-neutral-300);
110
+ padding: var(--sl-spacing-x-small) 0;
111
+ margin: var(--sl-spacing-small) 0;
112
+ }
113
+
114
+ span {
115
+ margin-right: auto;
116
+ }
117
+ }
118
+
119
+ .viur-shop-cart-sidebar-btn-wrap {
120
+ display: flex;
121
+ flex-direction: column;
122
+ margin-top: var(--sl-spacing-large);
123
+
124
+ sl-button {
125
+ margin-bottom: var(--sl-spacing-x-small);
126
+ }
127
+ }
128
+
129
+ .viur-shop-cart-sidebar-headline {
130
+ margin: 0 0 var(--sl-spacing-large) 0;
131
+ }
132
+
133
+ .viur-shop-cart-sidebar-summary{
134
+ display: flex;
135
+ flex-direction: column;
136
+ overflow: auto;
137
+ margin-bottom: var(--sl-spacing-small);
138
+ padding-right: 4px;
139
+ margin-right: -4px;
140
+
141
+ &::-webkit-scrollbar {
142
+ width: 3px;
143
+ }
144
+
145
+ &::-webkit-scrollbar-track {
146
+ background: transparent;
147
+ }
148
+
149
+ &::-webkit-scrollbar-thumb {
150
+ background: var(--sl-color-neutral-300);
151
+ transition: background ease .3s;
152
+ }
153
+
154
+ &::-webkit-scrollbar-thumb:hover {
155
+ background: var(--sl-color-neutral-400);
156
+ }
157
+ }
158
+
159
+ .viur-shop-cart-sidebar-summary-item{
160
+ display: flex;
161
+ flex-direction: row;
162
+ flex-wrap: nowrap;
163
+ gap: var(--sl-spacing-medium);
164
+ margin-bottom: var(--sl-spacing-small);
165
+ }
166
+
167
+ .viur-shop-cart-sidebar-summary-item-name{
168
+ margin-right: auto;
169
+ }
170
+ </style>
@@ -0,0 +1,60 @@
1
+ <template>
2
+ <sl-button @click="fetchCart">
3
+ reload
4
+ </sl-button>
5
+ <sl-button @click="addItem('agtha3ZpdXIzdGVzdHIZCxIMZ3JlZW5hcnRpY2xlGICAgMSf-50JDA')">
6
+ add
7
+ </sl-button>
8
+ <loading-handler :isLoading="cartState.isLoading" :isUpdating="cartState.isUpdating">
9
+ <div class="item-wrapper" v-if="state.items.length>0">
10
+ <cart-item v-for="item in state.items" :item="item"
11
+ :edit="!shopStore.state.order?.['is_checkout_in_progress']"
12
+ >
13
+
14
+ </cart-item>
15
+ </div>
16
+ <shop-alert v-else variant="info" duration="Infinity">
17
+ <template #alertMsg>
18
+ {{ $t('shop.cart_empty') }}
19
+ </template>
20
+ </shop-alert>
21
+ </loading-handler>
22
+
23
+ <slot
24
+ nextName="weiter"
25
+ :activefunction="()=>state.items.length>0"
26
+ :nextfunction="()=>true"
27
+ >
28
+ </slot>
29
+
30
+ </template>
31
+
32
+ <script setup>
33
+ import { useViurShopStore } from '../shop'
34
+ import {computed, onBeforeMount, onMounted, reactive, watch} from 'vue'
35
+ import { useCart } from '../composables/cart';
36
+ import LoadingHandler from '../components/LoadingHandler.vue';
37
+ import CartItem from '../components/CartItem.vue';
38
+ import CartItemSmall from '../components/CartItemSmall.vue';
39
+ import ShopAlert from '../components/ShopAlert.vue';
40
+
41
+ const shopStore = useViurShopStore()
42
+ const {fetchCart,addItem, state:cartState} = useCart()
43
+
44
+ const state = reactive({
45
+ items: computed(()=>shopStore.state.cartList.filter(i=>i['skel_type']==='leaf'))
46
+ })
47
+
48
+ onBeforeMount(()=>{
49
+ fetchCart()
50
+ })
51
+
52
+ </script>
53
+ <style scoped>
54
+ .item-wrapper{
55
+ display:flex;
56
+ flex-direction: column;
57
+ gap: 20px;
58
+ }
59
+
60
+ </style>
@@ -0,0 +1,24 @@
1
+ <template>
2
+ <div class="bind">
3
+ <h1 class="viur-shop-success-headline headline">
4
+ {{ $t('shop.order_thanks') }}
5
+ </h1>
6
+ <p class="paragraph"><strong>{{ $t('shop.order_number') }}:</strong> {{ shopStore.state.order?.["order_uid"] }}</p>
7
+ <p class="paragraph" v-html=" $t('shop.order_message')">
8
+ </p>
9
+
10
+ <p class="paragraph" v-if="shopStore.state.order?.['is_paid']">
11
+ {{ $t('shop.order_paid') }}
12
+ </p>
13
+
14
+ <p class="paragraph" v-if="shopStore.state.order?.['is_rts']">
15
+ {{ $t('shop.order_ready_to_ship') }}
16
+ </p>
17
+ </div>
18
+ </template>
19
+
20
+ <script setup>
21
+ import {computed, reactive} from 'vue'
22
+ import { useViurShopStore } from '../shop';
23
+ const shopStore = useViurShopStore()
24
+ </script>