Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Apr 2006
    Location
    Midland TX
    Posts
    428
    Plugin Contributions
    0

    Default zipship & PHP 7.1

    Hope this is correct location for this post.
    After new build and import old DB for
    customer/orders everything works great on php5.6. When I switch to 7.1 and click on "Checkout" page is White. Have two sites and both do the same. Other pages seem to work OK. I am using OPC, EMP, zipship.
    Need help on this one.

    Here is the error log file:


    [15-Aug-2017 13:11:52 America/New_York] Request URI: /secure/index.php?main_page=shopping_cart, IP address: 66.90.231.62
    #1 zen_calculate_tax() called at [/home/ezorb1/public_html/EZorb/secure/includes/classes/order.php:556]
    #2 order->cart() called at [/home/ezorb1/public_html/EZorb/secure/includes/classes/order.php:35]
    #3 order->__construct() called at [/home/ezorb1/public_html/EZorb/secure/includes/modules/shipping_estimator.php:89]
    #4 require(/home/ezorb1/public_html/EZorb/secure/includes/modules/shipping_estimator.php) called at [/home/ezorb1/public_html/EZorb/secure/includes/templates/responsive4Ezorb/templates/tpl_shopping_cart_default.php:178]
    #5 require(/home/ezorb1/public_html/EZorb/secure/includes/templates/responsive4Ezorb/templates/tpl_shopping_cart_default.php) called at [/home/ezorb1/public_html/EZorb/secure/includes/templates/responsive4Ezorb/common/tpl_main_page.php:171]
    #6 require(/home/ezorb1/public_html/EZorb/secure/includes/templates/responsive4Ezorb/common/tpl_main_page.php) called at [/home/ezorb1/public_html/EZorb/secure/index.php:97]

    [15-Aug-2017 13:11:52 America/New_York] PHP Warning: A non-numeric value encountered in /home/ezorb1/public_html/EZorb/secure/includes/functions/functions_taxes.php on line 172
    [15-Aug-2017 13:11:52 America/New_York] Request URI: /secure/index.php?main_page=shopping_cart, IP address: 66.90.231.62
    #1 zen_calculate_tax() called at [/home/ezorb1/public_html/EZorb/secure/includes/classes/order.php:557]
    #2 order->cart() called at [/home/ezorb1/public_html/EZorb/secure/includes/classes/order.php:35]
    #3 order->__construct() called at [/home/ezorb1/public_html/EZorb/secure/includes/modules/shipping_estimator.php:89]
    #4 require(/home/ezorb1/public_html/EZorb/secure/includes/modules/shipping_estimator.php) called at [/home/ezorb1/public_html/EZorb/secure/includes/templates/responsive4Ezorb/templates/tpl_shopping_cart_default.php:178]
    #5 require(/home/ezorb1/public_html/EZorb/secure/includes/templates/responsive4Ezorb/templates/tpl_shopping_cart_default.php) called at [/home/ezorb1/public_html/EZorb/secure/includes/templates/responsive4Ezorb/common/tpl_main_page.php:171]
    #6 require(/home/ezorb1/public_html/EZorb/secure/includes/templates/responsive4Ezorb/common/tpl_main_page.php) called at [/home/ezorb1/public_html/EZorb/secure/index.php:97]

    [15-Aug-2017 13:11:52 America/New_York] PHP Warning: A non-numeric value encountered in /home/ezorb1/public_html/EZorb/secure/includes/functions/functions_taxes.php on line 172
    [15-Aug-2017 13:11:55 America/New_York] PHP Fatal error: Uncaught Error: Call to undefined function split() in /home/ezorb1/public_html/EZorb/secure/includes/modules/shipping/zipship.php:103
    Stack trace:
    #0 /home/ezorb1/public_html/EZorb/secure/includes/classes/shipping.php(171): zipship->quote('')
    #1 /home/ezorb1/public_html/EZorb/secure/includes/modules/shipping_estimator.php(140): shipping->quote()
    #2 /home/ezorb1/public_html/EZorb/secure/includes/templates/responsive4Ezorb/templates/tpl_shopping_cart_default.php(178): require('/home/ezorb1/pu...')
    #3 /home/ezorb1/public_html/EZorb/secure/includes/templates/responsive4Ezorb/common/tpl_main_page.php(171): require('/home/ezorb1/pu...')
    #4 /home/ezorb1/public_html/EZorb/secure/index.php(97): require('/home/ezorb1/pu...')
    #5 {main}
    thrown in /home/ezorb1/public_html/EZorb/secure/includes/modules/shipping/zipship.php on line 103

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,521
    Plugin Contributions
    88

    Default Re: 155e & PHP 7.1

    It looks like you're using a downlevel version of ZipShip (https://www.zen-cart.com/downloads.php?do=file&id=312). I updated it late last year to remove those calls to the deprecated split function.

  3. #3
    Join Date
    Apr 2006
    Location
    Midland TX
    Posts
    428
    Plugin Contributions
    0

    Default Re: 155e & PHP 7.1

    Well I show I downloaded 2.01 but I sure may have forgot to install it. I will check what was installed.

    Thanks,
    Larry

    Quote Originally Posted by lat9 View Post
    It looks like you're using a downlevel version of ZipShip (https://www.zen-cart.com/downloads.php?do=file&id=312). I updated it late last year to remove those calls to the deprecated split function.

  4. #4
    Join Date
    Apr 2006
    Location
    Midland TX
    Posts
    428
    Plugin Contributions
    0

    Default Re: 155e & PHP 7.1

    I am using version 2.0.1. Any other ideas?

    Larry

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,521
    Plugin Contributions
    88

    Default Re: 155e & PHP 7.1

    Nope; v2.0.1 does not include any call to the PHP split function.

  6. #6
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,696
    Plugin Contributions
    9

    Default Re: 155e & PHP 7.1

    you have 2 problems. first you need to reinstall zipship. or you could just try to replace:

    includes/modules/shipping/zipship.php

    @lat9 is correct. the download link she provided does not include the split function. so getting that error there means you do NOT have the proper scripts installed.

    the second error is new to php7.1. if you try to do a numeric function on a null value, you get a php warning. you need to track down line 172 of

    includes/functions/functions_taxes.php

    and change code:

    Code:
    // from:
    return $price * $tax / 100;
    
    // to:
    return (int)$price * (int)$tax / 100;
    i think that should work.

    good luck.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  7. #7
    Join Date
    Jan 2004
    Posts
    66,374
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: 155e & PHP 7.1

    Quote Originally Posted by carlwhat View Post
    the second error is new to php7.1. if you try to do a numeric function on a null value, you get a php warning. you need to track down line 172 of

    includes/functions/functions_taxes.php

    and change code:

    Code:
    // from:
    return $price * $tax / 100;
    
    // to:
    return (int)$price * (int)$tax / 100;
    i think that should work.

    good luck.
    NO!

    First, it's only a warning. It's not halting execution. "Warning: A non-numeric value ..."

    Second, using (int) will chop off all decimal place precision. If a bandage is intended, then use (float) instead.
    But fixing it by making this change is better: https://github.com/zencart/zencart/pull/1437/files
    .

    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.

  8. #8
    Join Date
    Apr 2006
    Location
    Midland TX
    Posts
    428
    Plugin Contributions
    0

    Default Re: 155e & PHP 7.1

    All my products are non-taxable. So why is this function involved? If I am correct it is dividing 0/100.

    What should I do to fix this problem.

    Larry

    Quote Originally Posted by DrByte View Post
    NO!

    First, it's only a warning. It's not halting execution. "Warning: A non-numeric value ..."

    Second, using (int) will chop off all decimal place precision. If a bandage is intended, then use (float) instead.
    But fixing it by making this change is better: https://github.com/zencart/zencart/pull/1437/files

  9. #9
    Join Date
    Apr 2006
    Location
    Midland TX
    Posts
    428
    Plugin Contributions
    0

    Default Re: 155e & PHP 7.1

    Installed on Test Site just forgot to install on Live Site. DUH...........
    PHP issue fixed.

    Quote Originally Posted by EZorb View Post
    Well I show I downloaded 2.01 but I sure may have forgot to install it. I will check what was installed.

    Thanks,
    Larry

  10. #10
    Join Date
    Jan 2004
    Posts
    66,374
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: 155e & PHP 7.1

    Quote Originally Posted by EZorb View Post
    Quote Originally Posted by DrByte View Post
    NO!

    First, it's only a warning. It's not halting execution. "Warning: A non-numeric value ..."

    Second, using (int) will chop off all decimal place precision. If a bandage is intended, then use (float) instead.
    But fixing it by making this change is better: https://github.com/zencart/zencart/pull/1437/files
    All my products are non-taxable. So why is this function involved? If I am correct it is dividing 0/100.

    What should I do to fix this problem.

    Larry
    The bug that's fixed in the code provided specifically deals with 0-value tax division errors.

    To fix it, make the changes as shown in the link above. (lines in red are the "old", and the green is the "new"; skip the - or + symbols at the beginning of any lines)
    .

    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.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v154 ZipShip - Support Thread
    By lat9 in forum Addon Shipping Modules
    Replies: 94
    Last Post: 16 Apr 2024, 10:07 PM
  2. v154 application/x-httpd-php html_header.php PHP script text
    By Parafanaylya in forum General Questions
    Replies: 3
    Last Post: 29 Aug 2015, 03:06 PM
  3. Replies: 4
    Last Post: 17 Jul 2015, 04:44 AM
  4. Handling Fee per item with zipship module
    By xtracool in forum Addon Shipping Modules
    Replies: 0
    Last Post: 9 May 2009, 04:04 AM
  5. ZipShip Questioni
    By lightlycooked in forum Addon Shipping Modules
    Replies: 0
    Last Post: 14 Oct 2007, 11:41 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