Fixed: issues in creation booking from back-office

This commit is contained in:
Sumit Panwar
2025-03-26 20:21:10 +05:30
parent b1446b3a77
commit 608ed275c7

View File

@@ -37,9 +37,9 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
public function init()
{
parent::init();
$this->createNewCart();
if (isset($this->context->cookie->id_cart)) {
$objCart = new Cart(74);
$objCart = new Cart($this->context->cookie->id_cart);
if (Validate::isLoadedObject($objCart) && !$objCart->orderExists()) {
$this->context->cart = $objCart;
@@ -75,7 +75,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
Guest::setNewGuest($this->context->cookie);
}
$this->context->cart = new Cart(74);
$this->context->cart = new Cart();
$this->context->cart->gift = 0;
$this->context->cart->id_shop = (int) $this->context->shop->id;
$this->context->cart->id_lang = (($id_lang = (int) Tools::getValue('id_lang')) ? $id_lang : (int) Configuration::get('PS_LANG_DEFAULT'));
@@ -150,12 +150,6 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
$occupancy = array();
}
// if (Tools::getValue('booking_product')) {
// $booking_product = Tools::getValue('booking_product');
// } else {
// $booking_product = 1;
// }
$this->id_cart = (int) $this->context->cart->id;
$this->id_guest = (int) $this->context->cookie->id_guest;
$this->id_hotel = $id_hotel;