@shopbite-de/storefront 1.6.1 → 1.6.2

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.
@@ -16,6 +16,8 @@ const { getFormattedPrice } = usePrice({
16
16
  localeCode: "de-DE",
17
17
  });
18
18
 
19
+ const price = ref(product.value.calculatedPrice.totalPrice);
20
+
19
21
  const isVegi = computed<boolean>(() => {
20
22
  if (!product.value?.properties) {
21
23
  return false;
@@ -47,6 +49,10 @@ const mainIngredients = computed<Schemas["PropertyGroupOption"][]>(() => {
47
49
  );
48
50
  return mainIngredientsProperty?.options ?? [];
49
51
  });
52
+
53
+ function onVariantSelected(variant: Schemas["Product"]) {
54
+ price.value = variant.calculatedPrice.totalPrice;
55
+ }
50
56
  </script>
51
57
 
52
58
  <template>
@@ -111,7 +117,7 @@ const mainIngredients = computed<Schemas["PropertyGroupOption"][]>(() => {
111
117
 
112
118
  <template #footer>
113
119
  <div class="flex flex-row justify-between content-center w-full">
114
- <p>{{ getFormattedPrice(product.calculatedPrice.totalPrice) }}</p>
120
+ <p>{{ getFormattedPrice(price) }}</p>
115
121
  <div class="flex flex-row gap-2">
116
122
  <AddToWishlist v-if="withFavoriteButton" :product="product" />
117
123
  <UButton
@@ -127,6 +133,7 @@ const mainIngredients = computed<Schemas["PropertyGroupOption"][]>(() => {
127
133
  <ProductDetail2
128
134
  :product-id="product.id"
129
135
  @product-added="toggleDetails"
136
+ @variant-selected="onVariantSelected"
130
137
  />
131
138
  </template>
132
139
  </UCollapsible>
@@ -114,6 +114,7 @@ watch(
114
114
 
115
115
  const onVariantSwitched = (variant: Schemas["Product"]) => {
116
116
  setSelectedProduct(variant);
117
+ emit("variant-selected", variant);
117
118
  };
118
119
 
119
120
  const onExtrasSelected = (extras: AssociationItemProduct[]) => {
@@ -126,7 +127,7 @@ const onIngredientsDeselected = (deselected: string[]) => {
126
127
 
127
128
  const onAddToCart = () => emit("product-added");
128
129
 
129
- const emit = defineEmits(["product-added"]);
130
+ const emit = defineEmits(["product-added", "variant-selected"]);
130
131
  </script>
131
132
 
132
133
  <template>
@@ -98,6 +98,8 @@ export function useAddToCart() {
98
98
  id: generatedUuid,
99
99
  quantity: selectedQuantity.value,
100
100
  type: LINE_ITEM_CONTAINER,
101
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
102
+ // @ts-expect-error
101
103
  label: cartItemLabel.value,
102
104
  payload: {
103
105
  productNumber: selectedProduct.value.productNumber,
@@ -73,6 +73,7 @@ export function useProductConfigurator() {
73
73
  "productNumber",
74
74
  "options",
75
75
  "properties",
76
+ "calculatedPrice",
76
77
  ],
77
78
  product_option: ["id", "groupId", "name", "translated", "group"],
78
79
  property: ["id", "name", "translated", "options"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopbite-de/storefront",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "main": "nuxt.config.ts",
5
5
  "description": "Shopware storefront for food delivery shops",
6
6
  "keywords": [