Jump to content

How to Remove Decimal points l in prices ?


JohnnyL

Recommended Posts

Hi!

 

Quick question, how can i remove decimal points from the pricetables? I only want to remove it from the price tables, as soon as client clicks on add and the cart comes up, it doesnt matter if the decimals are shown there.

 

ssss.png

 

I just want to remove the decimals from the pricetables since it looks better without the ,00.

 

 

 

Thanks all help is appreciated!

Link to comment
Share on other sites

Thats just perfect!!!

without any coding and all that, simple clean solution! :D

I have to say that I think this solution might be dangerous and potentially have serious legal consequences too - i'm thinking specifically if taxes are involved.

 

so let's say you have a product for £10 per month, and a 14.5% sales tax needs to be applied... normally, that would be £11.45 a month... if you change your currency settings to remove the decimal places, they'll get an invoice for £11 instead.

 

FU94CtS.png

 

legally your tax liability will still be £1.45 per month - the fact your only taking £1.00 from the client is irrelevant - you'd still be responsible for making up the difference!

 

if the tax rate was 17.5%, then instead of correctly taking £1.75 in tax, you'd be taking £2.00...

 

cec04ql.png

 

if you aren't charging a sales tax, then wulfric's solution might well be fine - but if you are using taxes, then i'd think very carefully about using this solution as it will not only change the prices in the tables, but throughout the whole ordering process... including the invoice (and any tax reports you run too).

Link to comment
Share on other sites

You are tottaly right!!

 

I cant have this! We DO charge taxes @ 21%.

 

All i wanted it to remove the decimal from the view of pricetables, but obviously they should be charged at the cart, like u showed in the screenshot.

 

So How to fix that brian?? Thanks allot btw for the notice! i overlooked that.. :/

Link to comment
Share on other sites

https://forum.whmcs.com/showthread.php?125618-Hide-decimals-from-order-form&p=503574#post503574

 

if you're using Premium Comparison template, and all your prices end in ',00' - then in products.tpl, you should need to change...

 

{$product.pricing.minprice.cycleText}

to...

 

 

{$product.pricing.minprice.cycleText|replace:',00':''}

 

I tried it, did not work, nothing changed.. the ,00 still there in producttable.. and yes i am using premium comparison..

 

What else can i try?

Link to comment
Share on other sites

in that pricing block of code in products.tpl, add the replace everywhere! e.g change...

 

                                      <div class="price-area">
                                           <div class="price" id="product{$product@iteration}-price">
                                               {if $product.bid}
                                                   {$LANG.bundledeal}
                                                   {if $product.displayprice}
                                                       <br /><br /><span>{$product.displayPriceSimple}</span>
                                                   {/if}
                                               {elseif $product.paytype eq "free"}
                                                   {$LANG.orderfree}
                                               {elseif $product.paytype eq "onetime"}
                                                   {$product.pricing.onetime} {$LANG.orderpaymenttermonetime}
                                               {else}
                                                   {if $product.pricing.hasconfigoptions}
                                                       {$LANG.from}
                                                   {/if}
                                                   {$product.pricing.minprice.cycleText}
                                                   <br>
                                                   {if $product.pricing.minprice.setupFee}
                                                       <small>{$product.pricing.minprice.setupFee->toPrefixed()} {$LANG.ordersetupfee}</small>
                                                   {/if}
                                               {/if}
                                           </div>

to...

 

                                      <div class="price-area">
                                           <div class="price" id="product{$product@iteration}-price">
                                               {if $product.bid}
                                                   {$LANG.bundledeal}
                                                   {if $product.displayprice}
                                                       <br /><br /><span>{$product.displayPriceSimple|replace:',00':''}</span>
                                                   {/if}
                                               {elseif $product.paytype eq "free"}
                                                   {$LANG.orderfree}
                                               {elseif $product.paytype eq "onetime"}
                                                   {$product.pricing.onetime|replace:',00':''} {$LANG.orderpaymenttermonetime}
                                               {else}
                                                   {if $product.pricing.hasconfigoptions}
                                                       {$LANG.from}
                                                   {/if}
                                                   {$product.pricing.minprice.cycleText|replace:',00':''}
                                                   <br>
                                                   {if $product.pricing.minprice.setupFee}
                                                        <small>{$product.pricing.minprice.setupFee->toPrefixed()}  {$LANG.ordersetupfee}</small>
                                                   {/if}
                                               {/if}
                                           </div>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated