Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2005
    Vic, Oz
    Plugin Contributions

    Default [Done v1.5.2] PHP 5.4.12, PHP Warning: Illegal string offset 'cost'

    Using PHP 5.4.12 and zen v151
    During checkout: Step 1 of 3 - Delivery Information
    Click: Change the Address
    Change the Shipping Address: add a new address or choose another.
    Click: Continue, goes back to Step 1 of 3 - Delivery Information

    At this point I get the error:
    PHP Warning: Illegal string offset 'cost' in /home/XXXXXXX/public_html/includes/classes/order.php on line 355

    Quick temporary fix. Find line 355
    PHP Code:
      'shipping_cost' => $_SESSION['shipping']['cost'], 
    Change to
    PHP Code:
     'shipping_cost' => (isset($_SESSION['shipping']['cost']) ? $_SESSION['shipping']['cost'] : 0), 

  2. #2
    Join Date
    Jan 2004
    Blog Entries
    Plugin Contributions

    Default Re: PHP 5.4.12, PHP Warning: Illegal string offset 'cost'

    This is a complicated issue to fix "completely", as these array elements are used in multiple ways, both as strings and as arrays. IIRC this lovely code was inherited from osC.

    Discussed more in a previous thread:

    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. Replies: 18
    Last Post: 11 Mar 2013, 04:11 PM
  3. Replies: 41
    Last Post: 19 Sep 2012, 04:04 AM
  4. Replies: 1
    Last Post: 18 Jan 2012, 11:50 AM
  5. Fatal error: Cannot use string offset as an array in upsxml.php
    By yaby in forum Addon Shipping Modules
    Replies: 4
    Last Post: 19 Oct 2007, 06:40 PM


Posting Permissions

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