Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    May 2008
    Posts
    442
    Plugin Contributions
    1

    bug Illegal string offset 'id' in order.php

    I'm getting the following error message:
    Illegal string offset 'id' in order.php

    Here is the line it does not like:

    PHP Code:
          if (STORE_PRODUCT_TAX_BASIS == 'Shipping' && stristr($_SESSION['shipping']['id'], 'storepickup') == TRUE
    Server details:
    Zencart 1.5.4
    MySQL 5.6.24
    5.6.8-1

    Is this a bug?

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

    Default Re: Illegal string offset 'id' in order.php

    A post that contains the full debug log (especially if augmented by the myDEBUG Backtrace plugin) would help. Starting in v1.5.3, the $_SESSION['shipping'] variable went through an overhaul to remove PHP warnings like you posted.

    A list of your installed plugins would also be helpful.

  3. #3
    Join Date
    May 2008
    Posts
    442
    Plugin Contributions
    1

    Default Re: Illegal string offset 'id' in order.php

    Here is the full debug text:
    [13-Jul-2015 10:08:27 America/New_York] PHP Warning: Illegal string offset 'id' in /var/www/zencart/includes/classes/order.php on line 472

  4. #4
    Join Date
    May 2008
    Posts
    442
    Plugin Contributions
    1

    Default Re: Illegal string offset 'id' in order.php

    Without having to list every mod is there anything I can try to fix this?

  5. #5
    Join Date
    Jan 2013
    Posts
    811
    Plugin Contributions
    0

    Default Re: Illegal string offset 'id' in order.php

    ive been getting these errors on and off for a couple of years now, since installing v1.51. i dont see any real problems, i'm still making sales

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

    Default Re: Illegal string offset 'id' in order.php

    Quote Originally Posted by marcopolo View Post
    I'm getting the following error message:
    Illegal string offset 'id' in order.php

    Here is the line it does not like:

    PHP Code:
          if (STORE_PRODUCT_TAX_BASIS == 'Shipping' && stristr($_SESSION['shipping']['id'], 'storepickup') == TRUE
    Server details:
    Zencart 1.5.4
    MySQL 5.6.24
    5.6.8-1

    Is this a bug?
    Quote Originally Posted by marcopolo View Post
    Here is the full debug text:
    [13-Jul-2015 10:08:27 America/New_York] PHP Warning: Illegal string offset 'id' in /var/www/zencart/includes/classes/order.php on line 472
    The code you quoted is not from line 472 of ZC v1.5.4. So it appears you're using an old version of that file, or one modified by a plugin but which isn't compatible with v1.5.4
    .

    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.

  7. #7
    Join Date
    May 2008
    Posts
    442
    Plugin Contributions
    1

    Default Re: Illegal string offset 'id' in order.php

    The edits are minimum and more below that line, can I send you the file to look at?

  8. #8
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,684
    Plugin Contributions
    123

    Default Re: Illegal string offset 'id' in order.php

    I believe this is still an issue. Seeing in an unmodified 1.5.4 includes/classes/order.php on line 462 with PHP 5.6.2. I can try with other PHPs if needed.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  9. #9
    Join Date
    May 2008
    Posts
    442
    Plugin Contributions
    1

    Default Re: Illegal string offset 'id' in order.php

    I was able to resolve the issue by changing:

    PHP Code:
    if (STORE_PRODUCT_TAX_BASIS == 'Shipping' && stristr($_SESSION['shipping']['id'], 'storepickup') == TRUE
    to

    PHP Code:
     if (STORE_PRODUCT_TAX_BASIS == 'Shipping' && isset($_SESSION['shipping']['id']) && stristr($_SESSION['shipping']['id'], 'storepickup') == TRUE

  10. #10
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Illegal string offset 'id' in order.php

    Quote Originally Posted by marcopolo View Post
    I was able to resolve the issue by changing:

    PHP Code:
    if (STORE_PRODUCT_TAX_BASIS == 'Shipping' && stristr($_SESSION['shipping']['id'], 'storepickup') == TRUE
    to

    PHP Code:
     if (STORE_PRODUCT_TAX_BASIS == 'Shipping' && isset($_SESSION['shipping']['id']) && stristr($_SESSION['shipping']['id'], 'storepickup') == TRUE
    Perhaps I need to do more research, but it seems to me that this simply fixes the result of a previous problem not the problem that is causing this fix to be needed... I say this partially because I once had to apply a similar fix for a shipping module, but found out it was the shipping module that was not "generated" properly that made this issue appear...

    Earlier in this thread it was asked if all modules were needed... If anything I would think those that have an effect on shipping propably would be prudent. :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 [Done v1.5.5] PHP 5.4 warnings: Illegal string offset
    By lat9 in forum Bug Reports
    Replies: 38
    Last Post: 28 Dec 2015, 11:13 PM
  2. Replies: 9
    Last Post: 23 Mar 2015, 08:42 AM
  3. v151 PHP Warning: Illegal string offset 'r_error' in linkpoint_api.php
    By BGundlach in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 15 Sep 2014, 09:16 PM
  4. v153 Illegal string offset 'id' in order.php
    By jeking in forum General Questions
    Replies: 0
    Last Post: 5 Sep 2014, 07:32 PM
  5. v151 PHP Warning: Illegal string offset 'id'
    By Nettric in forum Bug Reports
    Replies: 3
    Last Post: 30 May 2014, 06:53 AM

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