diff --git a/package-lock.json b/package-lock.json index 2e49c3ba..cecca6ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@casl/ability": "^6.0.0", "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.2.6", - "@hotwax/dxp-components": "^1.7.5", + "@hotwax/dxp-components": "^1.8.0", "@hotwax/oms-api": "^1.10.0", "@ionic/core": "^7.6.0", "@ionic/vue": "^7.6.0", diff --git a/package.json b/package.json index 718b5594..9666e391 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "@casl/ability": "^6.0.0", "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.2.6", - "@hotwax/dxp-components": "^1.7.5", + "@hotwax/dxp-components": "^1.8.0", "@hotwax/oms-api": "^1.10.0", "@ionic/core": "^7.6.0", "@ionic/vue": "^7.6.0", diff --git a/src/App.vue b/src/App.vue index 2564ff9d..2ccfe97e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -22,6 +22,7 @@ import TabBar from "./components/TabBar.vue" import { mapGetters, useStore } from 'vuex'; import { initialise, resetConfig } from '@/adapter' import { useRouter } from 'vue-router'; +import { useProductIdentificationStore } from '@hotwax/dxp-components'; export default defineComponent({ name: 'App', @@ -77,6 +78,10 @@ export default defineComponent({ }); emitter.on('presentLoader', this.presentLoader); emitter.on('dismissLoader', this.dismissLoader); + + // Get product identification from api using dxp-component + await useProductIdentificationStore().getIdentificationPref(this.currentEComStore?.productStoreId) + .catch((error) => console.error(error)); }, created() { initialise({ @@ -107,7 +112,8 @@ export default defineComponent({ }, ...mapGetters({ userToken: 'user/getUserToken', - instanceUrl: 'user/getInstanceUrl' + instanceUrl: 'user/getInstanceUrl', + currentEComStore: 'user/getCurrentEComStore' }) }, setup() { diff --git a/src/adapter/index.ts b/src/adapter/index.ts index 43354254..fdb8d301 100644 --- a/src/adapter/index.ts +++ b/src/adapter/index.ts @@ -1,13 +1,15 @@ -import { api, client, getConfig, getUserFacilities, initialise, logout, resetConfig, updateInstanceUrl, updateToken } from '@hotwax/oms-api' +import { api, client, getConfig, getProductIdentificationPref, getUserFacilities, initialise, logout, resetConfig, setProductIdentificationPref, updateInstanceUrl, updateToken } from '@hotwax/oms-api' export { api, client, getConfig, + getProductIdentificationPref, getUserFacilities, initialise, logout, resetConfig, + setProductIdentificationPref, updateInstanceUrl, updateToken } \ No newline at end of file diff --git a/src/components/ProductListItem.vue b/src/components/ProductListItem.vue index fe5a8398..a0d288b3 100644 --- a/src/components/ProductListItem.vue +++ b/src/components/ProductListItem.vue @@ -4,15 +4,15 @@ -

{{ product.productName }}

-

{{ product.sku }}

+

{{ getProductIdentificationValue(productIdentificationPref.secondaryId, product) }}

+

{{ getProductIdentificationValue(productIdentificationPref.primaryId, product) ? getProductIdentificationValue(productIdentificationPref.primaryId, product) : product.productName }}

{{$filters.getFeature(product.featureHierarchy, '1/COLOR/')}} {{$filters.getFeature(product.featureHierarchy, '1/COLOR/') && $filters.getFeature(product.featureHierarchy, '1/SIZE/')? "|" : ""}} {{$filters.getFeature(product.featureHierarchy, '1/SIZE/')}}