public function delete()
    {
        $cookies = $this->cookiesSupported();
        $cart = $this->getCurrent();

        // Only delete the cart if it has been written to the DB
        if ($cart->exists()) {
            $cart->delete();
        }

        if ($cookies) {
            Cookie::force_expiry(self::COOKIE_NAME);
        } else {
            $this->getSession()->clear(self::COOKIE_NAME);
        }

        return $this;
    }
public function delete()
    {
        $cookies = $this->cookiesSupported();
        $cart = $this->getCurrent();

        // Only delete the cart if it has been written to the DB
        if ($cart->exists()) {
            $cart->delete();
        }

        if ($cookies) {
            Cookie::force_expiry(self::COOKIE_NAME);
        } else {
            $this->getSession()->clear(self::COOKIE_NAME);
        }

        return $this;
    }
public function delete ( ) { $ cookies = $ this -> cookiesSupported ( ) ; $ cart = $ this -> getCurrent ( ) ; // Only delete the cart if it has been written to the DB if ( $ cart -> exists ( ) ) { $ cart -> delete ( ) ; } if ( $ cookies ) { Cookie :: force_expiry ( self :: COOKIE_NAME ) ; } else { $ this -> getSession ( ) -> clear ( self :: COOKIE_NAME ) ; } return $ this ; }
Destroy current shopping cart

@return self
Destroy current shopping cart