used feature price without reduction for showing price on serch result page

This commit is contained in:
Shreesh Arora
2024-08-29 16:31:30 +05:30
parent 55fdfeb0fc
commit 113b9ebcd5
3 changed files with 3 additions and 20 deletions

View File

@@ -3538,20 +3538,6 @@ class ProductCore extends ObjectModel
return $price;
}
public static function getPriceWithoutReductStatic($id_product, $notax = false, $id_product_attribute = false, $decimals = 6, $with_auto_add_services = 0)
{
$price = Product::getPriceStatic((int)$id_product, !$notax, $id_product_attribute, $decimals, null, false, false);
if ($with_auto_add_services) {
if ($services = RoomTypeServiceProduct::getAutoAddServices((int) $id_product, null, null, Product::PRICE_ADDITION_TYPE_WITH_ROOM, !$notax)) {
foreach($services as $service) {
$price += $service['price'];
}
}
}
return $price;
}
/**
* Display price with right format and currency
*

View File

@@ -1691,8 +1691,7 @@ class HotelBookingDetail extends ObjectModel
}
$prod_price = Product::getPriceStatic($value['id_product'], self::useTax());
$productPriceWithoutReduction = Product::getPriceWithoutReductStatic($value['id_product'], !self::useTax());
$productFeaturePriceWithoutAutoAdd = HotelRoomTypeFeaturePricing::getRoomTypeFeaturePricesPerDay($value['id_product'], $date_from, $date_to, self::useTax(), 0, 0, 0, 0, 0);
$productPriceWithoutReduction = HotelRoomTypeFeaturePricing::getRoomTypeFeaturePricesPerDay($value['id_product'], $date_from, $date_to, self::useTax(), 0, 0, 0, 0, 1, 0);
$cover_image_arr = Product::getCover($value['id_product']);
if (!empty($cover_image_arr)) {
$cover_img = $this->context->link->getImageLink($value['link_rewrite'], $value['id_product'].'-'.$cover_image_arr['id_image'], 'home_default');
@@ -1703,10 +1702,8 @@ class HotelBookingDetail extends ObjectModel
$bookingData['rm_data'][$key]['feature'] = $product_feature;
$bookingData['rm_data'][$key]['price'] = $prod_price;
$bookingData['rm_data'][$key]['feature_price'] = $productFeaturePrice;
$bookingData['rm_data'][$key]['feature_price_withoout_auto_add'] = $productFeaturePriceWithoutAutoAdd;
$bookingData['rm_data'][$key]['price_without_reduction'] = $productPriceWithoutReduction;
$bookingData['rm_data'][$key]['price_without_reduction_with_auto_add'] = $productPriceWithoutReduction + ($productFeaturePrice - $productFeaturePriceWithoutAutoAdd);
$bookingData['rm_data'][$key]['feature_price_diff'] = $bookingData['rm_data'][$key]['price_without_reduction_with_auto_add'] - $productFeaturePrice;
$bookingData['rm_data'][$key]['feature_price_diff'] = $productPriceWithoutReduction - $productFeaturePrice;
$bookingData['rm_data'][$key]['room_left'] = count($bookingData['rm_data'][$key]['data']['available']);
// create URL with the parameters from URL

View File

@@ -59,7 +59,7 @@
<p class="rm_price_cont">
{if $room_v['feature_price_diff'] >= 0}
<span class="rm_price_val {if $room_v['feature_price_diff']>0}room_type_old_price{/if}">
{displayPrice price = $room_v['price_without_reduction_with_auto_add']|round:2|floatVal}
{displayPrice price = $room_v['price_without_reduction']|round:2|floatVal}
</span>
{/if}
{if $room_v['feature_price_diff']}