I have used the following code for WishList and it worked perfectly (note: file name accordingly).
Code: Select all
<file path="catalog/controller/checkout/" name="cart.php">
<operation>
<search position="before" error="log"><![CDATA[$this->load->language]]></search>
<add><![CDATA[$this->load->language('product/product');
$data['text_discount'] = $this->language->get('text_discount');
$this->load->model('catalog/product');
]]></add>
</operation>
<operation>
<search position="before" error="log"><![CDATA[$data['products'][] = array(]]></search>
<add><![CDATA[
if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {
$discounts_data = $this->model_catalog_product->getProductDiscounts($result['product_id']);
$discounts = array();
foreach ($discounts_data as $discount) {
$discounts[] = array(
'quantity' => $discount['quantity'],
'price' => (version_compare(VERSION, '2.2.0.0') < 0 ? $this->currency->format($this->tax->calculate($discount['price'], $result['tax_class_id'], $this->config->get('config_tax'))) : $this->currency->format($this->tax->calculate($discount['price'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']))
);
}
}
]]></add>
</operation>
<operation>
<search position="after" error="log"><![CDATA[=> $image,]]></search>
<add><![CDATA[
'discounts' => $discounts,
'quantity' => $result['quantity'],
]]></add>
</operation>
</file>
<file path="catalog/view/theme/*/template/checkout/" name="cart.tpl">
<operation>
<search position="after" offset="5" error="log"><![CDATA[<?php echo $product['recurring']; ?>]]></search>
<add><![CDATA[
<?php if ($product['discounts']) { ?>
<hr style="margin: 2px 0;">
<ul class="list-unstyled">
<?php foreach ($product['discounts'] as $discount) { ?>
<li><?php echo $discount['quantity']; ?><?php echo $text_discount; ?><?php echo $discount['price']; ?></li>
<?php } ?>
</ul>
<?php } ?>
]]></add>
</operation>
</file>
Please suggest what I need to do.Notice: Undefined variable: result in /home/***/public_html/***/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_checkout_cart.php on line 175Notice: Undefined variable: result in /home/***/public_html/***/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_checkout_cart.php on line 189Notice: Undefined variable: result in /home/***/public_html/***/vqmod/vqcache/vq2-system_storage_modification_catalog_controller_checkout_cart.php on line 194
Thanks in advance