Fixed: fix review changes
This commit is contained in:
@@ -261,7 +261,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="associated_hotel_tree" {if ($product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE)}style="display:none;"{/if}>
|
||||
<div class="form-group" id="associated_hotel_tree" {if !Product::isSellableWithHotel($product->id)}style="display:none;"{/if}>
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="category_box" type="category_box"}</span></div>
|
||||
<label class="control-label col-lg-2" for="hotel_block">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select hotels for which this service will be available.'}">
|
||||
@@ -274,7 +274,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="associated_hotel_rooms_tree" {if ($product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE && $product->selling_preference_type != 0)}style="display:none;"{/if}>
|
||||
<div class="form-group" id="associated_hotel_rooms_tree" {if !Product::isSellableWithRoomType($product->id) && $product->selling_preference_type != 0}style="display:none;"{/if}>
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="category_box" type="category_box"}</span></div>
|
||||
<label class="control-label col-lg-2" for="hotel_room_block">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select room type and hotels for which this service will be available.'}">
|
||||
@@ -287,7 +287,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="auto_add_to_cart_container" {if $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE && $product->selling_preference_type != 0}style="display:none;"{/if}>
|
||||
<div class="form-group" id="auto_add_to_cart_container" {if !Product::isSellableWithRoomType($product->id) && $product->selling_preference_type != 0}style="display:none;"{/if}>
|
||||
<label class="control-label col-lg-3" for="">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='When enabled, this service will be added in cart for each associated Room type or Hotel when they are added in cart. Also auto added services will not be visible to customers.'}">
|
||||
{l s='Auto add to cart this product'}
|
||||
|
||||
@@ -1785,7 +1785,7 @@ class CartCore extends ObjectModel
|
||||
} else {
|
||||
$priceAdd = $serviceProduct['unit_price_tax_excl'];
|
||||
}
|
||||
$lineTotal = Tools::processPriceRounding($priceAdd, (int)$servicePorduct['quantity']);
|
||||
$lineTotal = Tools::processPriceRounding($priceAdd, (int)$serviceProduct['quantity']);
|
||||
if ($ps_round_type == Order::ROUND_TOTAL) {
|
||||
$products_total[$id_tax_rules_group.'_'.$id_address] += $lineTotal;
|
||||
} else {
|
||||
|
||||
@@ -1210,7 +1210,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
// get all services
|
||||
$objProduct = new Product();
|
||||
$serviceProducts = array_values(array_filter(
|
||||
$objProduct->getServiceProducts(null),
|
||||
$objProduct->getServiceProducts(true),
|
||||
function ($serviceProduct) {
|
||||
return Product::isSellableWithRoomType($serviceProduct['id_product']);
|
||||
}
|
||||
@@ -1561,7 +1561,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
// get all services
|
||||
$objProduct = new Product();
|
||||
$serviceProducts = array_values(array_filter(
|
||||
$objProduct->getServiceProducts(null),
|
||||
$objProduct->getServiceProducts(true),
|
||||
function ($serviceProduct) {
|
||||
return Product::isSellableWithRoomType($serviceProduct['id_product']);
|
||||
}
|
||||
|
||||
@@ -3027,20 +3027,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
|
||||
$allAssociations = $objRoomTypeServiceProduct->getAssociatedHotelsAndRoomType($product->id);
|
||||
|
||||
$roomTypeSellingPreferences = array(
|
||||
Product::SELLING_PREFERENCE_WITH_ROOM_TYPE,
|
||||
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE,
|
||||
Product::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE,
|
||||
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
|
||||
);
|
||||
$hotelSellingPreferences = array(
|
||||
Product::SELLING_PREFERENCE_WITH_HOTEL,
|
||||
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE,
|
||||
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE,
|
||||
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
|
||||
);
|
||||
|
||||
if (in_array((int)$product->selling_preference_type, $roomTypeSellingPreferences, true)) {
|
||||
if (Product::isSellableWithRoomType($product->id)) {
|
||||
$associatedRoomTypes = $allAssociations['room_type'];
|
||||
$selectedRoomTypes = Tools::getValue('RT_tree_room_type_box', array());
|
||||
|
||||
@@ -3084,7 +3071,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
);
|
||||
}
|
||||
|
||||
if (in_array((int)$product->selling_preference_type, $hotelSellingPreferences, true)) {
|
||||
if (Product::isSellableWithHotel($product->id)) {
|
||||
$associatedHotels = $allAssociations['hotel'];
|
||||
$selectedHotel = Tools::getValue('hotel_box', array());
|
||||
// Generate list of new associations
|
||||
@@ -3127,8 +3114,8 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
);
|
||||
}
|
||||
|
||||
if (!in_array((int)$product->selling_preference_type, $roomTypeSellingPreferences, true)
|
||||
&& !in_array((int)$product->selling_preference_type, $hotelSellingPreferences, true)
|
||||
if (!Product::isSellableWithRoomType($product->id)
|
||||
&& !Product::isSellableWithHotel($product->id)
|
||||
) {
|
||||
RoomTypeServiceProduct::deleteRoomProductLink($product->id);
|
||||
}
|
||||
|
||||
@@ -998,7 +998,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
// get all services
|
||||
$objProduct = new Product();
|
||||
$serviceProducts = array_values(array_filter(
|
||||
$objProduct->getServiceProducts(null),
|
||||
$objProduct->getServiceProducts(true),
|
||||
function ($serviceProduct) {
|
||||
return Product::isSellableWithRoomType($serviceProduct['id_product']);
|
||||
}
|
||||
@@ -7577,7 +7577,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
// get all services
|
||||
$objProduct = new Product();
|
||||
$serviceProducts = array_values(array_filter(
|
||||
$objProduct->getServiceProducts(null),
|
||||
$objProduct->getServiceProducts(true),
|
||||
function ($serviceProduct) {
|
||||
return Product::isSellableWithRoomType($serviceProduct['id_product']);
|
||||
}
|
||||
|
||||
@@ -525,7 +525,9 @@ class ServiceProductCartDetail extends ObjectModel
|
||||
$objHotelCartBooking->date_from,
|
||||
$objHotelCartBooking->date_to
|
||||
);
|
||||
$removedQuantity = $removedQuantity * $numDays;
|
||||
if ($numDays) {
|
||||
$removedQuantity = $removedQuantity * $numDays;
|
||||
}
|
||||
}
|
||||
|
||||
$objCart = new Cart($idCart);
|
||||
|
||||
Reference in New Issue
Block a user