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

    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
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    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: http://www.zen-cart.com/showthread.p...-string-offset
    .

    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. 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
  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