Skip to content

Commit

Permalink
Fixed:synopsis issues and image issue in Hotel API
Browse files Browse the repository at this point in the history
  • Loading branch information
sumitwebkul committed Jan 21, 2024
1 parent 82dae8c commit b49020e
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ class HotelBranchInformation extends ObjectModel
'update' => 'updateWs',
),
'fields' => array(
'phone' => array(),
'address' => array(),
'phone' => array('required' => true),
'address' => array('required' => true),
'id_country' => array(
'required' => true,
'xlink_resource'=> 'countries',
Expand Down Expand Up @@ -871,7 +871,7 @@ public function setCoverWs($id_image)
}

// Webservice:: function to prepare id parameter for hotel images in a hotel api
public function getWsHotelImages()
public function getWsImages()
{
$ids = array();
if ($hotelImages = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'htl_image` WHERE `id_hotel` = '.(int)$this->id)) {
Expand Down Expand Up @@ -1115,14 +1115,14 @@ public function validateFields($die = true, $error_return = false)
}
}
/* Check zip code format */
if ($objCountry->zip_code_format && !$objCountry->checkZipCode($this->zipcode)) {
$message = sprintf(Tools::displayError('The Zip/Postal code you have entered is invalid. It must follow this format: %s'), str_replace('C', $objCountry->iso_code, str_replace('N', '0', str_replace('L', 'A', $objCountry->zip_code_format))));
if (empty($this->zipcode) && $objCountry->need_zip_code) {
$message = Tools::displayError('A Zip / Postal code is required.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
} elseif (empty($this->zipcode) && $objCountry->need_zip_code) {
$message = Tools::displayError('A Zip / Postal code is required.');
} elseif ($objCountry->zip_code_format && !$objCountry->checkZipCode($this->zipcode)) {
$message = sprintf(Tools::displayError('The Zip/Postal code you have entered is invalid. It must follow this format: %s'), str_replace('C', $objCountry->iso_code, str_replace('N', '0', str_replace('L', 'A', $objCountry->zip_code_format))));
if ($die) {
throw new PrestaShopException($message);
}
Expand Down

0 comments on commit b49020e

Please sign in to comment.