public function submitCart($cart_action_model)
    {
        $this->setSubmitted('product');
        $this->filterSubmitted(array('product_id'));

        if ($this->isPosted('add_to_cart')) {
            $this->validateAddToCart();
            $this->addToCart($cart_action_model);
        } else if ($this->isPosted('remove_from_cart')) {
            $this->setSubmitted('cart');
            $this->deleteFromCart($cart_action_model);
        }
    }
public function submitCart($cart_action_model)
    {
        $this->setSubmitted('product');
        $this->filterSubmitted(array('product_id'));

        if ($this->isPosted('add_to_cart')) {
            $this->validateAddToCart();
            $this->addToCart($cart_action_model);
        } else if ($this->isPosted('remove_from_cart')) {
            $this->setSubmitted('cart');
            $this->deleteFromCart($cart_action_model);
        }
    }
public function submitCart ( $ cart_action_model ) { $ this -> setSubmitted ( 'product' ) ; $ this -> filterSubmitted ( array ( 'product_id' ) ) ; if ( $ this -> isPosted ( 'add_to_cart' ) ) { $ this -> validateAddToCart ( ) ; $ this -> addToCart ( $ cart_action_model ) ; } else if ( $ this -> isPosted ( 'remove_from_cart' ) ) { $ this -> setSubmitted ( 'cart' ) ; $ this -> deleteFromCart ( $ cart_action_model ) ; } }
Handles product cart submissions
@param \gplcart\core\models\CartAction $cart_action_model
Handles product cart submissions