I need to display the progressive discounts on the product listing on the promotion page (special.tpl), I can add on all other pages such as categories, highlights, product and etc but only with the promotion does not work.
I added the instructions in "catalog/controller/product/special.php" and when I call the variable it says it was not defined and testing the variable with "if (isset ()" informs that it does not exist.
Code used in the control catalog/controller/product/special.php
Code: Select all
$data['text_discount'] = '%s ou mais %s';
if (isset($this->data)) { $this->data = array_merge($this->data, $data); }
$discount_query = $this->model_catalog_product->getProductDiscounts($result['product_id']);
$discounts = array();
foreach ($discount_query as $discount) {
$discounts[] = array(
'quantity' => $discount['quantity'],
'price' => $this->currency->format($this->tax->calculate($discount['price'], $this->config->get('config_tax')), $this->session->data['currency'])
);
}
Code: Select all
<?php if ($product['discounts']) { ?>
<div class="discount">
<dt>
<dd><?php foreach ($product['discounts'] as $discount) { ?></dd>
<dd><b>Na compra de <?php echo sprintf($text_discount, $discount['quantity'], $discount['price']); ?></b></dd>
<?php } ?>
</dt>
</div>
<?php } ?>
Error image on promotions page (special.tpl):
thanks for the help!