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'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -266,7 +266,9 @@
|
||||
<span class="clearfix"></span>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="separator-hr-mg-10">
|
||||
{if $product->available_for_order}
|
||||
<hr class="separator-hr-mg-10">
|
||||
{/if}
|
||||
{else}
|
||||
<input type="hidden" class="service_product_qty" id="service_product_qty" name="service_product_qty" data-id-product="{$product->id}" data-max_quantity="1" value="1">
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user