original_string: public function calculate(array $product, array $options = array())
      {
          $options += array(
              'status' => 1,
              'store_id' => $product['store_id']
          );
  
          $components = array();
          $total = $product['price'];
  
          foreach ($this->price_rule->getTriggered($product, $options) as $price_rule) {
              $this->price_rule->calculate($total, $product, $components, $price_rule);
          }
  
          return $total;
      }
code: public function calculate(array $product, array $options = array())
      {
          $options += array(
              'status' => 1,
              'store_id' => $product['store_id']
          );
  
          $components = array();
          $total = $product['price'];
  
          foreach ($this->price_rule->getTriggered($product, $options) as $price_rule) {
              $this->price_rule->calculate($total, $product, $components, $price_rule);
          }
  
          return $total;
      }
code_tokens: public function calculate ( array $ product , array $ options = array ( ) ) { $ options += array ( 'status' => 1 , 'store_id' => $ product [ 'store_id' ] ) ; $ components = array ( ) ; $ total = $ product [ 'price' ] ; foreach ( $ this -> price_rule -> getTriggered ( $ product , $ options ) as $ price_rule ) { $ this -> price_rule -> calculate ( $ total , $ product , $ components , $ price_rule ) ; } return $ total ; }
docstring: Calculates the product price
  @param array $product
  @param array $options
  @return int
docstring_tokens: Calculates the product price