if (isset($this->error['country'])) {
$this->data['error_country'] = $this->error['country'];
} else {
$this->data['error_country'] = '';
}
if (isset($this->error['zone'])) {
$this->data['error_zone'] = $this->error['zone'];
} else {
$this->data['error_zone'] = '';
}
if (isset($this->request->post['country_id'])) {
$this->data['country_id'] = $this->request->post['country_id'];
} elseif (isset($this->session->data['shipping_country_id'])) {
$this->data['country_id'] = $this->session->data['shipping_country_id'];
} else {
$this->data['country_id'] = $this->config->get('config_country_id');
}
if (isset($this->request->post['zone_id'])) {
$this->data['zone_id'] = $this->request->post['zone_id'];
} elseif (isset($this->session->data['shipping_zone_id'])) {
$this->data['zone_id'] = $this->session->data['shipping_zone_id'];
} else {
$this->data['zone_id'] = '';
}
if ($this->request->post['country_id'] == '') {
$this->error['country'] = $this->language->get('error_country');
}
if (!isset($this->request->post['zone_id']) || $this->request->post['zone_id'] == '') {
$this->error['zone'] = $this->language->get('error_zone');
}
public function country() {
$json = array();
$this->load->model('localisation/country');
$country_info = $this->model_localisation_country->getCountry($this->request->get['country_id']);
if ($country_info) {
$this->load->model('localisation/zone');
$json = array(
'country_id' => $country_info['country_id'],
'name' => $country_info['name'],
'iso_code_2' => $country_info['iso_code_2'],
'iso_code_3' => $country_info['iso_code_3'],
'address_format' => $country_info['address_format'],
'postcode_required' => $country_info['postcode_required'],
'zone' => $this->model_localisation_zone->getZonesByCountryId($this->request->get['country_id']),
'status' => $country_info['status']
);
}
$this->response->setOutput(json_encode($json));
}
schematx.pl napisał(a):tylko nie zapominaj że te pola są polami wymaganymi, ich ukrycie nic nie da bo formularz nie przejdize do kolejnej zakładki.
Powrót do Pomoc techniczna przy Opencart
Użytkownicy przeglądający ten dział: Brak zidentyfikowanych użytkowników i 8 gości