Hi, @anuarsaba ??
I’ve created a form on the single product page that opens a bootstrap modal where the customer can choose between open the PDF in a new window or receive it by e-mail:
<form id="orcamento-single-product-form" method="GET" action="<?php echo wc_get_cart_url(); ?>" target="_blank" class="w-100 br-24 mt-5 mt-lg-0">
<?php wp_nonce_field('cart-pdf', '_wpnonce', false, true ); ?>
<input class="d-none" type="text" readonly="readonly" name="cart-pdf" value="1" />
<input class="d-none" type="text" readonly="readonly" name="pagina" value="2" />
<input class="d-none" type="text" readonly="readonly" name="idproduto" value="<?php the_ID(); ?>" />
<input class="d-none" type="text" readonly="readonly" id="precoproduto" name="precoproduto" value="" />
<input class="d-none" type="text" readonly="readonly" id="emailorcamento" name="email" value="" />
<button id="enviar-form-personalizacao" type="submit" class="d-none">BAIXAR OR?AMENTO</button>
<div class="divisor-texto mb-4 mt-3"></div>
<a href="#" class="cor-roxo hover-roxo text-center text-lg-start d-inline-block w-100" title="Baixar or?amento" data-bs-toggle="modal" data-bs-target="#modal-orcamento-passo-1"><b>BAIXAR OR?AMENTO ></b></a>
<small id="orcamento-texto" class="d-none mb-4">*Selecione todos os componentes para habilitar o bot?o de or?amento.</small>
</form>
Then I modified the code on the plugin file (not recommended, but needed to achive what I wanted it) plugins/wc-cart-pdf/wc-cart-pdf.php to menage the parameters and behave the way I wanted, generating the PDF on the browser or send it via email to the custumer (with wp_mail).
Hope this helps you.