ShoppingCart::setCurrent PHP Method

setCurrent() public method

Set the current cart
public setCurrent ( Order $cart ) : ShoppingCart
$cart Order
return ShoppingCart
    public function setCurrent(Order $cart)
    {
        if (!$cart->IsCart()) {
            trigger_error("Passed Order object is not cart status", E_ERROR);
        }
        $this->order = $cart;
        Session::set(self::config()->cartid_session_name, $cart->ID);
        return $this;
    }