Author Topic: Price won't be displayed with tax.  (Read 2695 times)


  • Beginner
  • *
  • Posts: 14
Price won't be displayed with tax.
« on: September 16, 2010, 14:39:09 pm »
Hi guys,

I downloaded the following module:

and there are 2 styles.

the first is an self made and the second is the productsnapshot.tpl
The productsnapshot.tpl has included the price with tax.

But the other don't, I wrote the author of the module but he don't writes back.

So my question is how can i let the price shown with tax in default style.

the code for including the price is the following:

Code: [Select]
<?php if ($params->get('show_price')==1){ ?>
                <div class="productprice_all">
                <div class="current_price"><?php echo $item->current_price."&nbsp".$params->get('currency_symbol'?></div>
                <?php if($item->current_price!=$item->old_price){?>
                <div class="old_price"><?php echo $item->old_price."&nbsp".$params->get('currency_symbol'?></div>
                <?php }    ?>

In the helper.php is the following, it's only the part with the price:

Code: [Select]
//Check if there is a discount
            $today=mktime(0,0,0,date("m, j, Y"));
            if($row->start_date <= $today && $row->end_date >= $today){
                $discount = ($row->is_percent)?($row->amount/100)*$row->product_price:$row->amount;
                $currentprice = $row->product_price - $discount;
            } else{
                $currentprice = $row->product_price;
            //Include tax?
                $currentprice = $currentprice + $currentprice * $row->tax_rate;
                $oldprice = $row->product_price + $row->product_price * $row->tax_rate;
            $lists[$i]->current_price = (round($currentprice,2) - intval(round($currentprice,2))==0)?intval(round($currentprice,2)):money_format("%2n", round($currentprice, 2));
            $lists[$i]->old_price = (round($oldprice,2) - intval(round($oldprice,2))==0)?intval(round($oldprice,2)):money_format("%2n", round($oldprice, 2));

        if ($db->getErrorNum()) {
            JError::raiseWarning( 500, $db->stderr() );

How can I change it? I want to use the default.php because I had fixed it to my template and up to now it looks good, and this style is easier to edit.

Sorry for my bad english :(
I normally speak german, hope you understand me...


  • Beginner
  • *
  • Posts: 14
Re: Price won't be displayed with tax.
« Reply #1 on: September 19, 2010, 17:55:03 pm »
Can anybody help me? Please, it is important.