1
Good morning!
On the website of the company I work, there are certain variables like this: {{order_total}}
In this case, I need to make a simple script, to take the total value and add an HTML in front...
$JQuery(function(){
var valordopedido = {{order_total}};
if(valordopedido >= 299){
$JQuery('<div class="msg-free_shipping"> <p><span class="warning">ATENÇÃO:</span> Comprando mais <span class="restante">R$259,10</span> você aproveita o <strong>FRETE GRÁTIS</strong> nas compras acima de <span class="valor-gratis">R$299,00</span></p> </div>').insertAfter('form#cart_update_post');
}});
Only it keeps giving the error: Uncaught Syntaxerror: Unexpected token {
Someone could help?
Thank you!
Actually this would not be a variable, but an expression. Are you using any framework? These expressions can be treated as variables within their scope in the business part, not in the view part. But specifying which language you are using and if you are using any framework, it is easier to help you.
– Gabriel Balladares
The site is developed on top of Magento, Gabriel!
– Lucas de Carvalho