8
It is possible I get a value within a tag <span></span>
? Ex: <span> 5% </span>
and calculate a discount at a value?
Example:
I want to get the value of 5% that is in the tag <span>
, subtract by product value and display the updated product value. You can do this with jQuery?
My code:
#set($id = $product.Id)
#set($uri = $product.Uri)
#set($escapedName = $product.HtmlEscapedName)
#set($evaluationRate = $product.EvaluationRate)
<!-- class: shelf prateleira vitrine home -->
<div class="shelfImageWrapper">
<div class="shelfButtonWrapper">
<div class="shelfAmountInCart">
$product.AmountInCart
</div>
<!--<div class="shelfBuyButtomWrapper">
$product.BottomBuyAsynchronous
</div>-->
</div>
<a class="shefImage" title="$escapedName" rel="nofollow" href="$uri">
<div class="shelfImage-1">$product.GetImageTag(235,235)</div>
</a>
</div>
<div class="shelfInformationWrapper">
<input type="hidden" value="$product.BestPrice" class="qd_productPrice" />
<input type="hidden" value="$product.ListPrice" class="qd_productOldPrice" />
<input type="hidden" value="$product.NumbersOfInstallment" class="qd_sp_installments" />
<h3><a title="$escapedName" href="$uri" rel="nofollow">$product.Name</a></h3>
#if ($product.IsInStock)
<div class="yv-review-quickreview" value="$id"></div>
<p class="shelfPriceWrapper">
<a title="$escapedName" rel="nofollow" href="$uri">
#if ($product.HasBestPrice)
<span class="shelfOldPriceWrapper">De $product.ListPrice</span>
<br/>
#end
Por <span class="shelfNewPriceWrapper">$product.BestPrice </span> <span>à vista</span>
<br/>
<span class="installmentWrapper">
#if ($product.NumbersOfInstallment > 1)
em até
<strong class="installment"> ${product.NumbersOfInstallment}x </strong>
de
<strong class="InstallmentValue"> $product.InstallmentValue </strong>
<span>s/juros</span>
#end
</span>
#if ($product.HasBestPrice)
<span class="saveAmount">economize <span class="qd_saveAmount">R$ </span> <small>(</small><span class="qd_saveAmountPercent">%</span><small>)</small></span>
#end
</a>
$product.BottomBuyAsynchronous
</p>
#else
<p class="outOfStock">Produto Indisponível</p>
#end
</div>
#if ($product.IsInStock)
<div class="shelfStampsWrapper">
<a title="Clique para ver as condições de frete" class="highlightWrapper" rel="nofollow" href="#" data-reveal-id="frete-gratis-vitrine" data-animation="fade">$product.HightLight</a>
<a title="$escapedName" class="highlightWrapper" rel="nofollow" href="$uri">$product.DiscountHightLight</a>
</div>
#end
What is this tag ? a label, a span, an input text ?
– Thiago Friedman
The tag that will have the value returned is a <span>, both tags are <span>
– Julio Santos
Could you post the HTML of this BOX? So we can analyze it better?
– Hiago Souza
So, I don’t know if you will understand very well, html is based on the platform that we use here in the company to program the store, but even so I will post, I edited the question with HTML
– Julio Santos