original_string: protected function validateSkuCart()
      {
          if ($this->isError('store_id')) {
              return null;
          }
  
          $field = 'sku';
          $value = $this->getSubmitted($field);
  
          if (!isset($value)) {
              return null;
          }
  
          $label = $this->translation->text('SKU');
  
          if (empty($value)) {
              $this->setErrorRequired($field, $label);
              return false;
          }
  
          $store_id = $this->getSubmitted('store_id');
          $product = $this->product->getBySku($value, $store_id);
  
          if (empty($product['product_id'])) {
              $this->setErrorUnavailable($field, $label);
              return false;
          }
  
          $this->setSubmitted('product', $product);
          return true;
      }
code: protected function validateSkuCart()
      {
          if ($this->isError('store_id')) {
              return null;
          }
  
          $field = 'sku';
          $value = $this->getSubmitted($field);
  
          if (!isset($value)) {
              return null;
          }
  
          $label = $this->translation->text('SKU');
  
          if (empty($value)) {
              $this->setErrorRequired($field, $label);
              return false;
          }
  
          $store_id = $this->getSubmitted('store_id');
          $product = $this->product->getBySku($value, $store_id);
  
          if (empty($product['product_id'])) {
              $this->setErrorUnavailable($field, $label);
              return false;
          }
  
          $this->setSubmitted('product', $product);
          return true;
      }
code_tokens: protected function validateSkuCart ( ) { if ( $ this -> isError ( 'store_id' ) ) { return null ; } $ field = 'sku' ; $ value = $ this -> getSubmitted ( $ field ) ; if ( ! isset ( $ value ) ) { return null ; } $ label = $ this -> translation -> text ( 'SKU' ) ; if ( empty ( $ value ) ) { $ this -> setErrorRequired ( $ field , $ label ) ; return false ; } $ store_id = $ this -> getSubmitted ( 'store_id' ) ; $ product = $ this -> product -> getBySku ( $ value , $ store_id ) ; if ( empty ( $ product [ 'product_id' ] ) ) { $ this -> setErrorUnavailable ( $ field , $ label ) ; return false ; } $ this -> setSubmitted ( 'product' , $ product ) ; return true ; }
docstring: Validates a cart item SKU
  @return boolean|null
docstring_tokens: Validates a cart item SKU