Post by sarunazs » Mon Oct 14, 2013 9:13 pm

Hello, can anyone tell me why do i get:

Code: Select all

Notice: Undefined index varname
in every single page of my opencart store to more then 10++ variables.

This happened then I added function using vqmod :

Code: Select all

<file name="system/library/cart.php">
<operation error="skip">
			<search position="before"><![CDATA[public function getSubTotal()]]></search>
			<add><![CDATA[  	public function getSubTotalNew() {
		$totals = array();
        $total = 0;
		$suppliersProducts = $this->getProducts(true);
        foreach($suppliersProducts as $supplierId => $products)
        {
            foreach($products as $product)
            {
                if(array_key_exists($supplierId, $totals))
                {
                    $total = $totals["sup_".$supplierId];
                }
                else
                {
                    $total = 0;
                }
                $total += $product['total'];

                $totals["sup_".$supplierId] = $total;
            }
        }

		return $totals;
  	}]]></add>
		</operation>
</file>
after that i'am getting Notice undefined index to almost every single variable which is not checked with isset()

i am using OpenCart 1.5.3.1 and latest vQmod 2.4.1

Please help. Thanks in advance.

Newbie

Posts

Joined
Mon Oct 14, 2013 8:59 pm

Post by butte » Sun Oct 20, 2013 4:07 am

It will be helpful to see the entire actual error (or error set, if more than one line per incident). Usually or often a casual summary of what an error set meant omits tiny snippets that show instead what threw the error.

You added a function. Was there any require (or require once) or include (or include once) that you omitted, such as may be above the "Find" snippet? Did you support it in the other cart.* files (they work together) by adding as necessary to their own routines?

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am
Who is online

Users browsing this forum: No registered users and 49 guests