I am using 3.0.2.0 version. Getting "Division by zero in /catalog/controller/product/category.php on line 209Warning: Division by zero in" error. Looked at the line and saw that below is making this because of zero priced products. How can i take it into if else formula ?
Code: Select all
'sprice' => round(($price-$special)/$price*100),
Code: Select all
$data['products'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
'thumb_swap' => $images,
'name' => $result['name'],
'quantity' => $result['quantity'],
'price' => $price,
'special' => $special,
'sprice' => round(($price-$special)/$price*100),
'tax' => $tax,
'minimum' => $result['minimum'] > 0 ? $result['minimum'] : 1,
'rating' => $result['rating'],
'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url)
);