From 9bf3c567e39f0dd9a0aa095a83445f906bd45bad Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 31 Jul 2023 12:01:19 +0530 Subject: [PATCH 1/7] Fix PHP warning on Preferences > General page --- classes/Tools.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/classes/Tools.php b/classes/Tools.php index c48c02177..58ab06580 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -3603,6 +3603,8 @@ exit; public static function purifyHTML($html, $uri_unescape = null, $allow_style = false) { + require_once(_PS_TOOL_DIR_.'htmlpurifier/HTMLPurifier.auto.php'); + static $use_html_purifier = null; static $purifier = null; From 4060d11a3784ba5bf7aaa147532fe868ea9c28cf Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 3 Aug 2023 17:05:26 +0530 Subject: [PATCH 2/7] Change delete coucher button --- .../template/controllers/orders/helpers/view/view.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl index 374e669e4..329e5fa04 100644 --- a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl @@ -1259,9 +1259,9 @@ {displayPrice price=$discount['value'] currency=$currency->id} {if $can_edit} - - - + + + {l s='Delete voucher'} From 80230795be90877f982e8ff5c188de0392e29459 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 8 Aug 2023 18:33:35 +0530 Subject: [PATCH 3/7] Fix PHP warninh on search results page --- classes/Product.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/classes/Product.php b/classes/Product.php index 84fc215a2..f88ffd367 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -2579,8 +2579,12 @@ class ProductCore extends ObjectModel } $id_address = $context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}; + + $id_country = (int) Configuration::get('PS_COUNTRY_DEFAULT'); $ids = Address::getCountryAndState($id_address); - $id_country = $ids['id_country'] ? (int) $ids['id_country'] : (int) Configuration::get('PS_COUNTRY_DEFAULT'); + if (isset($ids['id_country']) && (int) $ids['id_country']) { + $id_country = (int) $ids['id_country']; + } return SpecificPrice::getProductIdByDate( $context->shop->id, From 9689ac1ba16cb94ec636fd4040d44f49d5970413 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Wed, 16 Aug 2023 14:48:18 +0530 Subject: [PATCH 4/7] Update HotelRoomTypeFeaturePricing.php --- .../classes/HotelRoomTypeFeaturePricing.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php b/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php index 29c85977e..b4f555637 100644 --- a/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php +++ b/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php @@ -260,7 +260,6 @@ class HotelRoomTypeFeaturePricing extends ObjectModel $hotelRoomType = new HotelRoomType(); $context = Context::getContext(); $roomTypeRatesAndInventory = array(); - $hotelCartBookingData = new HotelCartBookingData(); $objBookingDetail = new HotelBookingDetail(); $incr = 0; $date_from = date('Y-m-d', strtotime($date_from)); @@ -283,7 +282,7 @@ class HotelRoomTypeFeaturePricing extends ObjectModel $totalAvailableRooms = 0; } - $roomTypePrice = $hotelCartBookingData->getRoomTypeTotalPrice($id_product, $currentDate, $nextDayDate); + $roomTypePrice = self::getRoomTypeTotalPrice($id_product, $currentDate, $nextDayDate); $roomTypeRatesAndInventory[$incr]['date'] = $currentDate; $roomTypeRatesAndInventory[$incr]['room_types'][0]['id'] = $id_product; $roomTypeRatesAndInventory[$incr]['room_types'][0]['rates'] = $roomTypePrice; @@ -293,7 +292,7 @@ class HotelRoomTypeFeaturePricing extends ObjectModel if ($hotelRoomTypes) { $roomTypeRatesAndInventory[$incr]['date'] = $currentDate; foreach ($hotelRoomTypes as $key => $product) { - $roomTypePrice = $hotelCartBookingData->getRoomTypeTotalPrice( + $roomTypePrice = self::getRoomTypeTotalPrice( $product['id_product'], $currentDate, $nextDayDate From 790d3c0eb961633d9a6a87b615a8098f9ea537df Mon Sep 17 00:00:00 2001 From: abhishek-webkul <84142535+abhishek-webkul@users.noreply.github.com> Date: Thu, 7 Sep 2023 16:20:27 +0530 Subject: [PATCH 5/7] Update HotelRoomTypeFeaturePricing.php --- .../classes/HotelRoomTypeFeaturePricing.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php b/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php index b4f555637..f56738e6e 100644 --- a/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php +++ b/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php @@ -282,7 +282,7 @@ class HotelRoomTypeFeaturePricing extends ObjectModel $totalAvailableRooms = 0; } - $roomTypePrice = self::getRoomTypeTotalPrice($id_product, $currentDate, $nextDayDate); + $roomTypePrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice($id_product, $currentDate, $nextDayDate); $roomTypeRatesAndInventory[$incr]['date'] = $currentDate; $roomTypeRatesAndInventory[$incr]['room_types'][0]['id'] = $id_product; $roomTypeRatesAndInventory[$incr]['room_types'][0]['rates'] = $roomTypePrice; @@ -292,7 +292,7 @@ class HotelRoomTypeFeaturePricing extends ObjectModel if ($hotelRoomTypes) { $roomTypeRatesAndInventory[$incr]['date'] = $currentDate; foreach ($hotelRoomTypes as $key => $product) { - $roomTypePrice = self::getRoomTypeTotalPrice( + $roomTypePrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice( $product['id_product'], $currentDate, $nextDayDate From edffee0fbdb106000450108b80a3a11abfdce356 Mon Sep 17 00:00:00 2001 From: abhishek-webkul <84142535+abhishek-webkul@users.noreply.github.com> Date: Mon, 11 Sep 2023 20:03:39 +0530 Subject: [PATCH 6/7] Update Product.php --- classes/Product.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/classes/Product.php b/classes/Product.php index f88ffd367..ff76e2520 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -2579,14 +2579,16 @@ class ProductCore extends ObjectModel } $id_address = $context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}; - - $id_country = (int) Configuration::get('PS_COUNTRY_DEFAULT'); $ids = Address::getCountryAndState($id_address); + + $id_country = null; if (isset($ids['id_country']) && (int) $ids['id_country']) { $id_country = (int) $ids['id_country']; + } else { + $id_country = (int) Configuration::get('PS_COUNTRY_DEFAULT'); } - return SpecificPrice::getProductIdByDate( + return SpecificPrice::getProductIdByDate( $context->shop->id, $context->currency->id, $id_country, From 77a725f19a9f8415cf1a3b849e111a4ad2a3b633 Mon Sep 17 00:00:00 2001 From: abhishek-webkul <84142535+abhishek-webkul@users.noreply.github.com> Date: Mon, 11 Sep 2023 20:04:31 +0530 Subject: [PATCH 7/7] Update Product.php --- classes/Product.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Product.php b/classes/Product.php index ff76e2520..9af80ed4f 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -2588,7 +2588,7 @@ class ProductCore extends ObjectModel $id_country = (int) Configuration::get('PS_COUNTRY_DEFAULT'); } - return SpecificPrice::getProductIdByDate( + return SpecificPrice::getProductIdByDate( $context->shop->id, $context->currency->id, $id_country,