public function addToWishlist($wishlist_action_model)
    {
        $errors = $this->error();

        if (empty($errors)) {
            $result = $wishlist_action_model->add($this->getSubmitted());
        } else {
            $result = array(
                'redirect' => '',
                'severity' => 'warning',
                'message' => $this->format($errors)
            );
        }

        if ($this->isAjax()) {
            $this->outputJson($result);
        }

        $this->redirect($result['redirect'], $result['message'], $result['severity']);
    }
public function addToWishlist($wishlist_action_model)
    {
        $errors = $this->error();

        if (empty($errors)) {
            $result = $wishlist_action_model->add($this->getSubmitted());
        } else {
            $result = array(
                'redirect' => '',
                'severity' => 'warning',
                'message' => $this->format($errors)
            );
        }

        if ($this->isAjax()) {
            $this->outputJson($result);
        }

        $this->redirect($result['redirect'], $result['message'], $result['severity']);
    }
public function addToWishlist ( $ wishlist_action_model ) { $ errors = $ this -> error ( ) ; if ( empty ( $ errors ) ) { $ result = $ wishlist_action_model -> add ( $ this -> getSubmitted ( ) ) ; } else { $ result = array ( 'redirect' => '' , 'severity' => 'warning' , 'message' => $ this -> format ( $ errors ) ) ; } if ( $ this -> isAjax ( ) ) { $ this -> outputJson ( $ result ) ; } $ this -> redirect ( $ result [ 'redirect' ] , $ result [ 'message' ] , $ result [ 'severity' ] ) ; }
Add a product to the wishlist
@param \gplcart\core\models\WishlistAction $wishlist_action_model
Add a product to the wishlist