Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,400
    Plugin Contributions
    1

    bug Upgrade to v157c Keep Cart does not appear to be working anyone else notice this?

    v157c
    backup_mysql_plugin_v1.5g
    EasyPopulated4
    Google reCaptcha v3.4
    keep_cart_1.0
    numinix_google_analytics_bada883
    one_page_checkout-2.3.7
    remember-me-2.0.1
    sitemapxml
    usu-3.0.8
    zen_image_handler-5.1.10

    I have upgraded and had keepcart in the database already. I put items in my cart come back after 12 hours .... they are gone! Has anyone else who has upgraded to 1.5.7c noticed this?

  2. #2
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,400
    Plugin Contributions
    1

    Default Re: Upgrade to v157c Keep Cart does not appear to be working anyone else notice this?

    Okay..... Looking at the code I now remember that I was getting a PHP error every time the website was being hit and was drowning in log error messages. The message said something about a future error of a same named class calling a same name function. So I renamed function save_cart() to save_cart_now() in class.savecart.php and then in the config.savecart.php :

    $autoLoadConfig[90][] = array('autoType'=>'classInstantiate','className'=>'save_cart','objectName'=>'sav e_cart');

    Changed to:

    $autoLoadConfig[90][] = array('autoType'=>'classInstantiate','className'=>'save_cart','objectName'=>'sav e_cart_now');

    And the error messages stopped. Is there something else that I am missing to change the function name from the class name successfully? Thank you!

  3. #3
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,541
    Plugin Contributions
    19

    Default Re: Upgrade to v157c Keep Cart does not appear to be working anyone else notice this?

    Quote Originally Posted by shrimp-gumbo-mmmhhh View Post
    Okay..... Looking at the code I now remember that I was getting a PHP error every time the website was being hit and was drowning in log error messages. The message said something about a future error of a same named class calling a same name function. So I renamed function save_cart() to save_cart_now() in class.savecart.php and then in the config.savecart.php :

    $autoLoadConfig[90][] = array('autoType'=>'classInstantiate','className'=>'save_cart','objectName'=>'sav e_cart');

    Changed to:

    $autoLoadConfig[90][] = array('autoType'=>'classInstantiate','className'=>'save_cart','objectName'=>'sav e_cart_now');

    And the error messages stopped. Is there something else that I am missing to change the function name from the class name successfully? Thank you!
    I'm not at all familiar with the plugin you've mentioned here, but will just comment on the bold part...

    This indicates a (very) old style code in the class file (in your case, class.savecart.php) which looks something like:
    Code:
    class saveCart {
        function saveCart() {
    
        }
    }
    and should be changed to
    Code:
    class saveCart {
        function __construct() {
    
        }
    }
    Changing what you've changed in the auto_loader will definitely stop the plugin from working.

  4. #4
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,669
    Plugin Contributions
    9

    Default Re: Upgrade to v157c Keep Cart does not appear to be working anyone else notice this?

    Quote Originally Posted by balihr View Post
    I'm not at all familiar with the plugin you've mentioned here, but will just comment on the bold part...

    This indicates a (very) old style code in the class file (in your case, class.savecart.php) which looks something like:
    Code:
    class saveCart {
        function saveCart() {
    
        }
    }
    and should be changed to
    Code:
    class saveCart {
        function __construct() {
    
        }
    }
    Changing what you've changed in the auto_loader will definitely stop the plugin from working.
    it looks like from here:

    https://www.zen-cart.com/downloads.php?do=file&id=992

    and the aforementioned changes by @balihr look correct and sound to me.

    best.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  5. #5
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,400
    Plugin Contributions
    1

    Default Re: Upgrade to v157c Keep Cart does not appear to be working anyone else notice this?

    Thanks much all!

  6. #6
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,400
    Plugin Contributions
    1

    Default Re: Upgrade to v157c Keep Cart does not appear to be working anyone else notice this?

    It looks like somehow I wasn't using the latest and greatest Keep Cart..... the new version also goes to a keep_cart_1.0 directory though... thank you all for the help!

  7. #7
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,400
    Plugin Contributions
    1

    Default Re: Upgrade to v157c Keep Cart does not appear to be working anyone else notice this?

    Anybody have ideas of what to replace the "each" with?

    --> PHP Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/account/public_html/includes/classes/observers/class.savecart.php on line 46.


    reset($_SESSION['cart']->contents);
    while (list($products_id,) = each($_SESSION['cart']->contents))
    {
    $prid = zen_get_prid($products_id);
    $stock_query = "select products_quantity, products_status
    from " . TABLE_PRODUCTS . "
    where products_id = '" . (int)$prid . "'";


    $stock_info = $db->Execute($stock_query);
    if ($stock_info->EOF)
    unset($_SESSION['cart']->contents[$products_id]);
    else
    {
    $stock_qty = $stock_info->fields['products_quantity'];
    $stock_status = $stock_info->fields['products_status'];
    if (($stock_qty < 1) || ($stock_status == 0))
    unset($_SESSION['cart']->contents[$products_id]);
    else
    {
    if ($stock_qty < $_SESSION['cart']->contents[$products_id]['qty'])
    $_SESSION['cart']->contents[$products_id] = array('qty' => (float)$stock_qty);
    }
    }
    }

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

    Default Re: Upgrade to v157c Keep Cart does not appear to be working anyone else notice this?

    .

    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
    Nov 2005
    Location
    los angeles
    Posts
    2,669
    Plugin Contributions
    9

    Default Re: Upgrade to v157c Keep Cart does not appear to be working anyone else notice this?

    it looks like this would work:

    PHP Code:
    //from:
    while (list($products_id,) = each($_SESSION['cart']->contents))

    //to:
    foreach ($_SESSION['cart']->contents as $products_id => $details
    best.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  10. #10
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,400
    Plugin Contributions
    1

    Default Re: Upgrade to v157c Keep Cart does not appear to be working anyone else notice this?

    Thank you all.... so far so good. Carl it looks like your fix was what was needed. Thank you!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Does anyone else have a site integrated with Linnworks??
    By legraphics in forum General Questions
    Replies: 2
    Last Post: 7 Feb 2016, 04:31 PM
  2. Shipping Module Is Working, but Does not Appear in Backend
    By todoonada in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 4 Jun 2014, 10:52 AM
  3. v151 Does anyone else have this issue with search result long delays?
    By jeffmic in forum General Questions
    Replies: 29
    Last Post: 8 Aug 2013, 10:18 PM
  4. Does this happen to anyone else?
    By sfklaas in forum General Questions
    Replies: 3
    Last Post: 4 Apr 2008, 04:24 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