I want to show the individual price of each product, tax included and tax excluded on the shopping cart page. I configured opencart to display prices including tax, but I want to add a column to show the price without tax. I have Opencart 1.5.6. Please can someone help me ?. I tried to modify cart.php
and cart.tpl
but I have not succeeded, $price_extax
shows last price in all products in shopping cart. Thank You.
In cart.tpl
I added following code:
It shows column tittle:
<td class="price"><?php echo "Price ex-tax"; ?></td>
It shows price:
<td class="price"><?php echo $price_extax; ?></td>
In cart.php I added following code:
$this->data['price_extax'] = $this->currency->format($this->tax->calculate($product['price'],$product['tax_class_id'], $this->config->get('config_tax'))/1.12); //My code (tax is 12%)
<td class="price"><?php echo "Price ex-tax"; ?></td>
??? Isn't this<td class="price">Price ex-tax</td>
enough? Maybe some advanced learning of PHP, HTML, CSS, JS (and recommended is MySQL as well!) should happen before you start implementing something in bigger applications... This is your price excl. tax: find this line$this->data['products'][] = array(
and add a new line into this array:'price_extax' => $product['price'],
- this is it. – shadyyx