CI_Cart::destroy PHP Method

destroy() public method

Empties the cart and kills the session
public destroy ( ) : void
return void
    public function destroy()
    {
        $this->_cart_contents = array('cart_total' => 0, 'total_items' => 0);
        $this->CI->session->unset_userdata('cart_contents');
    }

Usage Example

コード例 #1
0
ファイル: fs_cart.php プロジェクト: rosellkarlrossj/FireSALE
 public function destroy()
 {
     // Run the standard CI_Cart function
     parent::destroy();
     // Fire an event to tell external modules that the cart has been destroyed
     Events::trigger('cart_destroyed');
 }