Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: Same price is applied to same room for different dates if admin adds a custom price for a room at the book now page. #1337

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions modules/hotelreservationsystem/classes/HotelCartBookingData.php
Original file line number Diff line number Diff line change
Expand Up @@ -1359,10 +1359,11 @@ public function getProductFeaturePricePlanByDateByPriority(
$id_room = 0
) {
if ($id_cart && $id_room) {
if ($featurePrice = Db::getInstance()->getRow(
'SELECT * FROM `'._DB_PREFIX_.'htl_room_type_feature_pricing` fp
if ($featurePrice = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'htl_room_type_feature_pricing` fp
WHERE fp.`id_product` = '.(int) $id_product.' AND fp.`id_cart` = '.(int) $id_cart.'
AND fp.`id_guest` = '.(int) $id_guest.' AND fp.`id_room` = '.(int) $id_room.' AND fp.`active` = 1')
AND fp.`id_guest` = '.(int) $id_guest.' AND fp.`id_room` = '.(int) $id_room.'
AND fp.`active` = 1 AND fp.`date_from` <= \''.pSQL($date).'\'
AND fp.`date_to` > \''.pSQL($date).'\'')
) {
return $featurePrice;
}
Expand Down Expand Up @@ -1390,7 +1391,7 @@ public function getProductFeaturePricePlanByDateByPriority(
ON (fp.`id_feature_price` = fpg.`id_feature_price` AND fpg.`id_group` = '.(int) $id_group.')' : '').'
WHERE fp.`id_cart` = 0 AND fp.`id_product`='.(int) $id_product.'
AND fp.`is_special_days_exists`=1 AND fp.`active`=1 AND fp.`date_from` <= \''.pSQL($date).'\'
AND fp.`date_to` >= \''.pSQL($date).'\''
AND fp.`date_to` > \''.pSQL($date).'\''
)) {
foreach ($featurePrice as $fRow) {
$specialDays = json_decode($fRow['special_days']);
Expand All @@ -1406,7 +1407,7 @@ public function getProductFeaturePricePlanByDateByPriority(
ON (fp.`id_feature_price` = fpg.`id_feature_price` AND fpg.`id_group` = '.(int) $id_group.')' : '').'
WHERE fp.`id_cart` = 0 AND fp.`id_product`='.(int) $id_product.' AND fp.`date_selection_type` = '.(int) HotelRoomTypeFeaturePricing::DATE_SELECTION_TYPE_RANGE.'
AND `is_special_days_exists`=0 AND `active`=1
AND fp.`date_from` <= \''.pSQL($date).'\' AND fp.`date_to` >= \''.pSQL($date).'\''
AND fp.`date_from` <= \''.pSQL($date).'\' AND fp.`date_to` > \''.pSQL($date).'\''
)) {
return $featurePrice;
}
Expand Down