-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Implemented: centralized product store selector (#193)
- Loading branch information
Showing
6 changed files
with
117 additions
and
20 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
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,40 @@ | ||
<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-select :label="$t('Select store')" interface="popover" :placeholder="$t('store name')" :value="currentEComStore?.productStoreId" @ionChange="updateEComStore($event.target.value)"> | ||
<ion-select-option v-for="store in (eComStores ? eComStores : [])" :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 emit = defineEmits(["updateEComStore"]) | ||
const eComStores = computed(() => userStore.getProductStores); | ||
const currentEComStore = computed(() => userStore.getCurrentEComStore); | ||
async function updateEComStore(eComStoreId: any) { | ||
const selectedProductStore = eComStores.value.find((store: any) => store.productStoreId == eComStoreId) | ||
await userStore.setEComStorePreference(selectedProductStore) | ||
emit('updateEComStore', selectedProductStore) | ||
} | ||
</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