import React from 'react'; import {useProduct} from 'vtex.product-context'; import './styles.css'; const pixCustom = () => { const productContextValue = useProduct() // {productContextValue?.product?.priceRange.sellingPrice.highPrice} const valorString = productContextValue?.product?.priceRange.sellingPrice.lowPrice; const valorNumber = Number(valorString) const desconto = 0.9 var pix = (valorNumber * desconto).toFixed(2).replace(".", ",") console.log(pix); return(
Imagem Pix

R$ ${pix}

10% de desconto

); } export default pixCustom