Results 1 to 2 of 2
  1. #1
    Join Date
    May 2008
    Location
    Near the water, somewhere...
    Posts
    126
    Plugin Contributions
    0

    Default Illegal string offset 'id' in moneyorder.php

    I'm on 1.5.1 running PHP 5.6 on a shared, GoDaddy cPanel and Linux server.

    An error in my log file reads:

    "[02-Aug-2017 22:53:24 UTC] PHP Warning: Illegal string offset 'id' in [path-to] moneyorder.php on line 40"

    Line 40 in moneyorder.php is this:

    $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_MONEYORDER_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
    There are two similar forum posts I found for this, calling out 'id' errors concerning orders.php. I was hoping to mimic their fixes.

    Their URLs are here:


    but their coding at the point of error is very different from what my line 40 in moneyorder.php line looks like, and I still have my Zencart training wheels on. They're changing the condition of their logical test as quoted below

    changing this:

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

    to this:

    if (STORE_PRODUCT_TAX_BASIS == 'Shipping' && isset($_SESSION['shipping']['id']) && stristr($_SESSION['shipping']['id'], 'storepickup') == TRUE)
    I attempted to construct the SQL it's constructing, but got lost at trying to figure out what

    MODULE_PAYMENT_MONEYORDER_ZONE

    was. I was hoping the

    ['country']['id']

    toward the end of the query would have revealed something to the SQL parser that might have given me a clue on how to massage the code into what's right, but my SQL training wheels are bigger than my Zencart, PHP training wheels.

    Incidental comment, the PHP tags in the post editor look really great when I'm reading the text version of a post I'm constructing, but when I preview the PHP code, the window that displays the PHP code is the tiniest, thinnest, single line, horizontal window that even cuts off the bottom half of the single line it's attempting to display and, IMHO needs to be at least four times taller. The reason I used QUOTE tags is so I could see all the code, because the PHP tags made the window tiny and forced me to scroll in a 0.5 x 80 character sliver of a window. The default PHP window display size needs attention.

    Let me rephrase that: it needs A LOT of attention.
    Last edited by d0ugparker; 3 Aug 2017 at 01:34 AM.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

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

    Quote Originally Posted by d0ugparker View Post
    I'm on 1.5.1 running PHP 5.6
    Zen Cart v1.5.1 was published before PHP 5.6 was even conceived.

    Quote Originally Posted by d0ugparker View Post
    Let me rephrase that: it needs A LOT of attention.
    You're right, if you're referring to your long-overdue-for-an-upgrade site.

    You need to upgrade to a modern version of Zen Cart if you want to use a modern version of PHP.

    The ['id'] warnings were (mostly) fixed in v1.5.4 and (fully) in v1.5.5

    Your Zen Cart version is from 2012 ... and numerous updates have been published since then. Time to upgrade. Then those errors/warnings will go away.
    .
    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.

 

 

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. Illegal string offset 'id' in order.php
    By marcopolo in forum General Questions
    Replies: 16
    Last Post: 25 Jul 2015, 04:31 PM
  3. Replies: 9
    Last Post: 23 Mar 2015, 08:42 AM
  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

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