Totally Zenned
- Join Date:
- Aug 2007
- Location:
- Gijón, Asturias, Spain
- Posts:
- 2,876
- Plugin Contributions:
- 7
[Done v1.5.6] PHP Warning: A non-numeric value encountered... - PHP 7 warnings
I have had a couple of these debug warnings with PHP 7.1. No doubt there will be more...
- in advanced_search_result_header.php
I changed
$rate = $currencies->get_value($_SESSION['currency']);
if ($rate) {
$pfrom = $_GET['pfrom'] / $rate;
$pto = $_GET['pto'] / $rate;}
to
$rate = $currencies->get_value($_SESSION['currency']);
if ($rate) {
$pfrom = (float)$_GET['pfrom'] / $rate;//steve added float for PHP 7 warning
$pto = (float)$_GET['pto'] / $rate;//steve added float for PHP 7 warning
}
Note this was provoked by an url like this
SHOP_ROOT/index.php?main_page=advanced_search_result&keyword=asas&search_in_description=1&categories_id=&inc_subcat=1&manufacturers_id=&pfrom=&pto=&dfrom=&dto=
- functions_taxes.php
I changed
// Calculates Tax rounding the result function
zen_calculate_tax($price, $tax = 0) {
$price = $price;
$tax = $tax;
//eof global $currencies;
return $price * $tax / 100;
}
to
// Calculates Tax rounding the result
function zen_calculate_tax($price, $tax = 0) {
$price = (float)$price; //steve added float for PHP 7 warning
$tax = (float)$tax; //steve added float for PHP 7 warning
//eof global $currencies;
return $price * $tax / 100;
}
Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...