import React from "react"; import { useProduct } from "vtex.product-context"; import styles from "./styles.css"; const Pix = () => { const product = useProduct(); console.log(product) const pix = { pixValue: Number( product?.selectedItem?.sellers[0].commertialOffer.Price ), }; const discount = pix.pixValue * 0.1; const pixPrice = pix.pixValue - discount; return (
logo pix
R$ {pixPrice?.toFixed(2).toString().replace(".", ",")} 10 % de desconto
); }; export default Pix;