<file path="catalog/model/catalog/product.php">
<operation>
<search><![CDATA[public function getProducts($data = array()) {]]></search>
<add>
<![CDATA[
/**
* Custom getProducts() method added by Brainy Filter extension
*/
public function getProducts($data = array())
{
if (!isset($data['filter_bfilter'])) {
return $this->getProductsOriginal($data);
}
$settings = $this->config->get('brainyfilter_layout_basic');
if (isset($settings['global']['subcategories_fix']) && $settings['global']['subcategories_fix']) {
$data['filter_sub_category'] = true;
}
$this->load->model('module/brainyfilter');
$model = new ModelModuleBrainyFilter($this->registry);
$model->setData($data);
$sql = $model->prepareQueryForCategory();
$query = $this->db->query($sql);
$product_data = array();
foreach ($query->rows as $result) {
$product_data[$result['product_id']] = $this->getProduct($result['product_id']);
}
return $product_data;
}
/**
* It is the original getProducts() method, which was renamed by Brainy Filter modification.
* A custom getProduct() method was added instead.
* Disable the Brainy Filter OCMOD modification in order to reset the method.
* Note: disabling of Brainy Filter modification will break the work of Brainy Filter extension.
*/
public function getProductsOriginal($data = array()) { ]]>
</add>
</operation>
<operation>
<search><![CDATA[public function getTotalProducts($data = array()) {]]></search>
<add>
<![CDATA[
/**
* Custom getTotalProducts() method added by Brainy Filter extension
*/
public function getTotalProducts($data = array())
{
if (!isset($data['filter_bfilter'])) {
return $this->getTotalProductsOriginal($data);
}
$settings = $this->config->get('brainyfilter_layout_basic');
if (isset($settings['global']['subcategories_fix']) && $settings['global']['subcategories_fix']) {
$data['filter_sub_category'] = true;
}
$this->load->model('module/brainyfilter');
$model = new ModelModuleBrainyFilter($this->registry);
$model->setData($data);
$sql = $model->prepareQueryForTotal();
$query = $this->db->query($sql);
return $query->row['total'];
}
/**
* It is the original getTotalProducts() method, which was renamed by Brainy Filter modification.
* A custom getTotalProducts() method was added instead.
* Disable the Brainy Filter OCMOD modification in order to reset the method.
* Note: disabling of Brainy Filter modification will break the work of Brainy Filter extension.
*/
public function getTotalProductsOriginal($data = array()) { ]]>
</add>
</operation>
</file>