After changes using VQMOD getting php Notice undefined index
Posted: Mon Oct 14, 2013 9:13 pm
Hello, can anyone tell me why do i get:
in every single page of my opencart store to more then 10++ variables.
This happened then I added function using vqmod :
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.
Code: Select all
Notice: Undefined index varname
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>
i am using OpenCart 1.5.3.1 and latest vQmod 2.4.1
Please help. Thanks in advance.