Jump to content

HTTP 500 Errors and Redirection


svrabel

Recommended Posts

I recently updated to add an SSL certificate to my site. Some of the issues that I had before with customer redirection went away, but I started receiving reports of HTTP 500 errors and a few different redirection messages. Looking at the error log, I have the following error: PHP Fatal error:  Call to a member function get() on a non-object in /home/public_html/store/classes/cart.class.php on line 1015

 
One person reported receiving this message: the web address you entered could not be found. You were trying to go to https://www.savvystitchesapplique.stire/index.php?_a=gateway
 
My standard and SSL store URLs are correct. I'm at a loss at what I need to look at.
Link to comment
Share on other sites

The link you posted:

https://www.savvystitchesapplique.stire/index.php?_a=gateway

is malformed. Perhaps the link should be:

https://www.savvystitchesapplique.com/store/index.php?_a=gateway

In the file /classes/cart.class.php, near lines 1005-1026, make sure everything uses the getInstance() form:

    /**
     * Save basket
     */
    public function save() {
        Session::getInstance()->set('', $this->basket, 'basket', true);
        //Only care about auto saving the cart if there is something in there
        if (!empty($this->basket) && isset($this->basket['contents'])) {
            if (User::getInstance()->is() && Config::getInstance()->get('config', 'auto_save_cart')) {
                static $old_basket = null;
                $id = User::getInstance()->getId();
                $basket = serialize($this->basket['contents']);
                if (empty($old_basket) || $old_basket != $basket) {
                    $old_basket = $basket;
                    if ((Database::getInstance()->count('CubeCart_saved_cart', 'customer_id', array('customer_id' => $id))) !== false) {
                        Database::getInstance()->update('CubeCart_saved_cart', array('basket' => $basket), array('customer_id' => $id));
                    } else {
                        Database::getInstance()->insert('CubeCart_saved_cart', array('customer_id' => $id, 'basket' => $basket));
                    }
                }
            }
        }
    }

This particular function is called during PHP's shutdown routines (after the web page has been given to the web server for delivery), and there is no way to predict what classes may still be instantiated. So, getInstance() gets a new instantiation if there isn't one already.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...