Post by asifshaikh » Mon Jun 17, 2019 1:42 pm

Version 2.3.0.2

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>
but the same code used for shopping cart its displaying the error message as follows
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
Please suggest what I need to do.
Thanks in advance
Last edited by asifshaikh on Mon Jun 17, 2019 2:04 pm, edited 2 times in total.

Newbie

Posts

Joined
Sat Sep 08, 2012 9:36 pm

Post by asifshaikh » Mon Jun 17, 2019 2:03 pm

Solved it myself.

Replaced $result with $product
:D

Newbie

Posts

Joined
Sat Sep 08, 2012 9:36 pm
Who is online

Users browsing this forum: No registered users and 6 guests