Do not show service products in rooms display block search

This commit is contained in:
Abhishek Kumar
2023-08-24 18:37:47 +05:30
parent ccace94c38
commit eecfa81865
2 changed files with 4 additions and 0 deletions

View File

@@ -58,6 +58,8 @@ if ($excludeIds && $excludeIds != 'NaN') {
$excludeVirtuals = (bool)Tools::getValue('excludeVirtuals', true);
$exclude_packs = (bool)Tools::getValue('exclude_packs', true);
$bookingProduct = (int) Tools::getValue('booking_product');
$context = Context::getContext();
$sql = 'SELECT p.`id_product`, pl.`link_rewrite`, p.`reference`, pl.`name`, image_shop.`id_image` id_image, il.`legend`, p.`cache_default_attribute`
@@ -72,6 +74,7 @@ $sql = 'SELECT p.`id_product`, pl.`link_rewrite`, p.`reference`, pl.`name`, imag
(!empty($excludePackItself) ? ' AND p.id_product <> '.$excludePackItself.' ' : ' ').
($excludeVirtuals ? 'AND NOT EXISTS (SELECT 1 FROM `'._DB_PREFIX_.'product_download` pd WHERE (pd.id_product = p.id_product))' : '').
($exclude_packs ? 'AND (p.cache_is_pack IS NULL OR p.cache_is_pack = 0)' : '').
($bookingProduct ? 'AND p.`booking_product` = '.(int) $bookingProduct : '').
' GROUP BY p.id_product';
$items = Db::getInstance()->executeS($sql);

View File

@@ -38,6 +38,7 @@ $(document).ready(function() {
data: {
q: word,
_: n,
booking_product: '1',
},
success: function(result) {
if (result) {