Index: branches/5.1.x/units/orders/orders_item.php =================================================================== diff -u -r13100 -r13465 --- branches/5.1.x/units/orders/orders_item.php (.../orders_item.php) (revision 13100) +++ branches/5.1.x/units/orders/orders_item.php (.../orders_item.php) (revision 13465) @@ -1,6 +1,6 @@ Application->recallObject('CountryStatesHelper'); + /* @var $cs_helper kCountryStatesHelper */ - $shipping_country_id = (int) $this->Conn->GetOne( sprintf($sql, 1, $this->Conn->qstr($this->GetDBField('ShippingCountry') ) ) ); - $shipping_state_id = (int) $this->Conn->GetOne( sprintf($sql, 2, $this->Conn->qstr($this->GetDBField('ShippingState') ) ) ); + $shipping_country_id = $cs_helper->getCountryStateId($this->GetDBField('ShippingCountry'), DESTINATION_TYPE_COUNTRY); + $shipping_state_id = $cs_helper->getCountryStateId($this->GetDBField('ShippingState'), DESTINATION_TYPE_STATE); $shipping_zip = (string) $this->GetDBField('ShippingZip'); - $billing_country_id = (int) $this->Conn->GetOne( sprintf($sql, 1, $this->Conn->qstr($this->GetDBField('BillingCountry') ) ) ); - $billing_state_id = (int) $this->Conn->GetOne( sprintf($sql, 2, $this->Conn->qstr($this->GetDBField('BillingState') ) ) ); + $billing_country_id = $cs_helper->getCountryStateId($this->GetDBField('BillingCountry'), DESTINATION_TYPE_COUNTRY); + $billing_state_id = $cs_helper->getCountryStateId($this->GetDBField('BillingState'), DESTINATION_TYPE_STATE); $billing_zip = (string) $this->GetDBField('BillingZip'); /*