original_string: protected function setFormDataBeforeCheckout()
      {
          $this->data_form = array();
  
          $default_order = $this->getDefaultOrder();
          $order = gplcart_array_merge($default_order, $this->data_order);
  
          $payment_methods = $this->getPaymentMethodsCheckout();
          $shipping_methods = $this->getShippingMethodsCheckout();
  
          if (count($payment_methods) == 1) {
              reset($payment_methods);
              $order['payment'] = key($payment_methods);
          }
  
          if (count($shipping_methods)) {
              reset($shipping_methods);
              $order['shipping'] = key($shipping_methods);
          }
  
          $this->data_form['order'] = $order;
          $this->data_form['messages'] = array();
          $this->data_form['admin'] = $this->admin;
          $this->data_form['user'] = $this->data_user;
  
          $this->data_form['statuses'] = $this->order->getStatuses();
          $this->data_form['payment_methods'] = $payment_methods;
          $this->data_form['shipping_methods'] = $shipping_methods;
  
          $this->data_form['has_dynamic_payment_methods'] = $this->hasDynamicMethods($payment_methods);
          $this->data_form['has_dynamic_shipping_methods'] = $this->hasDynamicMethods($shipping_methods);
  
          // Price rule calculator requires this data
          $this->data_form['store_id'] = $this->order_store_id;
          $this->data_form['currency'] = $this->data_cart['currency'];
  
          $this->setFormDataDimensionsCheckout();
      }
code: protected function setFormDataBeforeCheckout()
      {
          $this->data_form = array();
  
          $default_order = $this->getDefaultOrder();
          $order = gplcart_array_merge($default_order, $this->data_order);
  
          $payment_methods = $this->getPaymentMethodsCheckout();
          $shipping_methods = $this->getShippingMethodsCheckout();
  
          if (count($payment_methods) == 1) {
              reset($payment_methods);
              $order['payment'] = key($payment_methods);
          }
  
          if (count($shipping_methods)) {
              reset($shipping_methods);
              $order['shipping'] = key($shipping_methods);
          }
  
          $this->data_form['order'] = $order;
          $this->data_form['messages'] = array();
          $this->data_form['admin'] = $this->admin;
          $this->data_form['user'] = $this->data_user;
  
          $this->data_form['statuses'] = $this->order->getStatuses();
          $this->data_form['payment_methods'] = $payment_methods;
          $this->data_form['shipping_methods'] = $shipping_methods;
  
          $this->data_form['has_dynamic_payment_methods'] = $this->hasDynamicMethods($payment_methods);
          $this->data_form['has_dynamic_shipping_methods'] = $this->hasDynamicMethods($shipping_methods);
  
          // Price rule calculator requires this data
          $this->data_form['store_id'] = $this->order_store_id;
          $this->data_form['currency'] = $this->data_cart['currency'];
  
          $this->setFormDataDimensionsCheckout();
      }
code_tokens: protected function setFormDataBeforeCheckout ( ) { $ this -> data_form = array ( ) ; $ default_order = $ this -> getDefaultOrder ( ) ; $ order = gplcart_array_merge ( $ default_order , $ this -> data_order ) ; $ payment_methods = $ this -> getPaymentMethodsCheckout ( ) ; $ shipping_methods = $ this -> getShippingMethodsCheckout ( ) ; if ( count ( $ payment_methods ) == 1 ) { reset ( $ payment_methods ) ; $ order [ 'payment' ] = key ( $ payment_methods ) ; } if ( count ( $ shipping_methods ) ) { reset ( $ shipping_methods ) ; $ order [ 'shipping' ] = key ( $ shipping_methods ) ; } $ this -> data_form [ 'order' ] = $ order ; $ this -> data_form [ 'messages' ] = array ( ) ; $ this -> data_form [ 'admin' ] = $ this -> admin ; $ this -> data_form [ 'user' ] = $ this -> data_user ; $ this -> data_form [ 'statuses' ] = $ this -> order -> getStatuses ( ) ; $ this -> data_form [ 'payment_methods' ] = $ payment_methods ; $ this -> data_form [ 'shipping_methods' ] = $ shipping_methods ; $ this -> data_form [ 'has_dynamic_payment_methods' ] = $ this -> hasDynamicMethods ( $ payment_methods ) ; $ this -> data_form [ 'has_dynamic_shipping_methods' ] = $ this -> hasDynamicMethods ( $ shipping_methods ) ; // Price rule calculator requires this data $ this -> data_form [ 'store_id' ] = $ this -> order_store_id ; $ this -> data_form [ 'currency' ] = $ this -> data_cart [ 'currency' ] ; $ this -> setFormDataDimensionsCheckout ( ) ; }
docstring: Sets initial form data
docstring_tokens: Sets initial form data