I have a questiion about woocommerce Views
I have been playing with Discover Wp, on the woocommerce example the price fields doesn't show the 00 at the end and the commas.
Is there anyway to show it?
Dear Willan,
You can configure this in WooCommerce > Catalog Settings, you need to disable the "remove zeros" option.
Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.
Hi Adriano,
I changed and it worked on the listing page, but on sigle view template dosen't show the 00 and the comma.
Any ideas why it is not working??
Thanks..
Dear Willan,
Please let me see the code of this View.
Adriano,
This is the code i made:
<h2 class="tituloProduto">[wpv-post-title]</h2>
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_pinterest_pinit"></a>
<a class="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=xa-51899aa04bcd1d4a"></script>
<!-- AddThis Button END -->
<div class="imagemProduto img-polaroid">
[types field="foto" proportional="true" align="none"][/types]
</div><!-- imagemProduto -->
<div class="fotos">
<br>
<ul class="thumbnails">
[wpv-for-each field="wpcf-foto-do-produto"]
<li class="span2">
<div>
<a href="[types field="foto-do-produto" raw="true"][/types]" class="thumbnail fancybox" rel="fancybox">
[types field="foto-do-produto" size="full" align="none"][/types]
</a>
</div>
[/wpv-for-each]
</div>
<div class="row">
<div class="preco span3">
<div class="preco-antigo">
<p>de <span><span class="price">R$ [wpv-post-field name="_regular_price"]</span></span></p>
</div><!-- preco-antigo -->
<div class="preco-atual">
<p>por <span><span class="price">R$ [wpv-post-field name="_sale_price"]</span></span> </p>
</div><!-- preco-atual -->
</div><!-- preco -->
<div class="span3">
<div id="parcelado" class="span3 vezes">
<p>Parcele em até <br><span>6 X </span><br>sem juros no cartão</p><br>
</div>
</div><!-- span3 -->
<div class="span3">
<div class="botao">
[wpv-wooaddcart]
</div><!-- botao -->
</div><!-- span3 -->
</div><!-- row -->
<br>
<div class="boxProduto">
<ul class="nav nav-tabs" id="myTab">
<li class="active"><a href="#1">Incluso no pacote</a>
<a href="#2">Sugestão de Roteiro</a>
<a href="#3">Regras da oferta</a>
<a href="#4">Videos</a>
<div class="tab-content">
<div class="tab-pane active" id="1">
[wpv-post-body view_template="None"]
</div><!-- 1 -->
<div class="tab-pane" id="2">
[types field="sugestao_de_roteiro" class="" style=""][/types]
</div><!-- 2 -->
<div class="tab-pane" id="3">
[types field="regras-da-oferta" class="" style=""][/types]
</div><!-- 3 -->
<div class="tab-pane" id="4">
[types field="videos" class="" style=""][/types]
</div><!-- 4 -->
</div><!-- tabs -->
</div><!-- boxProduto -->
But the i also tried on the example woocommerce site on Discover Wp, and i did't show it.
Dear Willan,
Try to use this custom shortcode that I created, put it on your functions.php file:
add_shortcode( 'showdecimal', 'showdecimal_func');
function showdecimal_func($atts){
extract( shortcode_atts( array(
'price' => '',
), $atts ) );
return number_format($price, 2, '.', ',');
}
Now you can use it on your View content, like this:
<span class="price">R$ [showdecimal price="[wpv-post-field name="_regular_price"]"]</span>
Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.