Skip to content

Commit f8caa22

Browse files
authored
Merge pull request #1235 from vishal-singh-webkul/gli-2306
Fixed: The customer is unable to write review in case even a single room in the booking is refunded or cancelled.
2 parents 27ee499 + 50c1670 commit f8caa22

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

modules/qlohotelreview/classes/QhrHotelReviewHelper.php

+7-6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public static function getIsOrderCheckedOut($idOrder)
2929
return (bool) !Db::getInstance()->getValue(
3030
'SELECT COUNT(*) FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
3131
WHERE hbd.`id_status` != '.(int) HotelBookingDetail::STATUS_CHECKED_OUT.'
32+
AND hbd.`is_refunded` != 1
33+
AND hbd.`is_cancelled` != 1
3234
AND hbd.`id_order` = '.(int) $idOrder
3335
);
3436
}
@@ -57,6 +59,11 @@ public static function getIsReviewable($idOrder)
5759
return false;
5860
}
5961

62+
$objOrder = new Order($idOrder);
63+
if ($objOrder->hasCompletelyRefunded()) {
64+
return false;
65+
}
66+
6067
if (self::getIsOrderCheckedOut($idOrder)) {
6168
return true;
6269
}
@@ -120,12 +127,6 @@ public static function getHotelByOrder($idOrder)
120127
);
121128
}
122129

123-
public static function getPathForCreation($idHotelReview)
124-
{
125-
$folders = str_split((string)$id_image);
126-
return implode('/', $folders).'/';
127-
}
128-
129130
public static function createDirectory($dir)
130131
{
131132
if (!file_exists($dir)) {

0 commit comments

Comments
 (0)