import React, { useEffect } from "react"; import { useProduct } from "vtex.product-context"; import styles from "./style.module.css"; const Pix = () => { useEffect(() => { setTimeout(() => { const cepInput = document.querySelector(".vtex-address-form-4-x-input"); cepInput?.setAttribute("placeholder", "Digite seu CEP"); console.log(cepInput); }, 1000); }, []); const productContextValue = useProduct(); const productPrice = productContextValue?.product?.priceRange?.sellingPrice?.lowPrice; const discountValue = (Number(productPrice) * 10) / 100; const totalValue = Number(productPrice) - Number(discountValue); return (
R${totalValue.toFixed(2).replace(".", ",")}
10 % de desconto