Merge branch 'develop' into gli-1262
This commit is contained in:
@@ -380,6 +380,21 @@ class AdminAddressesControllerCore extends AdminController
|
||||
return parent::renderForm();
|
||||
}
|
||||
|
||||
public function processExport($text_delimiter = '"')
|
||||
{
|
||||
$this->fields_list = array_merge($this->fields_list, array(
|
||||
'email' => array('title' => $this->l('Customer Email')),
|
||||
'phone' => array('title' => $this->l('Phone')),
|
||||
'phone_mobile' => array('title' => $this->l('Mobile phone')),
|
||||
'address1' => array('title' => $this->l('Address (2)')),
|
||||
'dni' => array('title' => $this->l('Identification Number')),
|
||||
'vat_number' => array('title' => $this->l('VAT number')),
|
||||
'other' => array('title' => $this->l('Other')),
|
||||
));
|
||||
|
||||
return parent::processExport($text_delimiter);
|
||||
}
|
||||
|
||||
// public function postProcess()
|
||||
// {
|
||||
|
||||
|
||||
@@ -302,6 +302,31 @@ class AdminCartsControllerCore extends AdminController
|
||||
$product['image'] = (isset($image['id_image']) ? ImageManager::thumbnail(_PS_IMG_DIR_.'p/'.$image_product->getExistingImgPath().'.jpg', 'product_mini_'.(int)$product['id_product'].(isset($product['id_product_attribute']) ? '_'.(int)$product['id_product_attribute'] : '').'.jpg', 45, 'jpg') : '--');
|
||||
}
|
||||
|
||||
// by webkul to show rooms available in the cart
|
||||
$cartHtlData = array();
|
||||
$objHotelCartBookingData = new HotelCartBookingData();
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
if ($cartHtlData = $objHotelCartBookingData->getCartFormatedBookinInfoByIdCart((int) $cart->id)) {
|
||||
foreach ($cartHtlData as $key => $value) {
|
||||
$cartHtlData[$key]['room_type_info'] = $objHotelRoomType->getRoomTypeInfoByIdProduct($value['id_product']);
|
||||
if (isset($value['selected_services']) && $value['selected_services']) {
|
||||
foreach ($value['selected_services'] as $service) {
|
||||
if ($service['id_cart'] != $value['id_cart']) {
|
||||
if ($tax_calculation_method == PS_TAX_EXC) {
|
||||
$total_price += ($service['quantity'] * $service['total_price_tax_excl']);
|
||||
$total_products += ($service['quantity'] * $service['total_price_tax_excl']);
|
||||
} else {
|
||||
$total_price += ($service['quantity'] * $service['total_price_tax_incl']);
|
||||
$total_products += ($service['quantity'] * $service['total_price_tax_incl']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$cartHtlData = array();
|
||||
}
|
||||
|
||||
$helper = new HelperKpi();
|
||||
$helper->id = 'box-kpi-cart';
|
||||
$helper->icon = 'icon-shopping-cart';
|
||||
@@ -310,17 +335,6 @@ class AdminCartsControllerCore extends AdminController
|
||||
$helper->subtitle = sprintf($this->l('Cart #%06d', null, null, false), $cart->id);
|
||||
$helper->value = Tools::displayPrice($total_price, $currency);
|
||||
$kpi = $helper->generate();
|
||||
// by webkul to show rooms available in the cart
|
||||
$cartHtlData = array();
|
||||
$objHotelCartBookingData = new HotelCartBookingData();
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
if ($cartHtlData = $objHotelCartBookingData->getCartFormatedBookinInfoByIdCart((int) $cart->id)) {
|
||||
foreach ($cartHtlData as $key => $value) {
|
||||
$cartHtlData[$key]['room_type_info'] = $objHotelRoomType->getRoomTypeInfoByIdProduct($value['id_product']);
|
||||
}
|
||||
} else {
|
||||
$cartHtlData = array();
|
||||
}
|
||||
//end
|
||||
$this->tpl_view_vars = array(
|
||||
'cart_htl_data' => $cartHtlData,//by webkul hotel rooms in order data
|
||||
|
||||
@@ -97,13 +97,16 @@ class AdminCustomersControllerCore extends AdminController
|
||||
'order_key' => 'gl!name'
|
||||
),
|
||||
'firstname' => array(
|
||||
'title' => $this->l('First name')
|
||||
'title' => $this->l('First name'),
|
||||
'filter_key' => 'a!firstname'
|
||||
),
|
||||
'lastname' => array(
|
||||
'title' => $this->l('Last name')
|
||||
'title' => $this->l('Last name'),
|
||||
'filter_key' => 'a!lastname'
|
||||
),
|
||||
'email' => array(
|
||||
'title' => $this->l('Email address')
|
||||
'title' => $this->l('Email address'),
|
||||
'filter_key' => 'a!email'
|
||||
),
|
||||
);
|
||||
|
||||
@@ -143,6 +146,7 @@ class AdminCustomersControllerCore extends AdminController
|
||||
),
|
||||
'phone' => array(
|
||||
'title' => $this->l('Phone'),
|
||||
'filter_key' => 'a!phone',
|
||||
'optional' => true,
|
||||
'visible_default' => false,
|
||||
),
|
||||
@@ -152,7 +156,8 @@ class AdminCustomersControllerCore extends AdminController
|
||||
'active' => 'status',
|
||||
'type' => 'bool',
|
||||
'orderby' => false,
|
||||
'filter_key' => 'a!active'
|
||||
'filter_key' => 'a!active',
|
||||
'callback' => 'formatStatusAsLabel',
|
||||
),
|
||||
'newsletter' => array(
|
||||
'title' => $this->l('Newsletter'),
|
||||
@@ -184,6 +189,7 @@ class AdminCustomersControllerCore extends AdminController
|
||||
'title' => $this->l('Banned'),
|
||||
'type' => 'bool',
|
||||
'displayed' => false,
|
||||
'callback' => 'getCustomerStatusLabel',
|
||||
),
|
||||
'order_date' => array(
|
||||
'title' => $this->l('Order date'),
|
||||
@@ -235,6 +241,28 @@ class AdminCustomersControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public function formatStatusAsLabel($val, $row)
|
||||
{
|
||||
if ($val) {
|
||||
$str_return = $this->l('Yes');
|
||||
} else {
|
||||
$str_return = $this->l('No');
|
||||
}
|
||||
|
||||
return $str_return;
|
||||
}
|
||||
|
||||
public function getCustomerStatusLabel($deleted, $tr)
|
||||
{
|
||||
if ($deleted == Customer::STATUS_DELETED) {
|
||||
return $this->l('Deleted');
|
||||
} else if ($deleted == Customer::STATUS_BANNED) {
|
||||
return $this->l('Banned');
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
if ($this->action == 'select_delete') {
|
||||
@@ -268,8 +296,11 @@ class AdminCustomersControllerCore extends AdminController
|
||||
|
||||
public function getList($id_lang, $orderBy = null, $orderWay = null, $start = 0, $limit = null, $id_lang_shop = null)
|
||||
{
|
||||
parent::getList($id_lang, $orderBy, $orderWay, $start, $limit, $id_lang_shop);
|
||||
if ($this->action == 'export') {
|
||||
$this->deleted = false;
|
||||
}
|
||||
|
||||
parent::getList($id_lang, $orderBy, $orderWay, $start, $limit, $id_lang_shop);
|
||||
if ($this->_list) {
|
||||
foreach ($this->_list as &$row) {
|
||||
$row['badge_success'] = $row['total_spent'] > 0;
|
||||
@@ -1040,6 +1071,14 @@ class AdminCustomersControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public function processExport($text_delimiter = '"')
|
||||
{
|
||||
$this->fields_list['newsletter']['callback'] = 'formatStatusAsLabel';
|
||||
$this->fields_list['optin']['callback'] = 'formatStatusAsLabel';
|
||||
|
||||
return parent::processExport($text_delimiter);
|
||||
}
|
||||
|
||||
protected function processBulkDelete()
|
||||
{
|
||||
// If customer is going to be deleted permanently then if customer has orders the change this customer as an anonymous customer
|
||||
|
||||
@@ -148,8 +148,8 @@ class AdminImportControllerCore extends AdminController
|
||||
'policies' => array('label' => $this->l('Hotel Policies')),
|
||||
'active_refund' => array('label' => $this->l('Allow Refund (0 = No, 1 = Yes)')),
|
||||
'refund_ids' => array('label' => $this->l('Refund IDs (x,y,z...)')),
|
||||
'max_order_date' => array('label' => $this->l('Max Order Date')),
|
||||
'preparation_time' => array('label' => $this->l('Prepration Time')),
|
||||
'max_checkout_offset' => array('label' => $this->l('Maximum checkout offset')),
|
||||
'min_booking_offset' => array('label' => $this->l('Minimum booking offset')),
|
||||
'image' => array('label' => $this->l('Image URLs (x,y,z...)')),
|
||||
'delete_existing_images' => array(
|
||||
'label' => $this->l('Delete existing images (0 = No, 1 = Yes)')
|
||||
@@ -1410,19 +1410,23 @@ class AdminImportControllerCore extends AdminController
|
||||
}
|
||||
|
||||
$objHotelOrderRestrictDate->id_hotel = $objHotelBranch->id;
|
||||
$objHotelOrderRestrictDate->use_global_max_order_date = true;
|
||||
if (isset($info['max_order_date'])
|
||||
&& strtotime('now') < strtotime($info['max_order_date'])
|
||||
$objHotelOrderRestrictDate->use_global_max_checkout_offset = true;
|
||||
$objHotelOrderRestrictDate->use_global_min_booking_offset = true;
|
||||
|
||||
if (isset($info['max_checkout_offset'])
|
||||
&& (Configuration::get('PS_MIN_BOOKING_OFFSET') < $info['max_checkout_offset']
|
||||
|| isset($info['min_booking_offset']) && $info['min_booking_offset'] < $info['max_checkout_offset'])
|
||||
) {
|
||||
$objHotelOrderRestrictDate->use_global_max_order_date = false;
|
||||
$date = date('Y-m-d', strtotime($info['max_order_date']));
|
||||
$objHotelOrderRestrictDate->max_order_date = $date;
|
||||
$objHotelOrderRestrictDate->use_global_max_checkout_offset = false;
|
||||
$objHotelOrderRestrictDate->max_checkout_offset = $info['max_checkout_offset'];
|
||||
}
|
||||
|
||||
$objHotelOrderRestrictDate->use_global_preparation_time = true;
|
||||
if (isset($info['preparation_time']) && $info['preparation_time']) {
|
||||
$objHotelOrderRestrictDate->use_global_preparation_time = false;
|
||||
$objHotelOrderRestrictDate->preparation_time = $info['preparation_time'];
|
||||
if (isset($info['min_booking_offset'])
|
||||
&& (Configuration::get('PS_MAX_CHECKOUT_OFFSET') > $info['min_booking_offset']
|
||||
|| isset($info['max_checkout_offset']) && $info['max_checkout_offset'] > $info['min_booking_offset'])
|
||||
) {
|
||||
$objHotelOrderRestrictDate->use_global_min_booking_offset = false;
|
||||
$objHotelOrderRestrictDate->min_booking_offset = $info['min_booking_offset'];
|
||||
}
|
||||
|
||||
$objHotelOrderRestrictDate->save();
|
||||
|
||||
@@ -257,12 +257,14 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
'title' => $this->l('Available for order'),
|
||||
'filter_key' => 'a!available_for_order',
|
||||
'type' => 'bool',
|
||||
'callback' => 'formatStatusAsLabel',
|
||||
);
|
||||
$this->fields_list['price_addition_type'] = array(
|
||||
'displayed' => false,
|
||||
'title' => $this->l('Price display preference'),
|
||||
'filter_key' => 'a!price_addition_type',
|
||||
'type' => 'select',
|
||||
'callback' => 'getPriceDisplayPreference',
|
||||
'list' => $priceAdditionType,
|
||||
);
|
||||
$this->fields_list['price_calculation_method_txt'] = array(
|
||||
@@ -311,7 +313,8 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
'title' => $this->l('Base price'),
|
||||
'type' => 'price',
|
||||
'align' => 'text-left',
|
||||
'filter_key' => 'a!price'
|
||||
'filter_key' => 'a!price',
|
||||
'callback' => 'displayPrice',
|
||||
);
|
||||
$this->fields_list['price_final'] = array(
|
||||
'title' => $this->l('Final price'),
|
||||
@@ -319,7 +322,8 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
'align' => 'text-left',
|
||||
'havingFilter' => true,
|
||||
'orderby' => false,
|
||||
'search' => false
|
||||
'search' => false,
|
||||
'callback' => 'displayPrice',
|
||||
);
|
||||
|
||||
$this->fields_list['active'] = array(
|
||||
@@ -329,6 +333,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
'align' => 'text-center',
|
||||
'type' => 'bool',
|
||||
'class' => 'fixed-width-sm',
|
||||
'callback' => 'formatStatusAsLabel',
|
||||
'orderby' => false
|
||||
);
|
||||
|
||||
@@ -342,6 +347,34 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public function formatStatusAsLabel($val, $row)
|
||||
{
|
||||
if ($val) {
|
||||
$str_return = $this->l('Yes');
|
||||
} else {
|
||||
$str_return = $this->l('No');
|
||||
}
|
||||
|
||||
return $str_return;
|
||||
}
|
||||
|
||||
public function getPriceDisplayPreference($val, $row)
|
||||
{
|
||||
$str_return = $val;
|
||||
if ($val == Product::PRICE_ADDITION_TYPE_WITH_ROOM) {
|
||||
$str_return = $this->l('Add price in room price');
|
||||
} else if ($val == Product::PRICE_ADDITION_TYPE_INDEPENDENT) {
|
||||
$str_return = $this->l('Convenience Fee');
|
||||
}
|
||||
|
||||
return $str_return;
|
||||
}
|
||||
|
||||
public static function displayPrice($basePrice, $tr)
|
||||
{
|
||||
return Tools::displayPrice($basePrice, (int) Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
}
|
||||
|
||||
private function buildCategoryOptions($category)
|
||||
{
|
||||
$space = str_repeat(' ', 5 * (($category['level_depth'] - $this->objLocationsCategory->level_depth) - 1));
|
||||
|
||||
@@ -82,22 +82,19 @@ class AdminOrderPreferencesControllerCore extends AdminController
|
||||
)
|
||||
);
|
||||
|
||||
$maxOrderDate = Tools::getValue('MAX_GLOBAL_BOOKING_DATE', Configuration::get('MAX_GLOBAL_BOOKING_DATE'));
|
||||
$this->fields_options = array(
|
||||
'order_restrict' => array(
|
||||
'title' => $this->l('Order Restrict'),
|
||||
'icon' => 'icon-cogs',
|
||||
'fields' => array(
|
||||
'MAX_GLOBAL_BOOKING_DATE' => array(
|
||||
'title' => $this->l('Maximum Global Check-out Date to book a room'),
|
||||
'hint' => $this->l('Maximum date of check-out for which rooms of your hotels can be booked.'),
|
||||
'PS_MAX_CHECKOUT_OFFSET' => array(
|
||||
'title' => $this->l('Maximum checkout offset'),
|
||||
'hint' => $this->l('The maximum checkout offset defines how many days from today checkout is allowed. For example, if this value is set to 10 and someone is booking on March 1st, they can only select a checkout date up to March 11th.'),
|
||||
'type' => 'text',
|
||||
'id' => 'max_global_book_date',
|
||||
'auto_value' => false,
|
||||
'value' => date('d-m-Y', strtotime($maxOrderDate)),
|
||||
'class' => 'fixed-width-xxl readonly',
|
||||
'class' => 'fixed-width-xl',
|
||||
'suffix' => $this->l('day(s)'),
|
||||
),
|
||||
'GLOBAL_PREPARATION_TIME' => array(
|
||||
'PS_MIN_BOOKING_OFFSET' => array(
|
||||
'title' => $this->l('Minimum booking offset'),
|
||||
'hint' => $this->l('The minimum booking offset is the minimum number of days before the check-in date that a guest must book a room. For example, if you set this value to 3 and someone is booking on 2nd of March he can only book rooms for dates from and after 3 days, i.e, 5th of March.'),
|
||||
'desc' => $this->l('Set to 0 to disable this feature.'),
|
||||
@@ -332,24 +329,23 @@ class AdminOrderPreferencesControllerCore extends AdminController
|
||||
$this->errors[] = Tools::displayError('Please assign a valid CMS page for Terms and Conditions.');
|
||||
}
|
||||
|
||||
$_POST['MAX_GLOBAL_BOOKING_DATE'] = date('Y-m-d', strtotime(Tools::getValue('MAX_GLOBAL_BOOKING_DATE')));
|
||||
$maxGlobalBookingDate = Tools::getValue('MAX_GLOBAL_BOOKING_DATE');
|
||||
$globalPreparationTime = Tools::getValue('GLOBAL_PREPARATION_TIME');
|
||||
$maxGlobalBookingDateFormatted = date('Y-m-d', strtotime($maxGlobalBookingDate));
|
||||
|
||||
if ($maxGlobalBookingDate == '') {
|
||||
$this->errors[] = Tools::displayError('Field \'Maximum Global Check-out Date to book a room\' can not be empty.');
|
||||
} elseif (!Validate::isDate($maxGlobalBookingDateFormatted)) {
|
||||
$this->errors[] = Tools::displayError('Field \'Maximum Global Check-out Date to book a room\' is invalid.');
|
||||
} elseif (strtotime($maxGlobalBookingDateFormatted) < strtotime(date('Y-m-d'))) {
|
||||
$this->errors[] = Tools::displayError('Field \'Maximum Global Check-out Date to book a room\' can not be a past date. Please use a future date.');
|
||||
$maxCheckoutOffset = Tools::getValue('PS_MAX_CHECKOUT_OFFSET');
|
||||
$minBookingOffset = Tools::getValue('PS_MIN_BOOKING_OFFSET');
|
||||
if ($maxCheckoutOffset === '') {
|
||||
$this->errors[] = Tools::displayError('Field \'Maximum checkout offset\' can not be empty.');
|
||||
} elseif (!$maxCheckoutOffset || !Validate::isUnsignedInt($maxCheckoutOffset)) {
|
||||
$this->errors[] = Tools::displayError('Field \'Maximum checkout offset\' is invalid.');
|
||||
}
|
||||
|
||||
if ($globalPreparationTime === '') {
|
||||
if ($minBookingOffset === '') {
|
||||
$this->errors[] = Tools::displayError('Field \'Minimum booking offset\' can not be empty.');
|
||||
} elseif ($globalPreparationTime !== '0' && !Validate::isUnsignedInt($globalPreparationTime)) {
|
||||
} elseif ($minBookingOffset != 0 && !Validate::isUnsignedInt($minBookingOffset)) {
|
||||
$this->errors[] = Tools::displayError('Field \'Minimum booking offset\' is invalid.');
|
||||
}
|
||||
|
||||
if ($maxCheckoutOffset && $maxCheckoutOffset <= $minBookingOffset) {
|
||||
$this->errors[] = Tools::displayError('Field \'Maximum checkout offset\' cannot be be less than or equal to \'Minimum booking offset\'.');
|
||||
}
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
|
||||
@@ -79,8 +79,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = a.`current_state`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int) $this->context->language->id.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd ON (hbd.`id_order` = a.`id_order`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_branch_info_lang` hbil ON (hbil.`id` = hbd.`id_hotel`)';
|
||||
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_branch_info_lang` hbil ON (hbil.`id` = hbd.`id_hotel` AND osl.`id_lang` = hbil.`id_lang`)';
|
||||
|
||||
$this->_orderBy = 'id_order';
|
||||
$this->_orderWay = 'DESC';
|
||||
@@ -1194,6 +1193,127 @@ class AdminOrdersControllerCore extends AdminController
|
||||
return parent::renderList();
|
||||
}
|
||||
|
||||
public function getList(
|
||||
$id_lang,
|
||||
$order_by = null,
|
||||
$order_way = null,
|
||||
$start = 0,
|
||||
$limit = null,
|
||||
$id_lang_shop = false
|
||||
){
|
||||
if ($this->action == 'export' && empty($this->_listsql)) {
|
||||
$this->_select .= ', c.`email`, cgd.`phone`, a.`total_paid_real`,
|
||||
orf.`cancellation_date`, orf.`cancellation_fee`,
|
||||
cy.`iso_code` AS country, st.`iso_code` as state, ad.`city`,
|
||||
CONCAT(ad.`address1`, \', \', ad.`postcode`) AS `cus_address`, hbdtl.*';
|
||||
|
||||
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'cart_customer_guest_detail` cgd ON cgd.`email` = c.`email` AND cgd.`id_cart` = 0
|
||||
LEFT JOIN `'._DB_PREFIX_.'address` ad ON a.`id_customer`= ad.`id_customer` AND ad.`id_customer`!=0
|
||||
LEFT JOIN `'._DB_PREFIX_.'country` cy ON cy.`id_country`= ad.`id_country`
|
||||
LEFT JOIN `'._DB_PREFIX_.'state` st ON st.`id_state`= ad.`id_state`
|
||||
LEFT JOIN (
|
||||
SELECT ref.`id_order`, IF(refst.refunded = 1, GROUP_CONCAT(ref.`date_upd`), NULL) AS `cancellation_date`,
|
||||
IF(refst.refunded = 1, SUM(ref.`refunded_amount`), NULL) AS `cancellation_fee`
|
||||
FROM `'._DB_PREFIX_.'order_return` ref
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_return_state` refst
|
||||
ON refst.`id_order_return_state` = ref.`state` AND refst.`refunded` = 1
|
||||
GROUP BY ref.`id_order`
|
||||
) AS orf ON orf.`id_order` = a.`id_order`
|
||||
LEFT JOIN (
|
||||
SELECT GROUP_CONCAT(
|
||||
CASE
|
||||
WHEN `id_status`='.HotelBookingDetail::STATUS_ALLOTED.' THEN \''.$this->l('Alloted').'\'
|
||||
WHEN `id_status`='.HotelBookingDetail::STATUS_CHECKED_IN.' THEN \''.$this->l('Checked in').'\'
|
||||
WHEN `id_status`='.HotelBookingDetail::STATUS_CHECKED_OUT.' THEN \''.$this->l('Checked out').'\'
|
||||
ELSE \''.$this->l('Invalid status').'\'
|
||||
END
|
||||
) AS `room_status`, `id_order`,
|
||||
GROUP_CONCAT(DISTINCT(`room_type_name`)) AS `room_types`,
|
||||
GROUP_CONCAT(`date_from`) AS `date_from`,
|
||||
GROUP_CONCAT(`date_to`) AS `date_to`,
|
||||
GROUP_CONCAT(`room_num`) AS `rooms`,
|
||||
GROUP_CONCAT(`check_in`) AS `check_in_dates`,
|
||||
GROUP_CONCAT(`check_out`) AS `check_out_dates`
|
||||
FROM `'._DB_PREFIX_.'htl_booking_detail`
|
||||
GROUP BY `id_order`
|
||||
) AS hbdtl ON hbdtl.`id_order` = a.`id_order`';
|
||||
|
||||
$this->fields_list = array_merge($this->fields_list, array(
|
||||
'email' => array(
|
||||
'title' => $this->l('Email')
|
||||
),
|
||||
'phone' => array(
|
||||
'title' => $this->l('Phone')
|
||||
),
|
||||
'room_types' => array(
|
||||
'title' => $this->l('Room Types')
|
||||
),
|
||||
'rooms' => array(
|
||||
'title' => $this->l('Rooms')
|
||||
),
|
||||
'currency' => array(
|
||||
'title' => $this->l('Currency')
|
||||
),
|
||||
'total_paid_real' => array(
|
||||
'title' => $this->l('Amount Paid')
|
||||
),
|
||||
'check_in_dates' => array(
|
||||
'title' => $this->l('Check In')
|
||||
),
|
||||
'check_out_dates' => array(
|
||||
'title' => $this->l('Check Out')
|
||||
),
|
||||
'date_from' => array(
|
||||
'title' => $this->l('Date From'),
|
||||
'filter_key' => 'hbd!date_from',
|
||||
),
|
||||
'date_to' => array(
|
||||
'title' => $this->l('Date To'),
|
||||
'filter_key' => 'hbd!date_to',
|
||||
),
|
||||
'date_add' => array(
|
||||
'title' => $this->l('Reservation Date'),
|
||||
'filter_key' => 'a!date_add',
|
||||
),
|
||||
'room_status' => array(
|
||||
'title' => $this->l('Room Status'),
|
||||
),
|
||||
'country' => array(
|
||||
'title' => $this->l('Country'),
|
||||
),
|
||||
'state' => array(
|
||||
'title' => $this->l('State'),
|
||||
),
|
||||
'city' => array(
|
||||
'title' => $this->l('City'),
|
||||
),
|
||||
'cus_address' => array(
|
||||
'title' => $this->l('Address'),
|
||||
),
|
||||
'cancellation_date' => array(
|
||||
'title' => $this->l('Cancellation date'),
|
||||
),
|
||||
'cancellation_fee' => array(
|
||||
'title' => $this->l('Cancellation fee'),
|
||||
),
|
||||
));
|
||||
|
||||
unset($this->fields_list['id_status']);
|
||||
unset($this->fields_list['id_room_information']);
|
||||
unset($this->fields_list['room_type_name']);
|
||||
unset($this->fields_list['id_currency']);
|
||||
}
|
||||
|
||||
parent::getList(
|
||||
$id_lang,
|
||||
$order_by,
|
||||
$order_way,
|
||||
$start,
|
||||
$limit,
|
||||
$id_lang_shop
|
||||
);
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
// Process reallocation of rooms
|
||||
@@ -3508,7 +3628,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->content = json_encode($to_return);
|
||||
$this->ajaxDie(json_encode($to_return));
|
||||
}
|
||||
|
||||
// public function ajaxProcessSearchProducts()
|
||||
@@ -4581,11 +4701,19 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$objBookingDetail->children = $objCartBookingData->children;
|
||||
$objBookingDetail->child_ages = $objCartBookingData->child_ages;
|
||||
|
||||
$occupancy = array(
|
||||
array(
|
||||
'adults' => $objCartBookingData->adults,
|
||||
'children' => $objCartBookingData->children,
|
||||
'child_ages' => json_decode($objCartBookingData->child_ages)
|
||||
)
|
||||
);
|
||||
|
||||
$total_price = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
|
||||
$idProduct,
|
||||
$objCartBookingData->date_from,
|
||||
$objCartBookingData->date_to,
|
||||
0,
|
||||
$occupancy,
|
||||
Group::getCurrent()->id,
|
||||
$this->context->cart->id,
|
||||
$this->context->cookie->id_guest,
|
||||
@@ -5454,6 +5582,15 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$idHotelBooking
|
||||
);
|
||||
|
||||
//This is added to remove the services from the cart along with room deletion process.
|
||||
$objHotelCartBookingData = new HotelCartBookingData();
|
||||
$roomHtlCartInfo = $objHotelCartBookingData->getRoomRowByIdProductIdRoomInDateRange(
|
||||
$objBookingDetail->id_cart,
|
||||
$objBookingDetail->id_product,
|
||||
$objBookingDetail->date_from,
|
||||
$objBookingDetail->date_to,
|
||||
$objBookingDetail->id_room
|
||||
);
|
||||
|
||||
/*$totalProductPriceBeforeTE = $order_detail->total_price_tax_excl;
|
||||
$totalProductPriceBeforeTI = $order_detail->total_price_tax_incl;*/
|
||||
@@ -5488,6 +5625,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$res &= $order_detail->update();
|
||||
}
|
||||
// update order detail for selected aditional services
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
foreach ($selectedAdditonalServices['additional_services'] as $service) {
|
||||
$serviceOrderDetail = new OrderDetail($service['id_order_detail']);
|
||||
|
||||
@@ -5508,6 +5646,21 @@ class AdminOrdersControllerCore extends AdminController
|
||||
// Save order detail
|
||||
$res &= $serviceOrderDetail->update();
|
||||
}
|
||||
|
||||
if (isset($roomHtlCartInfo['id'])) {
|
||||
if ($idRoomTypServiceProductCartDetail = $objRoomTypeServiceProductCartDetail->alreadyExists(
|
||||
$service['id_product'],
|
||||
$service['id_cart'],
|
||||
$roomHtlCartInfo['id']
|
||||
)) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail((int) $idRoomTypServiceProductCartDetail);
|
||||
$serviceQuantity = $objRoomTypeServiceProductCartDetail->quantity;
|
||||
if ($objRoomTypeServiceProductCartDetail->delete()) {
|
||||
$objCart = new Cart($service['id_cart']);
|
||||
$objCart->updateQty((int)abs($serviceQuantity), $service['id_product'], null, false, 'down');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*End*/
|
||||
|
||||
@@ -5586,7 +5739,9 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$objBookingDetail->id_product,
|
||||
$objBookingDetail->id_room,
|
||||
$objBookingDetail->date_from,
|
||||
$objBookingDetail->date_to
|
||||
$objBookingDetail->date_to,
|
||||
1,
|
||||
$objBookingDetail->id_order
|
||||
);
|
||||
|
||||
$objBookingDetail->delete();
|
||||
@@ -5790,8 +5945,8 @@ class AdminOrdersControllerCore extends AdminController
|
||||
// If order is refunded, the validate changes which are not allowed
|
||||
$objOrderReturn = new OrderReturn();
|
||||
$refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($order->id, 0, 1);
|
||||
$objBookingDetail = new HotelBookingDetail($id_hotel_booking);
|
||||
if ($refundReqBookings && (in_array($id_hotel_booking, $refundReqBookings))) {
|
||||
$objBookingDetail = new HotelBookingDetail($id_hotel_booking);
|
||||
// If order is cancelled, we can't edit order
|
||||
if ($objBookingDetail->is_refunded && $objBookingDetail->is_cancelled) {
|
||||
die(json_encode(array(
|
||||
@@ -5809,6 +5964,22 @@ class AdminOrdersControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
if ($objBookingDetail->id_status != HotelBookingDetail::STATUS_ALLOTED
|
||||
&& strtotime($old_date_from) != strtotime($new_date_from)
|
||||
) {
|
||||
die(json_encode(array(
|
||||
'result' => false,
|
||||
'error' => Tools::displayError('You cannot update the start date for a booking that has already been checked in.'),
|
||||
)));
|
||||
} else if ($objBookingDetail->id_status == HotelBookingDetail::STATUS_CHECKED_OUT
|
||||
&& strtotime($old_date_to) != strtotime($new_date_to)
|
||||
) {
|
||||
die(json_encode(array(
|
||||
'result' => false,
|
||||
'error' => Tools::displayError('You cannot update the end date for a booking that has already been checked out.'),
|
||||
)));
|
||||
}
|
||||
|
||||
if (!Validate::isPrice($product_price_tax_incl) || !Validate::isPrice($product_price_tax_excl)) {
|
||||
die(json_encode(array(
|
||||
'result' => false,
|
||||
@@ -6148,24 +6319,17 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$del_id = Tools::getValue('del_id');
|
||||
$room_id = Tools::getValue('id_room');
|
||||
$obj_hotel_cart_detail = new HotelCartBookingData();
|
||||
$deleted = $obj_hotel_cart_detail->deleteCartBookingData($cart_id, $id_product, $room_id, $dt_frm, $dt_to);
|
||||
if ($deleted) {
|
||||
if ($obj_hotel_cart_detail->deleteCartBookingData($cart_id, $id_product, $room_id, $dt_frm, $dt_to)) {
|
||||
$obj_product_process = new HotelCartBookingData();
|
||||
$num_cart_rooms = 0;
|
||||
$dt_to = date('Y-m-d H:i:s', strtotime($dt_to) - _TIME_1_DAY_);
|
||||
HotelRoomTypeFeaturePricing::deleteFeaturePrices($cart_id, $id_product, $room_id, $dt_frm, $dt_to);
|
||||
if ($rooms = $obj_hotel_cart_detail->getCartCurrentDataByCartId($cart_id)) {
|
||||
$num_cart_rooms = count($rooms);
|
||||
}
|
||||
|
||||
$numDays = HotelHelper::getNumberOfDays($dt_frm, $dt_to);
|
||||
$dt_to = date('Y-m-d H:i:s', strtotime($dt_to) - _TIME_1_DAY_);
|
||||
HotelRoomTypeFeaturePricing::deleteFeaturePrices($cart_id, $id_product, $room_id, $dt_frm, $dt_to);
|
||||
$changed = $obj_product_process->changeProductDataByRoomId($room_id, $id_product, $numDays, $cart_id);
|
||||
if ($changed) {
|
||||
$result['status'] = 'deleted';
|
||||
$result['cart_rooms'] = $num_cart_rooms;
|
||||
} else {
|
||||
$result['status'] = 'failed';
|
||||
}
|
||||
$result['status'] = 'deleted';
|
||||
$result['cart_rooms'] = $num_cart_rooms;
|
||||
} else {
|
||||
$result['status'] = 'failed';
|
||||
}
|
||||
@@ -6506,8 +6670,31 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$quantity = $objRoomTypeServiceProductOrderDetail->quantity;
|
||||
$res = true;
|
||||
$objHotelBookingDetail = new HotelBookingDetail($objRoomTypeServiceProductOrderDetail->id_htl_booking_detail);
|
||||
$idServiceProduct = $objRoomTypeServiceProductOrderDetail->id_product;
|
||||
$objHotelCartBookingData = new HotelCartBookingData();
|
||||
$roomHtlCartInfo = $objHotelCartBookingData->getRoomRowByIdProductIdRoomInDateRange(
|
||||
$objHotelBookingDetail->id_cart,
|
||||
$objHotelBookingDetail->id_product,
|
||||
$objHotelBookingDetail->date_from,
|
||||
$objHotelBookingDetail->date_to,
|
||||
$objHotelBookingDetail->id_room
|
||||
);
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
|
||||
if ($res &= $objRoomTypeServiceProductOrderDetail->delete()) {
|
||||
if (isset($roomHtlCartInfo['id'])) {
|
||||
if ($idRoomTypServiceProductCartDetail = $objRoomTypeServiceProductCartDetail->alreadyExists(
|
||||
$idServiceProduct,
|
||||
$objRoomTypeServiceProductOrderDetail->id_cart,
|
||||
$roomHtlCartInfo['id']
|
||||
)) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail($idRoomTypServiceProductCartDetail);
|
||||
if ($objRoomTypeServiceProductCartDetail->delete()) {
|
||||
$objCart = new Cart($objRoomTypeServiceProductOrderDetail->id_cart);
|
||||
$objCart->updateQty((int)abs($quantity), $objRoomTypeServiceProductOrderDetail->id_product, null, false, 'down');
|
||||
}
|
||||
}
|
||||
}
|
||||
$order = new Order($objRoomTypeServiceProductOrderDetail->id_order);
|
||||
if ($quantity >= $objOrderDetail->product_quantity) {
|
||||
$objOrderDetail->delete();
|
||||
@@ -6705,12 +6892,12 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$unitPriceTaxExcl = 0;
|
||||
foreach ($productList as &$product) {
|
||||
// This is used to get the actual quanity of the service as it is calculated incorrectly if the service is per night
|
||||
if ($id_room_type_service_product_cart_detail = $objRoomTypeServiceProductCartDetail->alreadyExists(
|
||||
if ($idRoomTypServiceProductCartDetail = $objRoomTypeServiceProductCartDetail->alreadyExists(
|
||||
$service['id'],
|
||||
$cart->id,
|
||||
$roomHtlCartInfo['id'])
|
||||
) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail((int) $id_room_type_service_product_cart_detail);
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail((int) $idRoomTypServiceProductCartDetail);
|
||||
|
||||
$unitPriceTaxExcl = $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
@@ -7131,6 +7318,17 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$this->errors[] = Tools::displayError('Date should be between booking from date and to date.');
|
||||
}
|
||||
}
|
||||
|
||||
if ($objHotelBookingDetail->id_status == HotelBookingDetail::STATUS_CHECKED_OUT
|
||||
&& (date('Y-m-d', strtotime($objHotelBookingDetail->check_out)) != date('Y-m-d', strtotime($objHotelBookingDetail->date_to)))
|
||||
&& ($booking = $objHotelBookingDetail->chechRoomBooked($objHotelBookingDetail->id_room, $objHotelBookingDetail->check_out, $objHotelBookingDetail->date_to))
|
||||
) {
|
||||
if ($booking['id_status'] != HotelBookingDetail::STATUS_CHECKED_OUT
|
||||
|| date('Y-m-d', strtotime($booking['check_out'])) > date('Y-m-d', strtotime($objHotelBookingDetail->date_from))
|
||||
) {
|
||||
$this->errors[] = Tools::displayError('You cannot update this room\'s booking status as a new booking has been created for this room. Please change the room to update the status.');
|
||||
}
|
||||
}
|
||||
if ($newStatus == HotelBookingDetail::STATUS_CHECKED_OUT) {
|
||||
if ($objHotelBookingDetail->check_in == '0000-00-00 00:00:00') {
|
||||
$this->errors[] = Tools::displayError('Room status must be set to Check-In before setting the room status to Check-Out.');
|
||||
@@ -7196,6 +7394,13 @@ class AdminOrdersControllerCore extends AdminController
|
||||
// set context currency So that we can get prices in the order currency
|
||||
$objOrder = new Order($objHotelBooking->id_order);
|
||||
$this->context->currency = new Currency($objOrder->id_currency);
|
||||
$occupancy = array(
|
||||
array(
|
||||
'adults' => $objHotelBooking->adults,
|
||||
'children' => $objHotelBooking->children,
|
||||
'child_ages' => json_decode($objHotelBooking->child_ages)
|
||||
)
|
||||
);
|
||||
$newRoomTotalPrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
|
||||
$idNewRoomType,
|
||||
$objHotelBooking->date_from,
|
||||
|
||||
@@ -201,7 +201,13 @@ class AdminProductsControllerCore extends AdminController
|
||||
LEFT JOIN `'._DB_PREFIX_.'address` aa ON (aa.`id_hotel` = hb.`id`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'feature_product` fp ON (fp.`id_product` = a.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_demand` hrtd ON (hrtd.`id_product` = a.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product` hrtsp ON ((hrtsp.`element_type` = '.(int) RoomTypeServiceProduct::WK_ELEMENT_TYPE_HOTEL.' AND hrtsp.`id_element` = hrt.`id_hotel`) OR (hrtsp.`element_type` = '.(int) RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE.' AND hrtsp.`id_element` = a.`id_product`))
|
||||
LEFT JOIN (
|
||||
SELECT rsp.*, GROUP_CONCAT(pl.`name`) AS service_products
|
||||
FROM `'._DB_PREFIX_.'htl_room_type_service_product` rsp
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = rsp.`id_product`)
|
||||
WHERE pl.`id_lang`='.$this->context->language->id.'
|
||||
GROUP BY rsp.`id_element`)
|
||||
AS hrtsp ON ((hrtsp.`element_type` = '.(int) RoomTypeServiceProduct::WK_ELEMENT_TYPE_HOTEL.' AND hrtsp.`id_element` = hrt.`id_hotel`) OR (hrtsp.`element_type` = '.(int) RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE.' AND hrtsp.`id_element` = a.`id_product`))
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_advance_payment` hap ON (hap.`id_product` = a.`id_product`)';
|
||||
|
||||
$this->_select .= ' a.`show_at_front`, (SELECT COUNT(hri.`id`) FROM `'._DB_PREFIX_.'htl_room_information` hri WHERE hri.`id_product` = a.`id_product`) as num_rooms, ';
|
||||
@@ -213,7 +219,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
|
||||
if ($join_category) {
|
||||
$this->_join .= ' INNER JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = a.`id_product` AND cp.`id_category` = '.(int)$this->_category->id.') ';
|
||||
$this->_select .= ' , cp.`position`, ';
|
||||
$this->_select .= ' , cp.`position` ';
|
||||
}
|
||||
|
||||
// show the list of the product according to the booking or service products
|
||||
@@ -277,6 +283,13 @@ class AdminProductsControllerCore extends AdminController
|
||||
'type' => 'range',
|
||||
'align' => 'center',
|
||||
);
|
||||
$this->fields_list['max_guests'] = array(
|
||||
'title' => $this->l('Maximum Occupancy'),
|
||||
'filter_key' => 'hrt!max_guests',
|
||||
'type' => 'range',
|
||||
'align' => 'center',
|
||||
'optional' => true,
|
||||
);
|
||||
// use it for total rooms
|
||||
$this->fields_list['num_rooms'] = array(
|
||||
'title' => $this->l('Total Rooms'),
|
||||
@@ -290,7 +303,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
'validation' => 'isFloat',
|
||||
'align' => 'text-left',
|
||||
'filter_key' => 'a!price',
|
||||
'callback' => 'displayBasePrice',
|
||||
'callback' => 'displayPrice',
|
||||
);
|
||||
$this->fields_list['price_final'] = array(
|
||||
'title' => $this->l('Final price'),
|
||||
@@ -298,7 +311,8 @@ class AdminProductsControllerCore extends AdminController
|
||||
'align' => 'text-left',
|
||||
'havingFilter' => true,
|
||||
'orderby' => false,
|
||||
'search' => false
|
||||
'search' => false,
|
||||
'callback' => 'displayPrice',
|
||||
);
|
||||
|
||||
$this->fields_list['active'] = array(
|
||||
@@ -307,25 +321,18 @@ class AdminProductsControllerCore extends AdminController
|
||||
'filter_key' => $alias.'!active',
|
||||
'align' => 'text-center',
|
||||
'type' => 'select',
|
||||
'callback' => 'formatStatusAsLabel',
|
||||
'list' => array(1 => $this->l('Yes'), 0 => $this->l('No')),
|
||||
'optional' => true,
|
||||
'visible_default' => true,
|
||||
'orderby' => false
|
||||
);
|
||||
|
||||
$this->fields_list['max_guests'] = array(
|
||||
'title' => $this->l('Maximum Occupancy'),
|
||||
'filter_key' => 'hrt!max_guests',
|
||||
'type' => 'range',
|
||||
'align' => 'center',
|
||||
'optional' => true,
|
||||
);
|
||||
|
||||
$this->fields_list['show_at_front'] = array(
|
||||
'title' => $this->l('Show at front'),
|
||||
'align' => 'text-center',
|
||||
'type' => 'bool',
|
||||
'active' => 'show_at_front',
|
||||
'callback' => 'formatStatusAsLabel',
|
||||
'optional' => true,
|
||||
'havingFilter' => true,
|
||||
'visible_default' => true,
|
||||
@@ -335,7 +342,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
if (Configuration::get('WK_ALLOW_ADVANCED_PAYMENT')) {
|
||||
$this->fields_list['advance_payment'] = array(
|
||||
'title' => $this->l('Advance Payment'),
|
||||
'callback' => 'getAdvancePaymentStatus',
|
||||
'callback' => 'formatStatusAsLabel',
|
||||
'badge_success' => true,
|
||||
'badge_danger' => true,
|
||||
'align' => 'text-center',
|
||||
@@ -446,7 +453,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public function getAdvancePaymentStatus($val, $row)
|
||||
public function formatStatusAsLabel($val, $row)
|
||||
{
|
||||
if ($val) {
|
||||
$str_return = $this->l('Yes');
|
||||
@@ -457,7 +464,6 @@ class AdminProductsControllerCore extends AdminController
|
||||
return $str_return;
|
||||
}
|
||||
|
||||
|
||||
private function buildCategoryOptions($category)
|
||||
{
|
||||
$space = str_repeat(' ', 5 * (($category['level_depth'] - $this->objLocationsCategory->level_depth) - 1));
|
||||
@@ -470,7 +476,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public static function displayBasePrice($basePrice, $tr)
|
||||
public static function displayPrice($basePrice, $tr)
|
||||
{
|
||||
return Tools::displayPrice($basePrice, (int) Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
}
|
||||
@@ -629,6 +635,48 @@ class AdminProductsControllerCore extends AdminController
|
||||
$orderBy = 'id_'.$this->table;
|
||||
$orderWay = 'ASC';
|
||||
}
|
||||
if ($this->action == 'export' && empty($this->_listsql)) {
|
||||
$this->_select .= ' , trg.`name` AS `id_tax_rules_group`, `features`, hrtdl.`global_demands`';
|
||||
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'tax_rules_group` trg
|
||||
ON trg.`id_tax_rules_group` = a.`id_tax_rules_group`
|
||||
LEFT JOIN (SELECT GROUP_CONCAT(fpl.`name`) AS features, fp.`id_product`
|
||||
FROM `'._DB_PREFIX_.'feature_lang` fpl
|
||||
LEFT JOIN `'._DB_PREFIX_.'feature_product` fp
|
||||
ON (fp.`id_feature` = fpl.`id_feature`)
|
||||
WHERE fpl.`id_lang`='.(int) $this->context->language->id.'
|
||||
GROUP BY fp.`id_product`
|
||||
) AS fpl ON (a.`id_product` = fpl.`id_product`)';
|
||||
|
||||
$this->_join .= ' LEFT JOIN (SELECT hrtgd.`id_product`, `id_lang`, GROUP_CONCAT(`name`) AS `global_demands`
|
||||
FROM `'._DB_PREFIX_.'htl_room_type_global_demand_lang` hrtgdl
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_demand` hrtgd
|
||||
ON hrtgd.`id_global_demand` = hrtgdl.`id_global_demand`
|
||||
WHERE `id_lang`='.(int) $this->context->language->id.'
|
||||
GROUP BY hrtgd.`id_product`
|
||||
) AS hrtdl ON (hrtdl.`id_product` = a.`id_product`)';
|
||||
|
||||
$this->fields_list = array_merge($this->fields_list, array(
|
||||
'id_tax_rules_group' => array(
|
||||
'title' => $this->l('Id Tax Rules group'),
|
||||
'filter_key' => 'a!id_tax_rules_group',
|
||||
),
|
||||
'features' => array(
|
||||
'title' => $this->l('Features'),
|
||||
),
|
||||
'service_products' => array(
|
||||
'title' => $this->l('Services Products'),
|
||||
),
|
||||
'global_demands' => array(
|
||||
'title' => $this->l('Additional Facilities'),
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
unset($this->fields_list['id_category_default']);
|
||||
unset($this->fields_list['id_global_demand']);
|
||||
unset($this->fields_list['id_feature']);
|
||||
unset($this->fields_list['id_service_product']);
|
||||
}
|
||||
parent::getList($id_lang, $orderBy, $orderWay, $start, $limit, $this->context->shop->id);
|
||||
|
||||
/* update product quantity with attributes ...*/
|
||||
|
||||
Reference in New Issue
Block a user