Re: PHP Warning: A non-numeric value encountered... admin, currencies.php
Quote:
Originally Posted by
mc12345678
Sorry, more than likely will need to add the above at or around line 58 so that $level will be forced to be an integer. In newer php versions it is/will be possible to cast/expect the value to be an integer, but to maintain the existing backwards compatibility the above was the way chosen.
Thanks a million, it seems to work, so far no error files in the /logs directory, thanks again.
Re: PHP Warning: A non-numeric value encountered... admin, currencies.php
Hi, buddies,
after upgrade of my shop to version 1.5.5f and upgrade of PHP to 7.1, I recieved PHP Warning with "a non numeric value encountered" for categories_ul_generator.php and thanks to your updates was able to resolve it fast.
However now I´m stuck,
I recieved the same PHP warning here:
[01-Nov-2018 00:33:02 UTC] Request URI: /index.php?main_page=shopping_cart, IP address: xxx
#1 zones->quote() called at [/home/xxx/public_html/includes/classes/shipping.php:171]
#2 shipping->quote() called at [/home/xxx/public_html/includes/modules/shipping_estimator.php:140]
#3 require(/home/xxx/public_html/includes/modules/shipping_estimator.php) called at [/home/xxx/public_html/includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php:194]
#4 require(/home/xxx/public_html/includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php) called at [/home/xxx/public_html/includes/templates/responsive_classic/common/tpl_main_page.php:171]
#5 require(/home/xxx/public_html/includes/templates/responsive_classic/common/tpl_main_page.php) called at [/home/xxx/public_html/index.php:97]
[01-Nov-2018 00:33:02 UTC] PHP Warning: A non-numeric value encountered in /home/xxx/public_html/includes/modules/shipping/zones.php on line 257
line 257 in zones.php looks like this:
$shipping_cost = ($shipping) + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);
any help would be very much appreciated, guys
Re: PHP Warning: A non-numeric value encountered... admin, currencies.php
Quote:
Originally Posted by
Doomm
Hi, buddies,
after upgrade of my shop to version 1.5.5f and upgrade of PHP to 7.1, I recieved PHP Warning with "a non numeric value encountered" for categories_ul_generator.php and thanks to your updates was able to resolve it fast.
However now I´m stuck,
I recieved the same PHP warning here:
[01-Nov-2018 00:33:02 UTC] Request URI: /index.php?main_page=shopping_cart, IP address: xxx
#1 zones->quote() called at [/home/xxx/public_html/includes/classes/shipping.php:171]
#2 shipping->quote() called at [/home/xxx/public_html/includes/modules/shipping_estimator.php:140]
#3 require(/home/xxx/public_html/includes/modules/shipping_estimator.php) called at [/home/xxx/public_html/includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php:194]
#4 require(/home/xxx/public_html/includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php) called at [/home/xxx/public_html/includes/templates/responsive_classic/common/tpl_main_page.php:171]
#5 require(/home/xxx/public_html/includes/templates/responsive_classic/common/tpl_main_page.php) called at [/home/xxx/public_html/index.php:97]
[01-Nov-2018 00:33:02 UTC] PHP Warning: A non-numeric value encountered in /home/xxx/public_html/includes/modules/shipping/zones.php on line 257
line 257 in zones.php looks like this:
$shipping_cost = ($shipping) + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);
any help would be very much appreciated, guys
Looks like in your zones shipping module that for each applicable zone that a value needs to be entered instead of an empty string. So, if there is no handling fee, then a value of 0 should be entered instead of leaving it blank.
Re: PHP Warning: A non-numeric value encountered... admin, currencies.php
So if I understand it correctly, this should be done from the admin and there is no need to change of the code.
Thank you very much for your time and help.
Re: PHP Warning: A non-numeric value encountered... admin, currencies.php
Quote:
Originally Posted by
Doomm
So if I understand it correctly, this should be done from the admin and there is no need to change of the code.
Thank you very much for your time and help.
No *need*, but an improvement in the base code could be made to default to a 0 instead of empty, but typing in a value of 0 should resolve that warning.
Re: PHP Warning: A non-numeric value encountered... admin, currencies.php
Quote:
Originally Posted by
mc12345678
No *need*, but an improvement in the base code could be made to default to a 0 instead of empty, but typing in a value of 0 should resolve that warning.
I´m so sorry, I´m not following you (not really a coder, here) and I´m very grateful for your patience.
Could you please direct me where in this php file (zones.php), should I be looking for this empty string?
Re: PHP Warning: A non-numeric value encountered... admin, currencies.php
Editing the zc155f version of /includes/modules/shipping/zones.php, find:
Code:
// class constructor
function __construct() {
$this->code = 'zones';
$this->title = MODULE_SHIPPING_ZONES_TEXT_TITLE;
$this->description = MODULE_SHIPPING_ZONES_TEXT_DESCRIPTION;
$this->sort_order = MODULE_SHIPPING_ZONES_SORT_ORDER;
$this->icon = '';
$this->tax_class = MODULE_SHIPPING_ZONES_TAX_CLASS;
$this->tax_basis = MODULE_SHIPPING_ZONES_TAX_BASIS;
and add the highlighted fragments:
Code:
// class constructor
function __construct() {
$this->code = 'zones';
$this->title = MODULE_SHIPPING_ZONES_TEXT_TITLE;
$this->description = MODULE_SHIPPING_ZONES_TEXT_DESCRIPTION;
$this->sort_order = (int)MODULE_SHIPPING_ZONES_SORT_ORDER;
$this->icon = '';
$this->tax_class = (int)MODULE_SHIPPING_ZONES_TAX_CLASS;
$this->tax_basis = MODULE_SHIPPING_ZONES_TAX_BASIS;
Note that I've also applied that integer "cast" to the tax-class-id, just in case!
Re: PHP Warning: A non-numeric value encountered... admin, currencies.php
Quote:
Originally Posted by
Doomm
I´m so sorry, I´m not following you (not really a coder, here) and I´m very grateful for your patience.
Could you please direct me where in this php file (zones.php), should I be looking for this empty string?
To address the specific warning message that was presented, the only thing necessary was to enter in a number into the handling fee area for each of the zones and not leave it blank. This entry is performed from admin->modules->shipping->zones.
It appears the code already contains a default value of '0' at least when first installing the additional zone(s).
Re: PHP Warning: A non-numeric value encountered... admin, currencies.php
Quote:
Originally Posted by
mc12345678
To address the specific warning message that was presented, the only thing necessary was to enter in a number into the handling fee area for each of the zones and not leave it blank. This entry is performed from admin->modules->shipping->zones.
It appears the code already contains a default value of '0' at least when first installing the additional zone(s).
Great, that´s what I did in the first place, but was not sure, if it´s enough.
Thank you very much for your help and understanding,
cheers