original_string: public function deleteFromCart($cart_action_model)
      {
          $result = $cart_action_model->delete($this->getSubmitted('cart_id'));
  
          if (empty($result['quantity'])) {
              $result['message'] = '';
          }
  
          if ($this->isAjax()) {
              $result['modal'] = $this->getCartPreview();
              $this->outputJson($result);
          }
  
          $this->redirect($result['redirect'], $result['message'], $result['severity']);
      }
code: public function deleteFromCart($cart_action_model)
      {
          $result = $cart_action_model->delete($this->getSubmitted('cart_id'));
  
          if (empty($result['quantity'])) {
              $result['message'] = '';
          }
  
          if ($this->isAjax()) {
              $result['modal'] = $this->getCartPreview();
              $this->outputJson($result);
          }
  
          $this->redirect($result['redirect'], $result['message'], $result['severity']);
      }
code_tokens: public function deleteFromCart ( $ cart_action_model ) { $ result = $ cart_action_model -> delete ( $ this -> getSubmitted ( 'cart_id' ) ) ; if ( empty ( $ result [ 'quantity' ] ) ) { $ result [ 'message' ] = '' ; } if ( $ this -> isAjax ( ) ) { $ result [ 'modal' ] = $ this -> getCartPreview ( ) ; $ this -> outputJson ( $ result ) ; } $ this -> redirect ( $ result [ 'redirect' ] , $ result [ 'message' ] , $ result [ 'severity' ] ) ; }
docstring: Deletes a submitted cart item
  @param \gplcart\core\models\CartAction $cart_action_model
docstring_tokens: Deletes a submitted cart item