-2
I have the following Opencart code snippet in Twig.
{% for quote in shipping_method.quote %}
<div class="radio">
<label id="{{quote.code}}"> {% if quote.code == code or not code %}
{% set code = quote.code %}
<input type="radio" name="shipping_method" value="{{ quote.code }}" checked="checked" />
{% else %}
<input type="radio" name="shipping_method" value="{{ quote.code }}" />
{% endif %}
{{ quote.title }} - {{ quote.text }}</label>
</div>
{% endfor %}
Where I get a value {{quote.text}}
and I need to remove it, but it’s not for everything. Only when this value is R$0.00; this mine ID
of label
is defined by id="flat.flat"
Once rendered it looks like this:
<label id="flat.flat">
<input type="radio" name="shipping_method" value="flat.flat">
Frete para outras regiões, entrar em contato - R$0,00
</label>
What I tried to do in jQuery and stayed in the following way
<script>
$(document).ready(function(){
var auxiliar = $('#flat.flat').text();
console.log(auxiliar);
auxiliar = auxiliar.replace('- R$0,00','');
console.log(auxiliar);
$("#flat.flat").html(auxiliar);
});
</script>
But it does not return anything on the console. What I need to change for it to work?
Unfortunately, I’m not familiar with this rendering syntax, but one thing I wonder about: does it have conditional rendering? Tell me the name of that engine, please, maybe I can help you.
– Taffarel Xavier
I forgot to pass, I use Opencart and the file is Twig
– Andre Lacomski