Fix double-counted service product totals in multi-hotel cart
This commit is contained in:
@@ -1840,7 +1840,12 @@ class CartCore extends ObjectModel
|
||||
null,
|
||||
0,
|
||||
(int)$product['auto_add_to_cart'],
|
||||
(int)$product['price_addition_type']
|
||||
(int)$product['price_addition_type'],
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
isset($product['id_hotel']) ? $product['id_hotel'] : null
|
||||
)) {
|
||||
foreach ($servicesWithRoom as $service) {
|
||||
if ($with_taxes) {
|
||||
|
||||
@@ -157,7 +157,8 @@ class ServiceProductCartDetail extends ObjectModel
|
||||
$groupByProductId = 0,
|
||||
$detailedInfo = 0,
|
||||
$idLang = 0,
|
||||
$idServiceProductCartDetail = 0
|
||||
$idServiceProductCartDetail = 0,
|
||||
$idRoomTypeHotel = null
|
||||
) {
|
||||
if ($useTax === null) {
|
||||
$useTax = Product::$_taxCalculationMethod == PS_TAX_EXC ? false : true;
|
||||
@@ -207,6 +208,9 @@ class ServiceProductCartDetail extends ObjectModel
|
||||
if (!is_null($idHotel)) {
|
||||
$sql .= ' AND spc.`id_hotel`='.(int) $idHotel;
|
||||
}
|
||||
if(!is_null($idRoomTypeHotel)) {
|
||||
$sql .= ' AND hcbd.`id_hotel`='.(int) $idRoomTypeHotel;
|
||||
}
|
||||
if (!is_null($idProduct)) {
|
||||
$sql .= ' AND spc.`id_product`='.(int) $idProduct;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user