Post by ahmadbkye12 » Mon May 16, 2022 10:40 pm

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-products
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

Newbie

Posts

Joined
Thu Nov 28, 2019 11:34 pm

Post by IP_CAM » Tue May 17, 2022 1:33 am

so-emarket Theme, so_filter_shop_by.php
You better contact the SO Theme Extension Supplier on this, it's not an Opencart-related Problem.

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by ahmadbkye12 » Thu May 19, 2022 7:14 pm

No i think its about php code or opencart settings, because the extension working good with another categories.
just inside this section when we take a product with price less than 1$ he show this error.

can anyone help me ?

Newbie

Posts

Joined
Thu Nov 28, 2019 11:34 pm

Post by Saxonms » Fri Sep 29, 2023 4:52 pm

Is it any solution?

Newbie

Posts

Joined
Mon Sep 04, 2017 4:56 pm

Post by rogerours » Tue Oct 10, 2023 2:23 pm

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

Newbie

Posts

Joined
Tue Oct 10, 2023 12:56 pm

Post by JNeuhoff » Wed Oct 11, 2023 5:19 am

ahmadbkye12 wrote:
Thu May 19, 2022 7:14 pm
No i think its about php code or opencart settings, because the extension working good with another categories.
just inside this section when we take a product with price less than 1$ he show this error.

can anyone help me ?
Is there any reason why you won't ask the extension author on this? OpenCart supports zero-priced products without any issues.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am

Who is online

Users browsing this forum: No registered users and 14 guests