diff --git a/admin/themes/default/template/controllers/orders/modals/_extra_services_service_products_tab_content.tpl b/admin/themes/default/template/controllers/orders/modals/_extra_services_service_products_tab_content.tpl index a1013e732..8fb331302 100644 --- a/admin/themes/default/template/controllers/orders/modals/_extra_services_service_products_tab_content.tpl +++ b/admin/themes/default/template/controllers/orders/modals/_extra_services_service_products_tab_content.tpl @@ -256,6 +256,7 @@ {l s='ID'} {l s='Name'} + {l s='Quantity'} {l s='Unit Price (tax excl.)'} {l s='Total Price (tax excl.)'} {l s='Total Price (tax incl.)'} @@ -276,6 +277,13 @@ {l s='Auto added'} {/if} + + {if isset($service['allow_multiple_quantity']) && $service['allow_multiple_quantity']} + {$service['quantity']} + {else} + {l s='--'} + {/if} + {displayPrice price=$service['unit_price_tax_excl'] currency=$orderCurrency} {if $service['price_calculation_method'] == Product::PRICE_CALCULATION_METHOD_PER_DAY} diff --git a/classes/module/Module.php b/classes/module/Module.php index 937e9ecf6..1a1b4c200 100644 --- a/classes/module/Module.php +++ b/classes/module/Module.php @@ -3044,7 +3044,7 @@ abstract class ModuleCore ); $reflectionClassModule = new ReflectionClass($overrideClassName.'Override'.$uniq); - $moduleClassFileArray = $this->getCommentedClass($moduleClassFileArray, $reflectionClassModule, $reflectionClassOverride, $overrideClassFileArray); + $moduleClassFileArray = $this->getCommentedClass($moduleClassFileArray, $reflectionClassModule, $reflectionClassOverride, $overrideClassFileArray, $overrideClassName); // Insert the methods from module override in override $generatedCodeToCopy = array_slice($moduleClassFileArray, $reflectionClassModule->getStartLine() + 1, $reflectionClassModule->getEndLine() - $reflectionClassModule->getStartLine() - 2); @@ -3091,7 +3091,7 @@ abstract class ModuleCore ); $reflectionClassModule = new ReflectionClass($overrideClassName.'Override'.$uniq); - $moduleClassFileArray = $this->getCommentedClass($moduleClassFileArray, $reflectionClassModule); + $moduleClassFileArray = $this->getCommentedClass($moduleClassFileArray, $reflectionClassModule, null, null, $overrideClassName); file_put_contents($overrideClassFilePath, preg_replace($patternEscapeCommon, '', $moduleClassFileArray)); @@ -3102,7 +3102,7 @@ abstract class ModuleCore return true; } - private function getCommentedClass($moduleClassFileArray, $reflectionClassModule, $reflectionClassOverride = null, $overrideClassFileArray = null) + private function getCommentedClass($moduleClassFileArray, $reflectionClassModule, $reflectionClassOverride = null, $overrideClassFileArray = null, $className = '') { // Check if none of the methods already exists in the override class foreach ($reflectionClassModule->getMethods() as $method) { @@ -3110,15 +3110,15 @@ abstract class ModuleCore if ($reflectionClassOverride->hasMethod($method->getName())) { $overrideMethodInfo = $reflectionClassOverride->getMethod($method->getName()); if (preg_match('/module: (.*)/ism', $overrideClassFileArray[$overrideMethodInfo->getStartLine() - 5], $name) && preg_match('/date: (.*)/ism', $overrideClassFileArray[$overrideMethodInfo->getStartLine() - 4], $date) && preg_match('/version: ([0-9.]+)/ism', $overrideClassFileArray[$overrideMethodInfo->getStartLine() - 3], $version)) { - throw new Exception(sprintf(Tools::displayError('The method %1$s in the class %2$s is already overridden by the module %3$s version %4$s at %5$s.'), $method->getName(), $classname, $name[1], $version[1], $date[1])); + throw new Exception(sprintf(Tools::displayError('The method %1$s in the class %2$s is already overridden by the module %3$s version %4$s at %5$s.'), $method->getName(), $className, $name[1], $version[1], $date[1])); } - throw new Exception(sprintf(Tools::displayError('The method %1$s in the class %2$s is already overridden.'), $method->getName(), $classname)); + throw new Exception(sprintf(Tools::displayError('The method %1$s in the class %2$s is already overridden.'), $method->getName(), $className)); } } $moduleClassFileArray = preg_replace('/((:?public|private|protected)\s+(static\s+)?function\s+(?:\b'.$method->getName().'\b))/ism', "/*\n * module: ".$this->name."\n * date: ".date('Y-m-d H:i:s')."\n * version: ".$this->version."\n */\n $1", $moduleClassFileArray); if ($moduleClassFileArray === null) { - throw new Exception(sprintf(Tools::displayError('Failed to override method %1$s in class %2$s.'), $method->getName(), $classname)); + throw new Exception(sprintf(Tools::displayError('Failed to override method %1$s in class %2$s.'), $method->getName(), $className)); } } @@ -3126,13 +3126,13 @@ abstract class ModuleCore foreach ($reflectionClassModule->getProperties() as $property) { if ($reflectionClassOverride) { if ($reflectionClassOverride->hasProperty($property->getName())) { - throw new Exception(sprintf(Tools::displayError('The property %1$s in the class %2$s is already defined.'), $property->getName(), $classname)); + throw new Exception(sprintf(Tools::displayError('The property %1$s in the class %2$s is already defined.'), $property->getName(), $className)); } } $moduleClassFileArray = preg_replace('/((?:public|private|protected)\s)\s*(static\s)?\s*(\$\b'.$property->getName().'\b)/ism', "/*\n * module: ".$this->name."\n * date: ".date('Y-m-d H:i:s')."\n * version: ".$this->version."\n */\n $1$2$3", $moduleClassFileArray); if ($moduleClassFileArray === null) { - throw new Exception(sprintf(Tools::displayError('Failed to override property %1$s in class %2$s.'), $property->getName(), $classname)); + throw new Exception(sprintf(Tools::displayError('Failed to override property %1$s in class %2$s.'), $property->getName(), $className)); } } @@ -3140,13 +3140,13 @@ abstract class ModuleCore foreach ($reflectionClassModule->getConstants() as $constant => $value) { if ($reflectionClassOverride) { if ($reflectionClassOverride->hasConstant($constant)) { - throw new Exception(sprintf(Tools::displayError('The constant %1$s in the class %2$s is already defined.'), $constant, $classname)); + throw new Exception(sprintf(Tools::displayError('The constant %1$s in the class %2$s is already defined.'), $constant, $className)); } } $moduleClassFileArray = preg_replace('/(const\s)\s*(\b'.$constant.'\b)/ism', "/*\n * module: ".$this->name."\n * date: ".date('Y-m-d H:i:s')."\n * version: ".$this->version."\n */\n $1$2", $moduleClassFileArray); if ($moduleClassFileArray === null) { - throw new Exception(sprintf(Tools::displayError('Failed to override constant %1$s in class %2$s.'), $constant, $classname)); + throw new Exception(sprintf(Tools::displayError('Failed to override constant %1$s in class %2$s.'), $constant, $className)); } } diff --git a/classes/order/Order.php b/classes/order/Order.php index 656bce9cc..7bceb94cf 100644 --- a/classes/order/Order.php +++ b/classes/order/Order.php @@ -2577,6 +2577,7 @@ class OrderCore extends ObjectModel )) { $totals = array_reduce($serviceProductDetail, function ($carry, $item) use ($order_detail) { $objHotelBookingDetail = new HotelBookingDetail((int) $item['id_htl_booking_detail']); + $numDays = 1; if ((Product::PRICE_CALCULATION_METHOD_PER_DAY == $order_detail['product_price_calculation_method']) && (!$numDays = HotelHelper::getNumberOfDays($objHotelBookingDetail->date_from, $objHotelBookingDetail->date_to)) ) { diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index cd2874dba..30026bcca 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -2992,7 +2992,8 @@ class AdminOrdersControllerCore extends AdminController $helper->icon = 'icon-money'; $helper->color = 'color2'; $helper->title = $this->l('Total Due Amount', null, null, false); - $minValue = ('0.' . str_repeat('0', (Configuration::get('PS_PRICE_DISPLAY_PRECISION') - 1)) . '1'); + $priceDisplayPrecision = (int)Configuration::get('PS_PRICE_DISPLAY_PRECISION'); + $minValue = ('0.' . ($priceDisplayPrecision ? str_repeat('0', ($priceDisplayPrecision - 1)) : '') . '1'); // get all valid order states for due amount calculations $validOrderStatesFilter = ''; diff --git a/controllers/admin/AdminSearchConfController.php b/controllers/admin/AdminSearchConfController.php index e07881d2c..00d2daab7 100644 --- a/controllers/admin/AdminSearchConfController.php +++ b/controllers/admin/AdminSearchConfController.php @@ -33,6 +33,7 @@ class AdminSearchConfControllerCore extends AdminController public function __construct() { + Tools::redirectAdmin(Context::getContext()->link->getAdminLink('AdminDashboard')); $this->bootstrap = true; $this->table = 'alias'; $this->className = 'Alias'; diff --git a/install/data/xml/tab.xml b/install/data/xml/tab.xml index ac0890d86..09eed80f3 100644 --- a/install/data/xml/tab.xml +++ b/install/data/xml/tab.xml @@ -228,9 +228,9 @@ - + AdminMaintenance diff --git a/install/data/xml/theme_meta.xml b/install/data/xml/theme_meta.xml index 041a7e1c7..ce42c1a27 100644 --- a/install/data/xml/theme_meta.xml +++ b/install/data/xml/theme_meta.xml @@ -42,5 +42,6 @@ + diff --git a/modules/blocknavigationmenu/classes/WkCustomNavigationLink.php b/modules/blocknavigationmenu/classes/WkCustomNavigationLink.php index f8cfd422c..e4e86b593 100644 --- a/modules/blocknavigationmenu/classes/WkCustomNavigationLink.php +++ b/modules/blocknavigationmenu/classes/WkCustomNavigationLink.php @@ -197,8 +197,8 @@ class WkCustomNavigationLink extends ObjectModel 'id_cms' => 0, 'show_at_navigation' => 1, 'show_at_footer' => 0, - 'is_custom_link' => 1, - 'link' => $objLink->getPageLink('our-properties'), + 'is_custom_link' => 0, + 'link' => 'our-properties', ), ); diff --git a/modules/dashactivity/dashactivity.php b/modules/dashactivity/dashactivity.php index 5f409565d..f9a36d348 100644 --- a/modules/dashactivity/dashactivity.php +++ b/modules/dashactivity/dashactivity.php @@ -532,12 +532,13 @@ class Dashactivity extends Module public function getConfigFieldsValues() { + $priceDisplayPrecision = (int)Configuration::get('PS_PRICE_DISPLAY_PRECISION'); return array( 'DASHACTIVITY_CART_ACTIVE' => Tools::getValue('DASHACTIVITY_CART_ACTIVE', Configuration::get('DASHACTIVITY_CART_ACTIVE')), 'DASHACTIVITY_CART_ABANDONED_MIN' => Tools::getValue('DASHACTIVITY_CART_ABANDONED_MIN', Configuration::get('DASHACTIVITY_CART_ABANDONED_MIN')), 'DASHACTIVITY_CART_ABANDONED_MAX' => Tools::getValue('DASHACTIVITY_CART_ABANDONED_MAX', Configuration::get('DASHACTIVITY_CART_ABANDONED_MAX')), 'DASHACTIVITY_VISITOR_ONLINE' => Tools::getValue('DASHACTIVITY_VISITOR_ONLINE', Configuration::get('DASHACTIVITY_VISITOR_ONLINE')), - 'min_due_amount' => ('0.' . str_repeat('0', (Configuration::get('PS_PRICE_DISPLAY_PRECISION') - 1)) . '1') + 'min_due_amount' => ('0.' . ($priceDisplayPrecision ? str_repeat('0', ($priceDisplayPrecision - 1)) : '') . '1') ); } diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index ce5ce56b2..fbf4ba1c6 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -1718,7 +1718,7 @@ class HotelBookingDetail extends ObjectModel } } $productFeaturePrice = HotelRoomTypeFeaturePricing::getRoomTypeFeaturePricesPerDay($value['id_product'], $date_from, $date_to, self::useTax(), 0, 0, 0, 0, 1, 1, $bookingParams['occupancy']); - if (!empty($price) && ($price['from'] > $productFeaturePrice || $price['to'] < $productFeaturePrice)) { + if (!empty($price) && ((float) $price['from'] > $productFeaturePrice || (float) $price['to'] < $productFeaturePrice)) { unset($bookingData['rm_data'][$key]); continue; }