forked from hotwax/dxp-components
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented: centralized product store selector (hotwax#193)
- Loading branch information
1 parent
84c57f9
commit e547510
Showing
6 changed files
with
148 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<template> | ||
<ion-card> | ||
<ion-card-header> | ||
<ion-card-subtitle> | ||
{{ $t("Product Store") }} | ||
</ion-card-subtitle> | ||
<ion-card-title> | ||
{{ $t("Store") }} | ||
</ion-card-title> | ||
</ion-card-header> | ||
|
||
<ion-card-content> | ||
{{ $t('A store represents a company or a unique catalog of products. If your OMS is connected to multiple eCommerce stores selling different collections of products, you may have multiple Product Stores set up in HotWax Commerce.') }} | ||
</ion-card-content> | ||
|
||
<ion-item lines="none"> | ||
<ion-label> {{ $t("Select store") }} </ion-label> | ||
<ion-select interface="popover" :placeholder="$t('store name')" :value="currentEComStore?.productStoreId" | ||
@ionChange="setEComStore($event)"> | ||
<ion-select-option v-for="store in (productStores ? productStores : [])" :key="store.productStoreId" :value="store.productStoreId">{{ store.storeName }}</ion-select-option> | ||
</ion-select> | ||
</ion-item> | ||
</ion-card> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { IonCard, IonCardContent, IonCardHeader, IonCardTitle, IonCardSubtitle, IonItem, IonLabel, IonSelect, IonSelectOption } from '@ionic/vue'; | ||
import { useUserStore } from 'src'; | ||
import { computed } from 'vue'; | ||
const userStore = useUserStore(); | ||
const productStores = computed(() => userStore.current?.stores); | ||
const currentEComStore = computed(() => userStore.currentEComStore); | ||
const setEComStore = (event: any) => { | ||
if (currentEComStore.value?.productStoreId !== event.detail.value) { | ||
userStore.setEComStore({ eComStore: productStores.value.find((store: any) => store.productStoreId == event.detail.value) }) | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters