From b6db857d3c87433585adc67dace166b02785a600 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Mon, 2 Sep 2024 10:53:45 +0530 Subject: [PATCH] Improved: showing formated unit price of the item with currency symbol (#716) --- src/components/GiftCardActivationModal.vue | 5 +++-- src/services/UtilService.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/GiftCardActivationModal.vue b/src/components/GiftCardActivationModal.vue index 245fa060..dcc503c2 100644 --- a/src/components/GiftCardActivationModal.vue +++ b/src/components/GiftCardActivationModal.vue @@ -32,7 +32,7 @@ {{ getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) ? getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) : item.productName }}

{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.productId)) }}

- {{ itemPriceInfo.unitPrice }} {{ itemPriceInfo.currency }} + {{ formatCurrency(itemPriceInfo.unitPrice, itemPriceInfo.currencyUom) }} @@ -69,7 +69,7 @@ import { mapGetters, useStore } from "vuex"; import { cardOutline, closeOutline, giftOutline, saveOutline } from "ionicons/icons"; import { getProductIdentificationValue, translate, useProductIdentificationStore } from '@hotwax/dxp-components' import { UtilService } from "@/services/UtilService"; -import { formatUtcDate, hasError, showToast } from '@/utils'; +import { formatCurrency, formatUtcDate, hasError, showToast } from '@/utils'; import logger from "@/logger"; import { DateTime } from 'luxon'; @@ -170,6 +170,7 @@ export default defineComponent({ return { cardOutline, closeOutline, + formatCurrency, formatUtcDate, getProductIdentificationValue, giftOutline, diff --git a/src/services/UtilService.ts b/src/services/UtilService.ts index da5b1165..8c252431 100644 --- a/src/services/UtilService.ts +++ b/src/services/UtilService.ts @@ -489,7 +489,7 @@ const fetchGiftCardItemPriceInfo = async (payload: any): Promise => { }); if(!hasError(resp)) { - itemPriceInfo.currency = resp.data.docs[0].currencyUom + itemPriceInfo.currencyUom = resp.data.docs[0].currencyUom } else { throw resp.data; }