1
Speak guys, I have the following situation on my site, on the carts page have a div I need to change the content of it and put some calculations according to the total value, let go of the parameters:
The code will stay within the following if:
{% if pages.current == 'checkout_cart' %}
{% endif %}
The complete div is as follows:
<div class="board">
<h2 class="color" id="topo">Frete</h2>
</div>
The div of the total value is as follows:
<div id="mostra_total" class="valores_carrinho">40,00</div>
What I need to change:
Get the top ID: <h2 class="color" id="topo">Frete</h2>
, where ta written freight need to change to the following variable:
If the total value is less than 200, show the message instead of Freight: Missing X real for your freight stay Free! The calculation would be 200 - TOTAL VALUE, because from 200 real the shipping would be free.
If the total amount is more than 200, show message: Free Shipping!
Editing, a variable appeared for subtraction:
<div id="frete7" class="valores_carrinho">30</div>
This variable has to be subtracted from the total value in the sum, because it will be added independently of the products.
It would look something like this:
id="mostra_total" Valores do carrinho = 40,00
id="frete7" Valores do carrinho = 30,00
It will add up the 40 + 30, but the calculation for the remaining 200 must be only of the show_total, or need to subtract the value of freight
200 -(mostra_total - frete7)
Valor total para frete grátis = 200