miguel_team Posted December 7, 2015 Share Posted December 7, 2015 Olá, Estou com o seguinte problema e precisava da vossa ajuda: Tenho duas colunas que criei para exibir desconto de 4% e de 6% nos descontos de quantidades (imagem de exemplo em anexo) O problema é que está a calcular mal o desconto, ou seja não está a considerar a segunda cada decimal do preço.. Ficheiro: hookproduct.tpl Código: {if isset($discount_infos)}<div style="font-size:12px;" id="div_qdi_product_page"><table class="std table-product-discounts"> <thead> <tr> <th colspan="2"><strong>Quantidade</strong></th> <th colspan="2"><strong>Preço</strong></th> <th colspan="2"><strong>Poupança</strong></th> <th colspan="2"><strong>Preço c/ Desconto Financeiro<br/> 4%</strong></th> <th colspan="2"><strong>Preço c/ Desconto Financeiro<br/> 6%</strong></th> </tr> </thead> {foreach from=$discount_infos item=discount_info} <tr> <td colspan="2"><strong>{$discount_info['from_quantity']}{if empty($discount_info['to_quantity'])}+{else}-{$discount_info['to_quantity']}{/if}</strong></td> <td colspan="2"><strong>{$discount_info['final_price']}</strong></td> <td colspan="2"><strong>{$discount_info['real_value']}{if $discount_info['reduction_type'] != 'amount'}%{/if} {l s='Off' mod='agilequantitydiscountindicator'}</strong></td> <td class="table-product-preco" colspan="2"><strong>{convertPrice price=$discount_info['final_price']*0.96}</strong></td> <td class="table-product-preco" colspan="2"><strong>{convertPrice price=$discount_info['final_price']*0.94}</strong></td> </tr> {/foreach}</table></div>{/if} Link to comment Share on other sites More sharing options...
selectshop.at Posted December 11, 2015 Share Posted December 11, 2015 Por favor atente para as categorias do fórum. Estou movendo a su apergunta para a secao do fórum "ajuda e suporte da comunidade". Na secao "discussao geral" somente devem ser postadas dúvidas que nao se enquadram em NENHUMA secao do fórum. Link to comment Share on other sites More sharing options...
neogest.com.br Posted December 11, 2015 Share Posted December 11, 2015 Olá, Estou com o seguinte problema e precisava da vossa ajuda: Tenho duas colunas que criei para exibir desconto de 4% e de 6% nos descontos de quantidades (imagem de exemplo em anexo) O problema é que está a calcular mal o desconto, ou seja não está a considerar a segunda cada decimal do preço.. Ficheiro: hookproduct.tpl Código: {if isset($discount_infos)} <div style="font-size:12px;" id="div_qdi_product_page"> <table class="std table-product-discounts"> <thead> <tr> <th colspan="2"><strong>Quantidade</strong></th> <th colspan="2"><strong>Preço</strong></th> <th colspan="2"><strong>Poupança</strong></th> <th colspan="2"><strong>Preço c/ Desconto Financeiro<br/> 4%</strong></th> <th colspan="2"><strong>Preço c/ Desconto Financeiro<br/> 6%</strong></th> </tr> </thead> {foreach from=$discount_infos item=discount_info} <tr> <td colspan="2"><strong>{$discount_info['from_quantity']}{if empty($discount_info['to_quantity'])}+{else}-{$discount_info['to_quantity']}{/if}</strong></td> <td colspan="2"><strong>{$discount_info['final_price']}</strong></td> <td colspan="2"><strong>{$discount_info['real_value']}{if $discount_info['reduction_type'] != 'amount'}%{/if} {l s='Off' mod='agilequantitydiscountindicator'}</strong></td> <td class="table-product-preco" colspan="2"><strong>{convertPrice price=$discount_info['final_price']*0.96}</strong></td> <td class="table-product-preco" colspan="2"><strong>{convertPrice price=$discount_info['final_price']*0.94}</strong></td> </tr> {/foreach} </table> </div> {/if} Bem simples, sua formula está errada, não é assim que se faz essa conta. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now