Merge pull request #1280 from vishal-singh-webkul/gli-ws_hotel_category_fix
Fixed: The hotel and rooms categories are not updated properly while updating the hotel using the API and csv import.
This commit is contained in:
@@ -1399,6 +1399,8 @@ class AdminImportControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
// Updating the room type categories if exists.
|
||||
$objHotelBranch->updateRoomTypeCategories();
|
||||
$objHotelOrderRestrictDate = new HotelOrderRestrictDate();
|
||||
$restrictDateInfo = HotelOrderRestrictDate::getDataByHotelId($objHotelBranch->id);
|
||||
if ($restrictDateInfo) {
|
||||
|
||||
@@ -111,9 +111,6 @@ class HotelBranchInformation extends ObjectModel
|
||||
'use_global_preparation_time' => array(),
|
||||
'preparation_time' => array(),
|
||||
),
|
||||
'hidden_fields' => array (
|
||||
'id_category',
|
||||
),
|
||||
'associations' => array(
|
||||
'room_types' => array(
|
||||
'setter' => false,
|
||||
@@ -1022,6 +1019,9 @@ class HotelBranchInformation extends ObjectModel
|
||||
// set categories of the hotel
|
||||
$this->setWsHotelCategories();
|
||||
|
||||
// update room categories after the hotel category is updated.
|
||||
$this->updateRoomTypeCategories();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1229,14 +1229,7 @@ class HotelBranchInformation extends ObjectModel
|
||||
if ($catState) {
|
||||
if ($catCity = $this->addCategory($this->city, $catState, $groupIds)) {
|
||||
$hotelCatName = $this->hotel_name[Configuration::get('PS_LANG_DEFAULT')];
|
||||
if ($this->id_category) {
|
||||
$objCategory = new Category($this->id_category);
|
||||
$objCategory->name = $this->hotel_name;
|
||||
$objCategory->link_rewrite = $linkRewriteArray;
|
||||
$objCategory->id_parent = $catCity;
|
||||
$objCategory->save();
|
||||
Category::regenerateEntireNtree();
|
||||
} else if ($catHotel = $this->addCategory(
|
||||
if ($catHotel = $this->addCategory(
|
||||
$hotelCatName, $catCity, $groupIds, 1, $this->id, $linkRewriteArray
|
||||
)) {
|
||||
$this->id_category = $catHotel;
|
||||
|
||||
Reference in New Issue
Block a user