Skip to content

Commit

Permalink
feat(order): format item currency
Browse files Browse the repository at this point in the history
  • Loading branch information
belsman committed Oct 30, 2024
1 parent 0f90dd5 commit 0310fd6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ fragment OrderFragment on IoRestorecommerceOrderOrder {
...ProductFragment
}
unitPrice {
currencyId
currency {
name
symbol
Expand Down
4 changes: 4 additions & 0 deletions packages/core/graphql/src/lib/generated/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6288,6 +6288,7 @@ export type OrderFragmentFragment = {
} | null;
unitPrice?: {
__typename?: 'IoRestorecommercePricePrice';
currencyId?: string | null;
regularPrice?: number | null;
sale?: boolean | null;
salePrice?: number | null;
Expand Down Expand Up @@ -9408,6 +9409,7 @@ export type OrderingOrderMutateMutation = {
} | null;
unitPrice?: {
__typename?: 'IoRestorecommercePricePrice';
currencyId?: string | null;
regularPrice?: number | null;
sale?: boolean | null;
salePrice?: number | null;
Expand Down Expand Up @@ -10124,6 +10126,7 @@ export type OrderingOrderReadQuery = {
} | null;
unitPrice?: {
__typename?: 'IoRestorecommercePricePrice';
currencyId?: string | null;
regularPrice?: number | null;
sale?: boolean | null;
salePrice?: number | null;
Expand Down Expand Up @@ -11127,6 +11130,7 @@ export const OrderFragmentFragmentDoc = gql`
...ProductFragment
}
unitPrice {
currencyId
currency {
name
symbol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ <h4>{{ item.product?.product?.name }}</h4>
priority="auto"
/>
<p class="mt-2">
<strong>Price:</strong> {{ item.unitPrice?.currency || 'EUR' }}
{{ item.unitPrice?.regularPrice }}
<strong>Price:</strong>
{{
item.unitPrice?.regularPrice
| currency
: (item.unitPrice?.currencyId ? item.unitPrice?.currencyId + '' : 'EUR')
}}
</p>

<ng-template
Expand Down

0 comments on commit 0310fd6

Please sign in to comment.