When i add a product with 0.x price show error in category page and shop by filter extension taken a minimum price as 0.00 in the side left
My site:
https://www.innturk.com/Agriculture-Food/Food-productsrooftop snipers
Error:
/catalog/model/extension/module/so_filter_shop_by.php on line 313Notice:
313 Line :
Code: Select all
$price = $this->tax->calculate($data['price'], $data['tax_class_id'], $this->config->get('config_tax'));
Code: Select all
$data = $this->model_catalog_product->getProduct($result['product_id']);
$price = $this->tax->calculate($data['price'], $data['tax_class_id'], $this->config->get('config_tax'));
if ((float)$data['special']) {
$price = $this->tax->calculate($data['special'], $data['tax_class_id'], $this->config->get('config_tax'));
}
opencart Version 3.0.3.8
I think that the issue may be caused by the extension not handling zero prices correctly, and provides a possible solution to modify the so_filter_shop_by.php file to handle zero prices.
Here is the code that you can try adding to your so_filter_shop_by.php file:
if ($price == 0) {
$price = false;
}
This code should handle zero prices correctly and prevent the error from occurring. However, please note that modifying core files is not recommended and may cause issues in the future. It’s always best to create a backup of your files before making any changes. You also reference these links.
https://stackoverflow.com/questions/698 ... g-is-empty
viewtopic.php?t=230071