This is what you need to do. I'm using v.1.2, but it may work for you.
Files to be edited:
catalog/.../template/product/product.tpl
catalog/controller/product/product.php
model/catalog/product.php
First: catalog/.../template/product/product.tpl
Change where the price is shown by:
Code: Select all
<tr>
<td><b><?php echo $text_price; ?></b></td>
<td>
<?php if (!$discount) { ?>
<?php echo $price; ?>
<?php } else { ?>
<u style="color: #F00; text-decoration: line-through;"><?php echo $price; ?></u> >
<?php echo $discount; ?>
<?php } ?>
</td>
</tr>
Then, catalog/controller/product.php:
Add it below " $this->data['price']"
Code: Select all
$this->data['discount'] = ($product_info['discount'] ? $this->currency->format($this->tax->calculate($product_info['price'] - $product_info['discount'], $product_info['tax_class_id'], $this->config->get('config_tax'))) : NULL);
You will need to replace the whole function. Basically I Added: "d.discount" AND "LEFT JOIN product_discount d ON (p.product_id = d.product_id)" to the query.
Code: Select all
public function getProduct($product_id) {
$query = $this->db->query("SELECT DISTINCT *, pd.name AS name, p.image, m.name AS manufacturer, ss.name AS stock, d.discount FROM product p LEFT JOIN product_description pd ON (p.product_id = pd.product_id) LEFT JOIN product_discount d ON (p.product_id = d.product_id) LEFT JOIN manufacturer m ON (p.manufacturer_id = m.manufacturer_id) LEFT JOIN stock_status ss ON (p.stock_status_id = ss.stock_status_id) WHERE p.product_id = '" . (int)$product_id . "' AND pd.language_id = '" . (int)$this->language->getId() . "' AND ss.language_id = '" . (int)$this->language->getId() . "' AND p.date_available <= NOW() AND p.status = '1'");
return $query->row;
}