Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Join Date
    Jan 2007
    Location
    Illinois, USA
    Posts
    312
    Plugin Contributions
    0

    Default Re: A non-numeric value encountered in shopping_cart.php

    Quote Originally Posted by DrByte View Post
    I don't dispute that it may have created a log on "your" server while I was attempting to figure out what I might need to create to replicate the problem.
    My point is that by using the steps I outlined, I could not recreate it on my system, so I'm wondering whether I missed a step in how I set up the product or its attributes?

    I have tested with the default template, no changes to template files, and the error is still created... so it's not a template file issue caused by modification.
    NTO: building a better network thru collaboration
    www.needtoorder.com | www.coffeewitheinstein.com

  2. #12
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: A non-numeric value encountered in shopping_cart.php

    Quote Originally Posted by Carbonless View Post
    I have tested with the default template, no changes to template files, and the error is still created... so it's not a template file issue caused by modification.
    I was able to recreate it, a walk around would be to replace line 737 with
    Code:
    $freeShippingTotal += (!empty($shipping_attributes_price) ? $shipping_attributes_price : 0) ;
    This fixes the warnings without getting to the source of the empty value. Not sure if Not Empty is correct! there maybe a better answer.. or casting it to a float?

    Recreated with a free shipping item with a cost, required text attribute without setting a price.
    Heavy modified ZC1.5.7b and php7.4
    Dave
    Always forward thinking... Lost my mind!

  3. #13
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: A non-numeric value encountered in shopping_cart.php

    Quote Originally Posted by davewest View Post
    I was able to recreate it, a walk around would be to replace line 737 with
    Code:
    $freeShippingTotal += (!empty($shipping_attributes_price) ? $shipping_attributes_price : 0) ;
    This fixes the warnings without getting to the source of the empty value. Not sure if Not Empty is correct! there maybe a better answer.. or casting it to a float?

    Recreated with a free shipping item with a cost, required text attribute without setting a price.
    Heavy modified ZC1.5.7b and php7.4
    While that bandage will work, I'd also like to figure out where the empty string value is coming from and why, in case the fix should be made "there" instead.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #14
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: A non-numeric value encountered in shopping_cart.php

    Quote Originally Posted by DrByte View Post
    While that bandage will work, I'd also like to figure out where the empty string value is coming from and why, in case the fix should be made "there" instead.
    PR coming... Looks like the use of an empty string ('') within the function called in the line before is a cause. Further it appears (using a php sandbox with PHP 7.4.16) that similar messages would be made from within the zen_get_discount_calc.

    PR is: https://github.com/zencart/zencart/pull/4166

    Haven't yet seen where the use of 0 will/may cause either a calculation issue or display of incorrect information where not desired. (E.g. showing the price of something as 0 where instead it should be "empty") Also haven't run this against the "upcoming" zen_not_null function in case the value returned is a zero which would be an integer...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #15
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: A non-numeric value encountered in shopping_cart.php

    Confirmed: the updates to includes/functions/functions_prices.php to fix this are staged in v157c, at:
    https://github.com/zencart/zencart/r...ons_prices.php
    which can safely be used in v157b
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #16
    Join Date
    Jan 2007
    Location
    Illinois, USA
    Posts
    312
    Plugin Contributions
    0

    Default Re: A non-numeric value encountered in shopping_cart.php

    Quote Originally Posted by DrByte View Post
    Confirmed: the updates to includes/functions/functions_prices.php to fix this are staged in v157c, at:
    https://github.com/zencart/zencart/r...ons_prices.php
    which can safely be used in v157b
    Tested & Confirming as well: This fix eliminated the creation of error log entry when an item has been added to cart!
    NTO: building a better network thru collaboration
    www.needtoorder.com | www.coffeewitheinstein.com

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v155 Php Warning A non-numeric value encountered
    By ianhg in forum General Questions
    Replies: 1
    Last Post: 3 Jul 2019, 10:56 AM
  2. Replies: 1
    Last Post: 15 Dec 2018, 10:54 PM
  3. Replies: 2
    Last Post: 18 Nov 2018, 04:06 AM
  4. Replies: 38
    Last Post: 1 Nov 2018, 09:28 PM
  5. Replies: 0
    Last Post: 18 Feb 2018, 06:26 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