Fixed: Should not show service products in the front office when Show at front office is disabled
This commit is contained in:
@@ -116,13 +116,16 @@ class ProductControllerCore extends FrontController
|
||||
$this->product = new Product($id_product, true, $this->context->language->id, $this->context->shop->id);
|
||||
}
|
||||
|
||||
// redirect if the product is not available for front
|
||||
if (!$this->product->show_at_front) {
|
||||
Tools::redirect($this->context->link->getPageLink('pagenotfound'));
|
||||
}
|
||||
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
if ($hotelRoomInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($this->product->id)) {
|
||||
$idHotel = (int) $hotelRoomInfo['id_hotel'];
|
||||
if (!HotelHelper::validateDateRangeForHotel($dateFrom, $dateTo, $idHotel)) {
|
||||
Tools::redirect($this->context->link->getPageLink('pagenotfound'));
|
||||
} else if (!$this->product->booking_product || ($this->product->booking_product && !$this->product->show_at_front)) {
|
||||
Tools::redirect($this->context->link->getPageLink('pagenotfound'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user