Results 1 to 10 of 10
  1. #1
    Join Date
    Aug 2008
    Posts
    47
    Plugin Contributions
    0

    Default UPSXML error: Cannot use string offset as an array

    Hi all,

    I configured and installed the UPS XML mod for a client into ZenCart 1.3.8a.

    They do have a UPS account and so I got the credentials configured into the Admin area of UPS XML.

    Now, even though I have disabled UPS and enabled UPS XML, the shipping estimator doesn't load up on the shopping cart page. My estimator is configured as a list display rather than a popup.

    I did enable the logging facility in upsxml.php and the error I get is

    Code:
    [15-Sep-2008 02:26:05] PHP Fatal error:  Cannot use string offset as an array in <webserver path>/includes/modules/shipping/upsxml.php on line 262
    The line 262 is in bold in the following code from upsxml.php
    Code:
    if (isset($this->servicesTimeintransit[$type])) {
                        $eta_array = explode("-", $this->servicesTimeintransit[$type]["date"]);
                        $months = array (" ", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
                        $eta_arrival_date = $months[(int)$eta_array[1]]." ".$eta_array[2].", ".$eta_array[0];
                        $_type .= ", ETA: ".$eta_arrival_date;
                    }
    Can someone please guide me how to solve this problem because my client would like to enable shipping worldwide and hence can't use the ZC UPS.

    thanks
    callingrohit

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

    Default Re: UPSXML error: Cannot use string offset as an array

    Several discussions in the "Similar Threads" section at the bottom of this page may be of assistance.
    .

    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.

  3. #3
    Join Date
    Aug 2008
    Posts
    47
    Plugin Contributions
    0

    Default Re: UPSXML error: Cannot use string offset as an array

    Hi Dr. Byte,

    Thanks for your reply. Yes I have seen them but my issue is not due to SSL or undefined zones.

    Hence I posted it. The ZC UPS works fine....is there any major difference between UPS and UPS XML.

    I mean if not then I might as well drop UPS XML rather than knocking my head off to solve the error.

    Thanks

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

    Default Re: UPSXML error: Cannot use string offset as an array

    What are the addresses you're trying to ship to and from?
    Why did you choose to use the UPSXML mod in the first place? Its benefits are explained on its wiki page.
    .

    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.

  5. #5
    Join Date
    Aug 2008
    Posts
    47
    Plugin Contributions
    0

    Default Re: UPSXML error: Cannot use string offset as an array

    As far as addresses are concerned - they are just dummy addresses from US to Australia/US/UK. All 3 countries are defined in a single zone and then configured under UPS XML's shipping zone option.

    why did I choose UPS XML, that was because it supported the delivery area surcharge but now I'm thinking if this even that important and its effect. Maybe I should read more about it in detail from UPS website. I'm doing this basically for a client based in US.

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

    Default Re: UPSXML error: Cannot use string offset as an array

    I was referring to the UPSXML addon mod's wiki page (not the UPS website): http://www.zen-cart.com/wiki/index.p...ules_-_UPS_XML

    If you're using dummy addresses which aren't "real enough" to validate between zip and city and state, then you're going to get some odd results, regardless which module you're using.
    .

    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
    Aug 2008
    Posts
    47
    Plugin Contributions
    0

    Default Re: UPSXML error: Cannot use string offset as an array

    I read the benefits from the wiki page only but I said - to understand the advantage of UPSXML which is "delievery area surcharge" i should probably understand that term and its usuage in postal service from the UPS website.

    well the dummy addresses are real from the point of view of street address, city, state, postcode, country. I don't see a reason why UPSXML or inturn UPS itself should not be able to validate them.

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

    Default Re: UPSXML error: Cannot use string offset as an array

    Did you turn on the module's logging so that it can record the raw data coming back from UPS ... so you can figure out which result's data is not bringing back a valid date and thus causing your error?
    The Similar Threads below have at least one where I copy-and-pasted the instructions from the module's files to enable logging.
    .

    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.

  9. #9
    Join Date
    Aug 2008
    Posts
    47
    Plugin Contributions
    0

    Default Re: UPSXML error: Cannot use string offset as an array

    I have enabled it (upsxml.log) and the UPS response contained success as a response and listed out all the different postal services it can provide. But on the frontend, the shopping cart page just displayed my cart and checkout buttons but after that it was all blank and when i saw the logs (have enable_error_logging.php in my implementation to see the logs when a page loads blank or with errors) it had the error " [15-Sep-2008 02:26:05] PHP Fatal error: Cannot use string offset as an array in <webserver path>/includes/modules/shipping/upsxml.php on line 262 ".

    I seriously don't think that line262 is errorneous. The error is kinda misleading but i could be wrong.

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

    Default Re: UPSXML error: Cannot use string offset as an array

    That line is attempting to parse part of the results received back from UPS.
    Specifically, it's trying to extract date information, presumably related to delivery dates.
    And, it's most likely receiving data that's either not in date format (ie: an error/status message instead of a real date) or blank info. It might be date info in a date format it doesn't recognize, but that PHP error suggests more likely text instead of date or just blank.
    That's why I asked what the response details said.
    .

    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. Error in referrals.php - Cannot use object of type queryFactoryResult as array
    By Agouti in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 3 Jan 2009, 08:25 PM
  2. Cannot use string offset as an array - error in UPSXML module
    By tat2nu in forum Addon Shipping Modules
    Replies: 5
    Last Post: 14 Aug 2008, 08:35 PM
  3. Replies: 4
    Last Post: 21 Mar 2008, 06:41 PM
  4. 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

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