24 lines
646 B
TypeScript
24 lines
646 B
TypeScript
import React from 'react'
|
|
import { useProduct } from 'vtex.product-context'
|
|
|
|
|
|
const Parcelamento = () => {
|
|
const product = useProduct()
|
|
|
|
const Installments = {
|
|
numberOfInstallments:
|
|
product?.selectedItem?.sellers[0].commertialOffer.Installments[3]
|
|
.NumberOfInstallments,
|
|
}
|
|
const Price = {
|
|
numberOfInstallments: product?.selectedItem?.sellers[0].commertialOffer.Installments[3].Value
|
|
}
|
|
console.log(product);
|
|
return <p>
|
|
{Installments.numberOfInstallments} x de R$
|
|
{Price.numberOfInstallments?.toFixed(2).toString().replace(".", ",")} sem juros
|
|
</p>
|
|
};
|
|
|
|
export default Parcelamento
|