original_string: protected function validateCouponCheckout()
      {
          $price_rule_id = $this->getPosted('check_pricerule', null, true, 'integer');
  
          if (empty($price_rule_id)) {
              return null;
          }
  
          $code = $this->getSubmitted('data.pricerule_code', '');
  
          if ($code === '') {
              return null;
          }
  
          if (!$this->order->priceRuleCodeMatches($price_rule_id, $code)) {
              $this->setError('pricerule_code', $this->text('Invalid code'));
              $this->setMessageFormCheckout('components.danger', $this->text('Invalid code'));
          }
      }
code: protected function validateCouponCheckout()
      {
          $price_rule_id = $this->getPosted('check_pricerule', null, true, 'integer');
  
          if (empty($price_rule_id)) {
              return null;
          }
  
          $code = $this->getSubmitted('data.pricerule_code', '');
  
          if ($code === '') {
              return null;
          }
  
          if (!$this->order->priceRuleCodeMatches($price_rule_id, $code)) {
              $this->setError('pricerule_code', $this->text('Invalid code'));
              $this->setMessageFormCheckout('components.danger', $this->text('Invalid code'));
          }
      }
code_tokens: protected function validateCouponCheckout ( ) { $ price_rule_id = $ this -> getPosted ( 'check_pricerule' , null , true , 'integer' ) ; if ( empty ( $ price_rule_id ) ) { return null ; } $ code = $ this -> getSubmitted ( 'data.pricerule_code' , '' ) ; if ( $ code === '' ) { return null ; } if ( ! $ this -> order -> priceRuleCodeMatches ( $ price_rule_id , $ code ) ) { $ this -> setError ( 'pricerule_code' , $ this -> text ( 'Invalid code' ) ) ; $ this -> setMessageFormCheckout ( 'components.danger' , $ this -> text ( 'Invalid code' ) ) ; } }
docstring: Validates a coupon code
docstring_tokens: Validates a coupon code