original_string: 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);
          }
      }
code: 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);
          }
      }
code_tokens: 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 ) ; } }
docstring: Handles product cart submissions
  @param \gplcart\core\models\CartAction $cart_action_model
docstring_tokens: Handles product cart submissions