public static function osiState2PsStateId($logisticState, $paymentState, $state)
 {
     $logisticState = strtoupper($logisticState);
     $paymentState = strtoupper($paymentState);
     $state = strtoupper($state);
     if ($state == 'A') {
         return GlobalConfig::getStateIdCanceled();
     } else {
         if ($state == 'T' && $logisticState == 'E') {
             return GlobalConfig::getStateIdOnDelivery();
         } else {
             if ($state == 'T' && $logisticState == 'T') {
                 return GlobalConfig::getStateIdOnPreparation();
             } else {
                 if ($state == 'C' && $logisticState == 'E') {
                     return GlobalConfig::getStateIdOnDelivery();
                 }
             }
         }
     }
 }
Esempio n. 2
0
 public function utilHtmlOrderState($stateName)
 {
     if ($stateName == 'on_preparation') {
         $stateValue = GlobalConfig::getStateIdOnPreparation();
     } else {
         if ($stateName == 'on_delivery') {
             $stateValue = GlobalConfig::getStateIdOnDelivery();
         } else {
             if ($stateName == 'canceled') {
                 $stateValue = GlobalConfig::getStateIdCanceled();
             }
         }
     }
     $selectOptions = '';
     foreach ($this->listOrderStates as $state) {
         $isSelected = $state['id_order_state'] != "" && $state['id_order_state'] == $stateValue ? "selected" : "";
         $selectOptions .= "<option value='" . $state['id_order_state'] . "' " . $isSelected . ">" . $state['name'] . "</option>";
     }
     $html = '<select name="osi_state_id_' . $stateName . '" style="width:360px">' . $selectOptions . '</select>';
     return $html;
 }