unnecessary queries when no results
Posted: Sat Mar 16, 2019 12:30 pm
Not sure if this was addressed before...
in 3.0.2.0 it is still the practice for product searches to:
This means even if the $product_total equals zero we do the second query anyway.
I kindly suggest:
in 3.0.2.0 it is still the practice for product searches to:
Code: Select all
$product_total = $this->model_catalog_product->getTotalProducts($filter_data);
$results = $this->model_catalog_product->getProducts($filter_data);
I kindly suggest:
Code: Select all
$product_total = $this->model_catalog_product->getTotalProducts($filter_data);
if ($product_total > 0) {
$results = $this->model_catalog_product->getProducts($filter_data);
} else {
$results = false;
}