Results 1 to 10 of 12

Hybrid View

  1. #1
    Join Date
    May 2007
    Posts
    79
    Plugin Contributions
    0

    Default shopping_cart.php error when changing quantity

    I searched and didn't find anything about this problem. I'm getting this error when quantity is changed in the shopping cart:

    Warning: Illegal offset type in (path)/includes/classes/shopping_cart.php on line 495

    Warning: Cannot modify header information - headers already sent by (output started at (path)/includes/classes/shopping_cart.php:495) in (path)/includes/functions/functions_general.php on line 44
    I haven't made any modifications to either of these files, and I reuploaded them thinking they may have been corrupted.

    Where else could this error be coming from? I don't have a clue where to look.

    Line 495 in shopping_cart.php is the 3rd line in this block of code:

    Code:
      function get_quantity($products_id) {
        $this->notify('NOTIFIER_CART_GET_QUANTITY_START');
        if (isset($this->contents[$products_id])) {
        $this->notify('NOTIFIER_CART_GET_QUANTITY_END_QTY');
          return $this->contents[$products_id]['qty'];
        } else {
        $this->notify('NOTIFIER_CART_GET_QUANTITY_END_FALSE');
          return 0;
        }
      }
    and line 44 of functions_general.php is:

    Code:
        header('Location: ' . $url);
    HELP!?
    Last edited by lismith; 25 Jul 2007 at 01:54 PM.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: shopping_cart.php error when changing quantity

    What customizations have you made to your site?
    What addons/contributions have you installed?
    What version of Zen Cart are you using? What patches have you applied? Was this an upgrade from a prior version? Which version?
    Can you share a URL where this can be seen in action?
    When did it start happening?
    Does it happen with all products, or just certain ones?
    .

    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
    May 2007
    Posts
    79
    Plugin Contributions
    0

    Default Re: shopping_cart.php error when changing quantity

    It's version 1.3.7, full install not upgraded from any previous version. I installed the "Additional Product Fields" mod by TheOracle. It never worked correctly -- in fact, it was a problem with shopping_cart.php -- so I've removed all files added by the mod and restored the other files that had been modified. I actually didn't notice the problem until today so it may have been there before I uninstalled the mod. I've went thru the install for that mod twice, trying to find if I've missed something. I probably have, but don't have any idea where to start looking. I've made a lot of changes to the template but I don't think any of them would cause this problem.

    The site is www.bamagolfcart.com

  4. #4
    Join Date
    May 2007
    Posts
    79
    Plugin Contributions
    0

    Default Re: shopping_cart.php error when changing quantity

    I also added a new field using the instructions posted by crazy_chris at http://www.zen-cart.com/forum/showthread.php?t=57924, but it's not being used in the shopping cart so I didn't think it would cause a problem.
    Last edited by lismith; 25 Jul 2007 at 05:38 PM. Reason: adding link

  5. #5
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: shopping_cart.php error when changing quantity

    As a start, i suggest that you backup your existing files:
    /includes/classes/shopping_cart.php
    /includes/main_cart_actions.php

    and replace those from a fresh v1.3.7 zip.

    It's always a good idea to do a complete file+database backup periodically while making customizations.
    .

    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.

  6. #6
    Join Date
    May 2007
    Posts
    79
    Plugin Contributions
    0

    Default Re: shopping_cart.php error when changing quantity

    Thanks for the advice Dr. Byte. I restored the original files you mentioned and still have the error. Is there anything in the mysql database that would cause this problem? I'd thought it probably had to do with the additional product fields mod or adding the new field with crazy_chris' instructions but I've went through everything and haven't seen any problem (although it's entirely possible I've missed something.) Just wondering if there might be other possible reasons for it.

 

 

Similar Threads

  1. Replies: 1
    Last Post: 3 Nov 2013, 05:15 AM
  2. v151 override \includes\modules\pages\shopping_cart\header.php.php??
    By tlyczko in forum General Questions
    Replies: 7
    Last Post: 27 Nov 2012, 06:12 PM
  3. Replies: 7
    Last Post: 7 Mar 2011, 09:55 AM
  4. Replies: 1
    Last Post: 22 May 2010, 10:06 AM
  5. Error with shopping_cart.php when adding items.
    By mohinder in forum General Questions
    Replies: 3
    Last Post: 25 Jul 2008, 09:22 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
  •  
disjunctive-egg