Skip to content

Commit

Permalink
Merge pull request #3026 from beckn/develop-1.1.0
Browse files Browse the repository at this point in the history
Develop 1.1.0
  • Loading branch information
aniketceminds authored Jan 22, 2025
2 parents 754dc07 + cd87849 commit 6b49392
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions apps/OSC/pages/checkout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const CheckoutPage = () => {
mobileNumber: '0612345678',
email: '[email protected]',
address: '15 rue du soleil, paris, france',
pinCode: '75001'
pinCode: '75020'
})

const [isBillingAddressSameAsShippingAddress, setIsBillingAddressSameAsShippingAddress] = useState(true)
Expand All @@ -60,7 +60,7 @@ const CheckoutPage = () => {
mobileNumber: '0612345678',
email: '[email protected]',
address: '15 rue du soleil, paris, france',
pinCode: '75001'
pinCode: '75020'
})

const router = useRouter()
Expand Down
4 changes: 2 additions & 2 deletions apps/retail/pages/checkout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const CheckoutPage = () => {
mobileNumber: '0612345678',
email: '[email protected]',
address: '15 Rue Du Soleil, Paris, France',
pinCode: '75001'
pinCode: '75020'
}
)

Expand All @@ -69,7 +69,7 @@ const CheckoutPage = () => {
mobileNumber: '0612345678',
email: '[email protected]',
address: '15 Rue Du Soleil, Paris, France',
pinCode: '75001'
pinCode: '75020'
}
)

Expand Down
4 changes: 2 additions & 2 deletions apps/tourismV1.1/pages/checkout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const CheckoutPage = () => {
mobileNumber: '0612345678',
email: '[email protected]',
address: '15 Rue du Soleil, Paris, France',
pinCode: '75001'
pinCode: '75020'
}
)
const [isBillingAddressSameAsShippingAddress, setIsBillingAddressSameAsShippingAddress] = useState(true)
Expand All @@ -83,7 +83,7 @@ const CheckoutPage = () => {
mobileNumber: '0612345678',
email: '[email protected]',
address: '15 Rue du Soleil, Paris, France',
pinCode: '75001'
pinCode: '75020'
}
)
const theme = useTheme()
Expand Down
4 changes: 2 additions & 2 deletions packages/common/src/pages/checkout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const CheckoutPage = () => {
mobileNumber: '0612345678',
email: '[email protected]',
address: '15 Rue Du Soleil, Paris, France',
pinCode: '75001'
pinCode: '75020'
}
)

Expand All @@ -68,7 +68,7 @@ const CheckoutPage = () => {
mobileNumber: '0612345678',
email: '[email protected]',
address: '15 Rue Du Soleil, Paris, France',
pinCode: '75001'
pinCode: '75020'
}
)

Expand Down
16 changes: 9 additions & 7 deletions packages/common/src/utils/checkout-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export const getPaymentBreakDown = (initData: InitResponseModel[] | StatusRespon
const quote = initData[0].message.order.quote
const breakUp = quote.breakup
const totalPricewithCurrent = {
currency: quote.price.currency,
value: quote.price.value
value: getSubTotalAndDeliveryCharges(initData).subTotal.toString(),
currency: getSubTotalAndDeliveryCharges(initData).currencySymbol!
}

const breakUpMap: Record<string, any> = {}
Expand All @@ -70,16 +70,18 @@ export const getPaymentBreakDown = (initData: InitResponseModel[] | StatusRespon
return { breakUpMap, totalPricewithCurrent }
}

export const getSubTotalAndDeliveryCharges = (initData: InitResponseModel[]) => {
export const getSubTotalAndDeliveryCharges = (initData: InitResponseModel[] | StatusResponseModel[]) => {
let subTotal: number = 0
let currencySymbol

if (initData && initData.length > 0) {
initData.forEach(data => {
subTotal =
subTotal + Number(parseFloat((Number(data.message.order.quote.price.value) || 0).toString()).toFixed(2))

currencySymbol = data.message.order.quote.price.currency
if (data.message.order.quote.breakup) {
data.message.order.quote.breakup.forEach(breakup => {
subTotal += Number(parseFloat((Number(breakup.price.value) || 0).toString()).toFixed(2))
})
currencySymbol = data.message.order.quote.breakup[0]?.price.currency
}
})
}

Expand Down

0 comments on commit 6b49392

Please sign in to comment.