Page 4 of 4 FirstFirst ... 234
Results 31 to 39 of 39
  1. #31
    Join Date
    Feb 2007
    Posts
    224
    Plugin Contributions
    0

    Default Re: PHP Warning: A non-numeric value encountered... admin, currencies.php

    Quote Originally Posted by mc12345678 View Post
    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.

  2. #32
    Join Date
    Sep 2008
    Posts
    54
    Plugin Contributions
    0

    Default 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

  3. #33
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: PHP Warning: A non-numeric value encountered... admin, currencies.php

    Quote Originally Posted by Doomm View Post
    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.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #34
    Join Date
    Sep 2008
    Posts
    54
    Plugin Contributions
    0

    Default 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.

  5. #35
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: PHP Warning: A non-numeric value encountered... admin, currencies.php

    Quote Originally Posted by Doomm View Post
    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.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #36
    Join Date
    Sep 2008
    Posts
    54
    Plugin Contributions
    0

    Default Re: PHP Warning: A non-numeric value encountered... admin, currencies.php

    Quote Originally Posted by mc12345678 View Post
    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?

  7. #37
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,399
    Plugin Contributions
    87

    Default 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!

  8. #38
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: PHP Warning: A non-numeric value encountered... admin, currencies.php

    Quote Originally Posted by Doomm View Post
    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).
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #39
    Join Date
    Sep 2008
    Posts
    54
    Plugin Contributions
    0

    Default Re: PHP Warning: A non-numeric value encountered... admin, currencies.php

    Quote Originally Posted by mc12345678 View Post
    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

 

 
Page 4 of 4 FirstFirst ... 234

Similar Threads

  1. Replies: 1
    Last Post: 15 Dec 2018, 10:54 PM
  2. Replies: 2
    Last Post: 18 Nov 2018, 04:06 AM
  3. Replies: 0
    Last Post: 18 Feb 2018, 06:26 PM
  4. Replies: 20
    Last Post: 7 Dec 2014, 11:29 AM
  5. Replies: 0
    Last Post: 27 Sep 2012, 11:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR