Merge branch 'develop' into gli-2856
This commit is contained in:
@@ -60,7 +60,7 @@
|
||||
<li>
|
||||
<a id="desc-module-back" class="toolbar_btn" href="javascript: window.history.back();" title="{l s='Back'}">
|
||||
<i class="process-icon-back"></i>
|
||||
<div>{l s='Back'}</div>
|
||||
<span>{l s='Back'}</span>
|
||||
</a>
|
||||
</li>
|
||||
<!-- <li>
|
||||
@@ -85,7 +85,7 @@
|
||||
<li>
|
||||
<a id="desc-module-translate" data-toggle="modal" data-target="#moduleTradLangSelect" class="toolbar_btn" href="#" title="{l s='Translate'}">
|
||||
<i class="process-icon-flag"></i>
|
||||
<div>{l s='Translate'}</div>
|
||||
<span>{l s='Translate'}</span>
|
||||
</a>
|
||||
</li>
|
||||
{/if}
|
||||
@@ -100,7 +100,7 @@
|
||||
<li>
|
||||
<a id="desc-module-hook" class="toolbar_btn" href="{$module_hook_link}" title="{l s='Manage hooks'}">
|
||||
<i class="process-icon-anchor"></i>
|
||||
<div>{l s='Manage hooks'}</div>
|
||||
<span>{l s='Manage hooks'}</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -638,7 +638,7 @@
|
||||
html += '</select>';
|
||||
html += '</td>';
|
||||
html += '<td class="col-sm-3 center">';
|
||||
html += '<input class="form-control" type="text" name="'+prefix+'[floor]">';
|
||||
html += '<input class="form-control" type="text" name="'+prefix+'[comment]">';
|
||||
html += '</td>';
|
||||
html += '<td class="center col-sm-2">';
|
||||
html += '<a class="btn btn-default deactiveDatesModal disabled" data-toggle="modal" data-target="#deactiveDatesModal">';
|
||||
|
||||
@@ -137,12 +137,16 @@
|
||||
{l s='Select Hotel'}
|
||||
</label>
|
||||
<div class="col-sm-5">
|
||||
{if isset($htl_info) && $htl_info}
|
||||
<select name="id_hotel" id="hotel_place" class="form-control chosen">
|
||||
{foreach from=$htl_info item=htl_dtl}
|
||||
<option value="{$htl_dtl['id']}" >{$htl_dtl['hotel_name']}</option>
|
||||
<option value="{$htl_dtl['id_hotel']}" >{$htl_dtl['hotel_name']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<p class="help-block">{l s='Hotel once assigned cannot be reassigned'}</p>
|
||||
{else}
|
||||
<div class="control-label col-sm-3 text-danger">{l s='No hotel are available'}</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
{if $action.type == 'link'}
|
||||
<a href="{$action.href}" class="btn {$action.class}">{$action.label}</a>
|
||||
{elseif $action.type == 'button'}
|
||||
<button type="button" value="{$action.value}" class="btn {$action.class}">
|
||||
<button type="button" value="{$action.value|default:''}" class="btn {$action.class}">
|
||||
{$action.label}
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
@@ -67,5 +67,6 @@ class SearchEngineCore extends ObjectModel
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -875,9 +875,13 @@ class AdminControllerCore extends Controller
|
||||
$prefix = $this->getCookieFilterPrefix();
|
||||
$filters = array();
|
||||
if (isset($this->list_id)) {
|
||||
$postPrefixPattern = '#^('.
|
||||
$this->list_id.'Filter_|'.
|
||||
'submitFilter'.
|
||||
')#i';
|
||||
foreach ($_POST as $key => $value) {
|
||||
// only process the filter fields.
|
||||
if (stripos($key, $this->list_id.'Filter_') !== 0) {
|
||||
if (!preg_match($postPrefixPattern, $key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -898,9 +902,15 @@ class AdminControllerCore extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
$getPrefixPattern = '#^(' .
|
||||
'submitFilter|'.
|
||||
$this->list_id.'Filter_|'.
|
||||
$this->list_id.'Orderby|'.
|
||||
$this->list_id.'Orderway'.
|
||||
')#i';
|
||||
foreach ($_GET as $key => $value) {
|
||||
// only process the filter fields.
|
||||
if (stripos($key, $this->list_id.'Filter_') !== 0) {
|
||||
// only process the filter and order by, order way fields.
|
||||
if (!preg_match($getPrefixPattern, $key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -3019,7 +3019,7 @@ abstract class ModuleCore
|
||||
),
|
||||
array(
|
||||
' ',
|
||||
'class '.$overrideClassName.'OverrideOriginal'.$uniq
|
||||
'class '.$overrideClassName.'OverrideOriginal'.$uniq.' extends \stdClass'
|
||||
),
|
||||
implode('', $overrideClassFileArray)
|
||||
)
|
||||
@@ -3037,7 +3037,7 @@ abstract class ModuleCore
|
||||
),
|
||||
array(
|
||||
' ',
|
||||
'class '.$overrideClassName.'Override'.$uniq
|
||||
'class '.$overrideClassName.'Override'.$uniq.' extends \stdClass'
|
||||
),
|
||||
implode('', $moduleClassFileArray)
|
||||
)
|
||||
@@ -3084,7 +3084,7 @@ abstract class ModuleCore
|
||||
),
|
||||
array(
|
||||
' ',
|
||||
'class '.$overrideClassName.'Override'.$uniq
|
||||
'class '.$overrideClassName.'Override'.$uniq.' extends \stdClass'
|
||||
),
|
||||
implode('', $moduleClassFileArray)
|
||||
)
|
||||
@@ -3213,7 +3213,7 @@ abstract class ModuleCore
|
||||
),
|
||||
array(
|
||||
' ',
|
||||
'class '.$overrideClassName.'Original_remove'.$uniq
|
||||
'class '.$overrideClassName.'Original_remove'.$uniq.' extends \stdClass'
|
||||
),
|
||||
implode('', $overrideClassFileArray)
|
||||
)
|
||||
@@ -3230,7 +3230,7 @@ abstract class ModuleCore
|
||||
),
|
||||
array(
|
||||
' ',
|
||||
'class '.$overrideClassName.'Override_remove'.$uniq
|
||||
'class '.$overrideClassName.'Override_remove'.$uniq.' extends \stdClass'
|
||||
),
|
||||
implode('', $moduleClassFileArray)
|
||||
)
|
||||
|
||||
@@ -28,6 +28,9 @@ abstract class ModuleGraphCore extends Module
|
||||
{
|
||||
protected $_employee;
|
||||
|
||||
/** @var string CSV data */
|
||||
protected $_csv;
|
||||
|
||||
/** @var array of integers graph data */
|
||||
protected $_values = array();
|
||||
|
||||
|
||||
@@ -159,12 +159,13 @@ abstract class ModuleGridCore extends Module
|
||||
$this->setLang($context->language->id);
|
||||
$this->setEmployee($context->employee->id);
|
||||
|
||||
$layers = isset($datas['layers']) ? $datas['layers'] : 1;
|
||||
|
||||
if (isset($datas['option'])) {
|
||||
$this->setOption($datas['option'], $layers);
|
||||
}
|
||||
$this->getData();
|
||||
|
||||
$layers = isset($datas['layers']) ? $datas['layers'] : 1;
|
||||
|
||||
if (count($datas['columns'])) {
|
||||
foreach ($datas['columns'] as $column) {
|
||||
|
||||
@@ -277,7 +277,7 @@ class OrderSlipCore extends ObjectModel
|
||||
FROM `'._DB_PREFIX_.'order_slip` os
|
||||
LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = os.`id_order`)
|
||||
WHERE os.`date_add` BETWEEN \''.pSQL($dateFrom).' 00:00:00\' AND \''.pSQL($dateTo).' 23:59:59\'
|
||||
'.Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o').'
|
||||
'.Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o'). ' ' .HotelBranchInformation::addHotelRestriction(false).'
|
||||
ORDER BY os.`date_add` ASC');
|
||||
|
||||
$slips = array();
|
||||
|
||||
@@ -1262,6 +1262,13 @@ class AdminModulesControllerCore extends AdminController
|
||||
if (Configuration::get('PS_SHOW_CAT_MODULES_'.(int)$this->id_employee)) {
|
||||
$filter_categories = explode('|', Configuration::get('PS_SHOW_CAT_MODULES_'.(int)$this->id_employee));
|
||||
}
|
||||
if (count($filter_categories) > 0) {
|
||||
foreach ($filter_categories as $fc) {
|
||||
if (!empty($fc)) {
|
||||
$category_filtered[$fc] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (count($category_filtered) > 0 && !isset($category_filtered[$module->tab])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2605,6 +2605,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
->setSelectedCategories(array((int)$id_category));
|
||||
$this->tpl_list_vars['category_tree'] = $tree->render();
|
||||
|
||||
$this->context->smarty->assign('token', $this->token);// as tree updates the token from the smarty context
|
||||
// used to build the new url when changing category
|
||||
$this->tpl_list_vars['base_url'] = preg_replace('#&id_category=[0-9]*#', '', self::$currentIndex).'&token='.$this->token;
|
||||
}
|
||||
@@ -4513,7 +4514,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
if ($this->tabAccess['edit'] === 1) {
|
||||
$way = (int)(Tools::getValue('way'));
|
||||
$id_product = (int)Tools::getValue('id_product');
|
||||
$id_category = (int)Tools::getValue('id_category');
|
||||
$id_category = (int)Tools::getValue('id_category_hotel');
|
||||
$positions = Tools::getValue('product');
|
||||
$page = (int)Tools::getValue('page');
|
||||
$selected_pagination = (int)Tools::getValue('selected_pagination');
|
||||
@@ -4521,14 +4522,13 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
if (is_array($positions)) {
|
||||
foreach ($positions as $position => $value) {
|
||||
$pos = explode('_', $value);
|
||||
|
||||
if ((isset($pos[1]) && isset($pos[2])) && ($pos[1] == $id_category && (int)$pos[2] === $id_product)) {
|
||||
if ($page > 1) {
|
||||
$position = $position + (($page - 1) * $selected_pagination);
|
||||
}
|
||||
|
||||
if ($product = new Product((int)$pos[2])) {
|
||||
if (isset($position) && $product->updatePosition($way, $position)) {
|
||||
if (isset($position) && $product->updatePosition($way, $position, $id_category)) {
|
||||
$category = new Category((int)$id_category);
|
||||
if (Validate::isLoadedObject($category)) {
|
||||
hook::Exec('categoryUpdate', array('category' => $category));
|
||||
|
||||
@@ -3064,7 +3064,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
if ($obj->id) {
|
||||
if ($this->product_exists_in_shop) {
|
||||
$objHotelInfo = new HotelBranchInformation();
|
||||
$hotelInfo = $objHotelInfo->hotelsNameAndId();
|
||||
$hotelInfo = HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1);
|
||||
if ($hotelInfo) {
|
||||
$objRoomInfo = new HotelRoomInformation();
|
||||
$roomStatus = $objRoomInfo->getAllRoomStatus();
|
||||
@@ -3111,7 +3111,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
$this->displayWarning($this->l('You must save the room type in this shop before managing hotel configuration.'));
|
||||
}
|
||||
} else {
|
||||
$this->displayWarning($this->l('You must save this room type before managing hotel configuration.'));
|
||||
$this->displayWarning($this->l('You must save this room type before managing rooms.'));
|
||||
}
|
||||
|
||||
$this->tpl_form_vars['custom_form'] = $data->fetch();
|
||||
@@ -4527,7 +4527,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
|
||||
$objRoomType = new HotelRoomType();
|
||||
$objHotelInfo = new HotelBranchInformation();
|
||||
$data->assign('htl_info', $objHotelInfo->hotelsNameAndId());
|
||||
$data->assign('htl_info', HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1));
|
||||
if ($hotelRoomType = $objRoomType->getRoomTypeInfoByIdProduct($product->id)) {
|
||||
$data->assign('htl_room_type', $hotelRoomType);
|
||||
$hotelFullInfo = $objHotelInfo->hotelBranchInfoById($hotelRoomType['id_hotel']);
|
||||
|
||||
@@ -38,6 +38,8 @@ class AdminSlipControllerCore extends AdminController
|
||||
|
||||
$this->_select = ' o.`id_shop`';
|
||||
$this->_join .= ' LEFT JOIN '._DB_PREFIX_.'orders o ON (o.`id_order` = a.`id_order`)';
|
||||
$this->_join .= ' INNER JOIN '._DB_PREFIX_.'htl_booking_detail hbd
|
||||
ON (a.`id_order` = hbd.`id_order`) ' . HotelBranchInformation::addHotelRestriction(false, 'hbd');
|
||||
$this->_group = ' GROUP BY a.`id_order_slip`';
|
||||
|
||||
$this->addRowAction('statusChange');
|
||||
|
||||
@@ -1361,8 +1361,8 @@ class AdminThemesControllerCore extends AdminController
|
||||
$fields_value['theme_name'] = $theme->name;
|
||||
$fields_value['theme_directory'] = $theme->directory;
|
||||
$fields_value['theme_version'] = '1.0';
|
||||
$fields_value['compa_from'] = _PS_VERSION_;
|
||||
$fields_value['compa_to'] = _PS_VERSION_;
|
||||
$fields_value['compa_from'] = _QLOAPPS_VERSION_;
|
||||
$fields_value['compa_to'] = _QLOAPPS_VERSION_;
|
||||
$fields_value['id_theme_export'] = Tools::getValue('id_theme_export');
|
||||
$fields_value['documentationName'] = $this->l('documentation');
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
<tr>
|
||||
<th>{l s="Room Image"}</th>
|
||||
<th>{l s="Room Description"}</th>
|
||||
<th>{l s="Hotel"}</th>
|
||||
<th>{l s="Room Capcity"}</th>
|
||||
<th>{l s="Unit Price"}</th>
|
||||
<th>{l s="Rooms Qty"}</th>
|
||||
@@ -25,9 +24,6 @@
|
||||
<td >
|
||||
{$data_v['name']}
|
||||
</td>
|
||||
<td >
|
||||
{$data_v['hotel_name']}
|
||||
</td>
|
||||
<td >
|
||||
{$rm_v['adults']} {l s='Adults'}, {$rm_v['children']} {l s='Children'}
|
||||
</td>
|
||||
|
||||
@@ -730,50 +730,56 @@ class HotelBranchInformation extends ObjectModel
|
||||
$catName,
|
||||
$parent_category
|
||||
)) {
|
||||
if (is_array($link_rewrite)) {
|
||||
$objCategory = new Category($categoryExists['id_category']);
|
||||
|
||||
foreach (Language::getLanguages() as $lang) {
|
||||
$objCategory->link_rewrite[$lang['id_lang']] = $link_rewrite[$lang['id_lang']];
|
||||
}
|
||||
|
||||
$objCategory->save();
|
||||
}
|
||||
return $categoryExists['id_category'];
|
||||
} else {
|
||||
$category = new Category();
|
||||
foreach (Language::getLanguages(true) as $lang) {
|
||||
if (is_array($name) && isset($name[$lang['id_lang']])) {
|
||||
$catName = $name[$lang['id_lang']];
|
||||
} else {
|
||||
$catName = $name;
|
||||
}
|
||||
$category->name[$lang['id_lang']] = $catName;
|
||||
$category->description[$lang['id_lang']] = $this->moduleInstance->l('Hotel Branch Category', 'HotelBranchInformation');
|
||||
|
||||
$idHotel = isset($params['id_hotel']) ? $params['id_hotel'] : false;
|
||||
$isHotel = isset($params['is_hotel']) ? $params['is_hotel'] : false;
|
||||
$existsCatId = $categoryExists['id_category'];
|
||||
$belongsToSameHotel = ($idHotel == HotelBranchInformation::getHotelIdByIdCategory($existsCatId));
|
||||
if (!$isHotel || $belongsToSameHotel) {
|
||||
if (is_array($link_rewrite)) {
|
||||
$category->link_rewrite[$lang['id_lang']] = $link_rewrite[$lang['id_lang']];
|
||||
} else {
|
||||
$category->link_rewrite[$lang['id_lang']] = Tools::link_rewrite($catName);
|
||||
$objCategory = new Category($existsCatId);
|
||||
|
||||
foreach (Language::getLanguages() as $lang) {
|
||||
$objCategory->link_rewrite[$lang['id_lang']] = $link_rewrite[$lang['id_lang']];
|
||||
}
|
||||
|
||||
$objCategory->save();
|
||||
}
|
||||
return $existsCatId;
|
||||
}
|
||||
|
||||
if ($meta_title) {
|
||||
$category->meta_title = $meta_title;
|
||||
}
|
||||
if ($meta_description) {
|
||||
$category->meta_description = $meta_description;
|
||||
}
|
||||
if ($meta_keywords) {
|
||||
$category->meta_keywords = $meta_keywords;
|
||||
}
|
||||
|
||||
$category->id_parent = $parent_category;
|
||||
$category->groupBox = $group_ids;
|
||||
$category->add();
|
||||
|
||||
return $category->id;
|
||||
}
|
||||
|
||||
$category = new Category();
|
||||
foreach (Language::getLanguages(true) as $lang) {
|
||||
if (is_array($name) && isset($name[$lang['id_lang']])) {
|
||||
$catName = $name[$lang['id_lang']];
|
||||
} else {
|
||||
$catName = $name;
|
||||
}
|
||||
$category->name[$lang['id_lang']] = $catName;
|
||||
$category->description[$lang['id_lang']] = $this->moduleInstance->l('Hotel Branch Category', 'HotelBranchInformation');
|
||||
|
||||
if (is_array($link_rewrite)) {
|
||||
$category->link_rewrite[$lang['id_lang']] = $link_rewrite[$lang['id_lang']];
|
||||
} else {
|
||||
$category->link_rewrite[$lang['id_lang']] = Tools::link_rewrite($catName);
|
||||
}
|
||||
}
|
||||
|
||||
if ($meta_title) {
|
||||
$category->meta_title = $meta_title;
|
||||
}
|
||||
if ($meta_description) {
|
||||
$category->meta_description = $meta_description;
|
||||
}
|
||||
if ($meta_keywords) {
|
||||
$category->meta_keywords = $meta_keywords;
|
||||
}
|
||||
|
||||
$category->id_parent = $parent_category;
|
||||
$category->groupBox = $group_ids;
|
||||
$category->add();
|
||||
|
||||
return $category->id;
|
||||
}
|
||||
|
||||
//Overrided ObjectModet::delete() to delete all the dependencies of the hotel
|
||||
|
||||
@@ -907,6 +907,7 @@ class AdminAddHotelController extends ModuleAdminController
|
||||
public function ajaxProcessChangeCoverImage()
|
||||
{
|
||||
$idImage = Tools::getValue('id_image');
|
||||
$response = array('status' => false);
|
||||
if ($idImage) {
|
||||
$idHotel = Tools::getValue('id_hotel');
|
||||
if ($coverImg = HotelImage::getCover($idHotel)) {
|
||||
@@ -918,17 +919,15 @@ class AdminAddHotelController extends ModuleAdminController
|
||||
$objHtlImage = new HotelImage((int) $idImage);
|
||||
$objHtlImage->cover = 1;
|
||||
if ($objHtlImage->update()) {
|
||||
die(true);
|
||||
} else {
|
||||
die(false);
|
||||
$response['status'] = true;
|
||||
}
|
||||
} else {
|
||||
die(false);
|
||||
}
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
public function ajaxProcessDeleteHotelImage()
|
||||
{
|
||||
$response = array('status' => false);
|
||||
if ($idImage = Tools::getValue('id_image')) {
|
||||
if ($idHotel = Tools::getValue('id_hotel')) {
|
||||
if (Validate::isLoadedObject($objHtlImage = new HotelImage((int) $idImage))) {
|
||||
@@ -941,12 +940,12 @@ class AdminAddHotelController extends ModuleAdminController
|
||||
$objHtlImage->save();
|
||||
}
|
||||
}
|
||||
die(true);
|
||||
$response['status'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
die(false);
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
public function ajaxProcessUpdateSlidesPosition()
|
||||
|
||||
@@ -1024,6 +1024,8 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
'no_realloc_rm_type_avail_txt' => $this->l('No room type available for reallocation.', null, true),
|
||||
'no_swap_rm_avail_txt' => $this->l('No room available for swap.', null, true),
|
||||
'select_room_txt' => $this->l('Select room', null, true),
|
||||
'added_room_success_txt' => $this->l('Room added to cart successfully', null, true),
|
||||
'removed_room_success_txt' => $this->l('Room removed from cart successfully', null, true),
|
||||
);
|
||||
if (Configuration::get('PS_BACKOFFICE_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS ) {
|
||||
$jsVars['is_occupancy_wise_search'] = true;
|
||||
|
||||
@@ -293,32 +293,6 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
// delete hotel image
|
||||
$('.deleteHtlImage').on('click', function(){
|
||||
var imgId = $(this).attr('id_htl_img');
|
||||
var $this = $(this);
|
||||
$.ajax({
|
||||
url: statebycountryurl,
|
||||
data: {
|
||||
id_htl_img: imgId,
|
||||
ajax: true,
|
||||
action: 'deleteHotelImage',
|
||||
},
|
||||
method: 'POST',
|
||||
success: function(data) {
|
||||
if (data == 1) {
|
||||
$this.closest('.img-container-div').remove();
|
||||
showSuccessMessage(htlImgDeleteSuccessMsg);
|
||||
} else {
|
||||
showErrorMessage(htlImgDeleteErrMsg);
|
||||
}
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#hotel_country').on('change', function() {
|
||||
$('#hotel_state').empty();
|
||||
$.ajax({
|
||||
|
||||
@@ -386,6 +386,7 @@ $(document).ready(function() {
|
||||
if (result.success) {
|
||||
$(".cart_booking_btn").removeAttr('disabled');
|
||||
$current_btn.removeAttr('disabled');
|
||||
showSuccessMessage(added_room_success_txt);
|
||||
}
|
||||
|
||||
btn.removeClass('btn-primary').removeClass('avai_add_cart').addClass('btn-danger').addClass('avai_delete_cart_data').html(remove);
|
||||
@@ -512,6 +513,7 @@ $(document).ready(function() {
|
||||
if (!result.success) {
|
||||
$(".cart_booking_btn").attr('disabled', 'true');
|
||||
} else {
|
||||
showSuccessMessage(removed_room_success_txt);
|
||||
$("#htl_rooms_list").empty().append(result.data.room_tpl);
|
||||
refreshCartData();
|
||||
refreshStatsData();
|
||||
@@ -571,7 +573,7 @@ $(document).ready(function() {
|
||||
if (!(result.success)) {
|
||||
$(".cart_booking_btn").attr('disabled', 'true');
|
||||
}
|
||||
|
||||
showSuccessMessage(removed_room_success_txt);
|
||||
$(".cart_tbody tr td button[data-id-cart-book-data='" + id_cart_book_data + "']").parent().parent().remove();
|
||||
refreshCartData();
|
||||
refreshStatsData();
|
||||
|
||||
@@ -109,6 +109,7 @@ $(document).ready(function () {
|
||||
$.ajax({
|
||||
type:'POST',
|
||||
url: adminHotelCtrlUrl,
|
||||
dataType: 'json',
|
||||
data: {
|
||||
ajax: true,
|
||||
action: 'changeCoverImage',
|
||||
@@ -116,7 +117,7 @@ $(document).ready(function () {
|
||||
id_image: idImage,
|
||||
},
|
||||
success: function(result) {
|
||||
if (result) {
|
||||
if (result.status) {
|
||||
// remover cover image identifier from old cover image
|
||||
var oldCoverImageTr = $("#hotel-image-table tbody tr.cover-image-tr");
|
||||
oldCoverImageTr.removeClass("cover-image-tr").find("td.cover-image-td").removeClass("cover-image-td").find("a.changer-cover-image").removeClass("text-success").addClass("text-danger").attr("data-is-cover", "0").find("i.icon-check").removeClass("icon-check").addClass("icon-times");
|
||||
@@ -149,6 +150,7 @@ $(document).ready(function () {
|
||||
$.ajax({
|
||||
type:'POST',
|
||||
url: adminHotelCtrlUrl,
|
||||
dataType: 'json',
|
||||
data: {
|
||||
ajax: true,
|
||||
action: 'deleteHotelImage',
|
||||
@@ -156,7 +158,7 @@ $(document).ready(function () {
|
||||
id_image: idImage,
|
||||
},
|
||||
success: function(result) {
|
||||
if (result) {
|
||||
if (result.status) {
|
||||
if (parseInt(isCover)) {
|
||||
location.reload();
|
||||
} else {
|
||||
|
||||
@@ -65,7 +65,7 @@ class WkPaypalCommerceHelper
|
||||
if ($err) {
|
||||
throw new PrestaShopException(sprintf('cURL Error #: %s', $err));
|
||||
} else {
|
||||
$accessToken = Tools::jsonDecode($response, true);
|
||||
$accessToken = json_decode($response, true);
|
||||
if (isset($accessToken['error']) && !empty($accessToken['error'])) {
|
||||
$apiResp['success'] = false;
|
||||
$apiResp['message'] = $accessToken['error_description'];
|
||||
@@ -83,12 +83,12 @@ class WkPaypalCommerceHelper
|
||||
$temp = array(
|
||||
"alg" => "none"
|
||||
);
|
||||
$returnData = base64_encode(Tools::jsonEncode($temp)) . '.';
|
||||
$returnData = base64_encode(json_encode($temp)) . '.';
|
||||
$temp = array(
|
||||
"iss" => trim(Configuration::get('WK_PAYPAL_COMMERCE_CLIENT_ID')),
|
||||
"payer_id" => Configuration::get('WK_PAYPAL_COMMERCE_MERCHANT_ID')
|
||||
);
|
||||
$returnData .= base64_encode(Tools::jsonEncode($temp)) . '.';
|
||||
$returnData .= base64_encode(json_encode($temp)) . '.';
|
||||
return $returnData;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ class WkPaypalCommerceHelper
|
||||
CURLOPT_TIMEOUT => 30,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => "POST",
|
||||
CURLOPT_POSTFIELDS => Tools::jsonEncode($postData),
|
||||
CURLOPT_POSTFIELDS => json_encode($postData),
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
"PayPal-Partner-Attribution-Id: " . PayPalHelper::WK_PAYPAL_COMMERCE_ATTRIBUTION_ID,
|
||||
"authorization: Bearer " . $token,
|
||||
@@ -161,7 +161,7 @@ class WkPaypalCommerceHelper
|
||||
if ($err) {
|
||||
throw new PrestaShopException(sprintf('cURL Error #: %s', $err));
|
||||
} else {
|
||||
$webhookResponse = Tools::jsonDecode($response, true);
|
||||
$webhookResponse = json_decode($response, true);
|
||||
if (isset($webhookResponse['id']) && !empty($webhookResponse['id'])) {
|
||||
$apiResp['success'] = true;
|
||||
$apiResp['webhook_id'] = $webhookResponse['id'];
|
||||
@@ -243,7 +243,7 @@ class WkPaypalCommerceHelper
|
||||
CURLOPT_TIMEOUT => 30,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => "POST",
|
||||
CURLOPT_POSTFIELDS => Tools::jsonEncode($postData),
|
||||
CURLOPT_POSTFIELDS => json_encode($postData),
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
"PayPal-Partner-Attribution-Id: " . PayPalHelper::WK_PAYPAL_COMMERCE_ATTRIBUTION_ID,
|
||||
"authorization: Bearer " . $accessToken['access_token'],
|
||||
@@ -260,7 +260,7 @@ class WkPaypalCommerceHelper
|
||||
if ($err) {
|
||||
throw new PrestaShopException(sprintf('cURL Error #: %s', $err));
|
||||
} else {
|
||||
$apiResp = Tools::jsonDecode($response, true);
|
||||
$apiResp = json_decode($response, true);
|
||||
}
|
||||
}
|
||||
return $apiResp;
|
||||
|
||||
@@ -52,7 +52,7 @@ class WkPaypalCommerceWebhook
|
||||
if (isset($eventData['resource']['note_to_payer'])) {
|
||||
$refundObj->refund_reason = $eventData['resource']['note_to_payer'];
|
||||
}
|
||||
$refundObj->response = Tools::jsonEncode($eventData);
|
||||
$refundObj->response = json_encode($eventData);
|
||||
$refundObj->refund_status = $eventData['resource']['status'];
|
||||
$refundObj->save();
|
||||
}
|
||||
@@ -188,7 +188,7 @@ class WkPaypalCommerceWebhook
|
||||
return Db::getInstance()->execute(
|
||||
'UPDATE `'._DB_PREFIX_.'wk_paypal_commerce_order`
|
||||
SET `pp_payment_status` = "'.pSQL($payment_status).'",
|
||||
`response` = "'.pSQL(Tools::jsonEncode($orderData)).'"
|
||||
`response` = "'.pSQL(json_encode($orderData)).'"
|
||||
WHERE `pp_transaction_id` = "'.pSQL($transaction_id).'"
|
||||
'
|
||||
);
|
||||
|
||||
@@ -144,7 +144,7 @@ class AdminPaypalCommerceTransactionController extends ModuleAdminController
|
||||
|
||||
$totalRefunded = WkPaypalCommerceRefund::getTotalRefundedAmount((int)$idTrans, false);
|
||||
$remainingRefund = (float)($transactionData['pp_paid_total'] - $totalRefunded);
|
||||
$response = Tools::jsonDecode($transactionData['response'], true);
|
||||
$response = json_decode($transactionData['response'], true);
|
||||
|
||||
// Buyer making a payment in a different currency (ex: EUR) which is different from the default currency of merchant (Ex: USD), In all those cross currency cases, After Capture, transaction will fall into Pending state and will require merchant to manually go to his PayPal account and accept the payment.
|
||||
$objPPOrder = new WKPayPalCommerceOrder();
|
||||
@@ -156,7 +156,7 @@ class AdminPaypalCommerceTransactionController extends ModuleAdminController
|
||||
$smartyVars['ppstatusDetailMsg'] = $objPPOrder->ppStatusDetail[$response['data']['purchase_units'][0]['payments']['captures'][0]['status_details']['reason']];
|
||||
}
|
||||
}
|
||||
|
||||
$smartyVars['transaction_url'] = $this->context->link->getAdminLink('AdminPaypalCommerceTransaction',Tools::getAdminTokenLite('AdminPaypalCommerceTransaction')).'&viewwk_paypal_commerce_order&id_paypal_commerce_order=' . (int)$idTrans;
|
||||
$smartyVars['transaction_data'] = $transactionData;
|
||||
$smartyVars['refund_data'] = $refundData;
|
||||
$smartyVars['refunded_amount'] = $totalRefundedFormatted;
|
||||
@@ -231,7 +231,7 @@ class AdminPaypalCommerceTransactionController extends ModuleAdminController
|
||||
WkPaypalCommerceHelper::logMsg('refund', 'PayPal Transaction ID: '. $transactionData['pp_transaction_id']);
|
||||
WkPaypalCommerceHelper::logMsg('refund', 'PayPal Order ID: '. $transactionData['pp_order_id']);
|
||||
WkPaypalCommerceHelper::logMsg('refund', 'Refund request data: ');
|
||||
WkPaypalCommerceHelper::logMsg('refund', Tools::jsonEncode($postData));
|
||||
WkPaypalCommerceHelper::logMsg('refund', json_encode($postData));
|
||||
|
||||
$objPPCommerce = new PayPalCommerce();
|
||||
$refundData = $objPPCommerce->orders->refund($postData);
|
||||
@@ -243,7 +243,7 @@ class AdminPaypalCommerceTransactionController extends ModuleAdminController
|
||||
WkPaypalCommerceHelper::logMsg('refund', 'Refund success: ', true);
|
||||
WkPaypalCommerceHelper::logMsg('refund', 'PayPal Refund Id: '. $refundID);
|
||||
WkPaypalCommerceHelper::logMsg('refund', 'Refund reponse data: ');
|
||||
WkPaypalCommerceHelper::logMsg('refund', Tools::jsonEncode($refundData));
|
||||
WkPaypalCommerceHelper::logMsg('refund', json_encode($refundData));
|
||||
WkPaypalCommerceHelper::logMsg('refund', '----------------------- ', true);
|
||||
|
||||
$refundObj = new WkPaypalCommerceRefund();
|
||||
@@ -253,7 +253,7 @@ class AdminPaypalCommerceTransactionController extends ModuleAdminController
|
||||
$refundObj->refund_type = (int)$refundType;
|
||||
$refundObj->currency_code = $transactionData['pp_paid_currency'];
|
||||
$refundObj->refund_reason = $refundReason;
|
||||
$refundObj->response = Tools::jsonEncode($refundData);
|
||||
$refundObj->response = json_encode($refundData);
|
||||
$refundObj->refund_status = $refundData['data']['status'];
|
||||
if ($refundObj->save()) {
|
||||
$urlString = '&viewwk_paypal_commerce_order=&id_paypal_commerce_order=' . (int)Tools::getValue('id_paypal_commerce_order');
|
||||
@@ -263,7 +263,7 @@ class AdminPaypalCommerceTransactionController extends ModuleAdminController
|
||||
} else {
|
||||
WkPaypalCommerceHelper::logMsg('refund', 'Refund failed: ', true);
|
||||
WkPaypalCommerceHelper::logMsg('refund', 'Refund reponse data: ');
|
||||
WkPaypalCommerceHelper::logMsg('refund', Tools::jsonEncode($refundData));
|
||||
WkPaypalCommerceHelper::logMsg('refund', json_encode($refundData));
|
||||
WkPaypalCommerceHelper::logMsg('refund', '----------------------- ', true);
|
||||
$this->errors[] = $refundData['data']['message'];
|
||||
}
|
||||
|
||||
@@ -44,25 +44,25 @@ class QloPaypalCommerceCallbackModuleFrontController extends ModuleFrontControll
|
||||
}
|
||||
|
||||
if ($json) {
|
||||
$payload['webhook_event'] = Tools::jsonDecode($json, true);
|
||||
$payload['webhook_event'] = json_decode($json, true);
|
||||
}
|
||||
|
||||
if ($payload) {
|
||||
WkPaypalCommerceHelper::logMsg('webhook', 'Webhook initiated...', true);
|
||||
WkPaypalCommerceHelper::logMsg('webhook', 'Environment: '. Configuration::get('WK_PAYPAL_COMMERCE_PAYMENT_MODE'));
|
||||
WkPaypalCommerceHelper::logMsg('webhook', 'Webhook payload data: ');
|
||||
WkPaypalCommerceHelper::logMsg('webhook', Tools::jsonEncode($payload));
|
||||
WkPaypalCommerceHelper::logMsg('webhook', json_encode($payload));
|
||||
WkPaypalCommerceHelper::logMsg('webhook', 'Validating webhook signature...');
|
||||
|
||||
$validateSig = WkPaypalCommerceHelper::validateWebhookSig($payload);
|
||||
|
||||
WkPaypalCommerceHelper::logMsg('webhook', 'Webhook respose data: ');
|
||||
WkPaypalCommerceHelper::logMsg('webhook', Tools::jsonEncode($validateSig));
|
||||
WkPaypalCommerceHelper::logMsg('webhook', json_encode($validateSig));
|
||||
|
||||
if (isset($validateSig['verification_status'])
|
||||
&& $validateSig['verification_status'] == 'SUCCESS'
|
||||
) {
|
||||
$eventData = Tools::jsonDecode($json, true);
|
||||
$eventData = json_decode($json, true);
|
||||
$objWebhook = new WkPaypalCommerceWebhook();
|
||||
switch ($eventData['event_type']) {
|
||||
case 'CHECKOUT.ORDER.APPROVED':
|
||||
|
||||
@@ -69,7 +69,7 @@ class QloPaypalCommercePaymentModuleFrontController extends ModuleFrontControlle
|
||||
switch ($action) {
|
||||
case 1:
|
||||
$json = Tools::file_get_contents('php://input');
|
||||
$orderDetails = Tools::jsonDecode($json, true);
|
||||
$orderDetails = json_decode($json, true);
|
||||
|
||||
$cart = $this->context->cart;
|
||||
|
||||
@@ -86,23 +86,23 @@ class QloPaypalCommercePaymentModuleFrontController extends ModuleFrontControlle
|
||||
|
||||
// create order
|
||||
$orderDetails['original'] = $this->getOrderDetails();
|
||||
WkPaypalCommerceHelper::logMsg('payment', Tools::jsonEncode($orderDetails));
|
||||
WkPaypalCommerceHelper::logMsg('payment', json_encode($orderDetails));
|
||||
|
||||
$ppOrderData = $ppCommerce->orders->create($orderDetails);
|
||||
|
||||
WkPaypalCommerceHelper::logMsg('payment', 'Payment response data: ', true);
|
||||
WkPaypalCommerceHelper::logMsg('payment', Tools::jsonEncode($ppOrderData));
|
||||
WkPaypalCommerceHelper::logMsg('payment', json_encode($ppOrderData));
|
||||
|
||||
die(Tools::jsonEncode($ppOrderData));
|
||||
die(json_encode($ppOrderData));
|
||||
case 2:
|
||||
$json = Tools::file_get_contents('php://input');
|
||||
$orderData = Tools::jsonDecode($json, true);
|
||||
$orderData = json_decode($json, true);
|
||||
|
||||
if ($orderData['orderID'] && $orderData['getOrderData']) {
|
||||
$ppCommerce = new PayPalCommerce();
|
||||
$returnData = $ppCommerce->orders->capture($orderData['orderID']);
|
||||
header('Content-Type: application/json');
|
||||
echo Tools::jsonEncode($returnData['data']);
|
||||
echo json_encode($returnData['data']);
|
||||
die;
|
||||
} elseif (Tools::getIsset('order_id')) {
|
||||
$orderID = Tools::getValue('order_id');
|
||||
@@ -116,14 +116,14 @@ class QloPaypalCommercePaymentModuleFrontController extends ModuleFrontControlle
|
||||
WkPaypalCommerceHelper::logMsg('payment', 'Customer ID: '. $cart->id_customer);
|
||||
WkPaypalCommerceHelper::logMsg('payment', 'Currency ID: '. $cart->id_currency);
|
||||
WkPaypalCommerceHelper::logMsg('payment', 'Cart Total: '. $cart->getOrderTotal(true, Cart::BOTH));
|
||||
WkPaypalCommerceHelper::logMsg('payment', Tools::jsonEncode($returnData));
|
||||
WkPaypalCommerceHelper::logMsg('payment', json_encode($returnData));
|
||||
|
||||
if (isset($returnData['data']['id']) && !empty($returnData['data']['id'])) {
|
||||
// Payment success
|
||||
$paypalOrderID = $returnData['data']['id'];
|
||||
|
||||
// Save order data
|
||||
$this->saveOrderData($returnData);
|
||||
$transaction_id = $this->saveOrderData($returnData);
|
||||
if ($paypalOrderID) {
|
||||
$currency = $this->context->currency;
|
||||
$total = (float)$cart->getOrderTotal(true, Cart::BOTH);
|
||||
@@ -144,6 +144,7 @@ class QloPaypalCommercePaymentModuleFrontController extends ModuleFrontControlle
|
||||
$orderStatus = Configuration::get('PS_OS_AWAITING_PAYMENT');
|
||||
}
|
||||
|
||||
$extraVars['transaction_id'] = $transaction_id;
|
||||
// create order for the payment
|
||||
$this->module->validateOrder(
|
||||
$cart->id,
|
||||
@@ -151,7 +152,7 @@ class QloPaypalCommercePaymentModuleFrontController extends ModuleFrontControlle
|
||||
$total,
|
||||
$this->module->l('PayPal Checkout', 'payment'),
|
||||
null,
|
||||
null,
|
||||
$extraVars,
|
||||
(int)$currency->id,
|
||||
false,
|
||||
$customer->secure_key
|
||||
@@ -210,7 +211,7 @@ class QloPaypalCommercePaymentModuleFrontController extends ModuleFrontControlle
|
||||
break;
|
||||
case 3:
|
||||
WkPaypalCommerceHelper::logMsg('payment', 'Payment cancelled by customer...', true);
|
||||
WkPaypalCommerceHelper::logMsg('payment', Tools::jsonEncode(Tools::getAllValues()));
|
||||
WkPaypalCommerceHelper::logMsg('payment', json_encode(Tools::getAllValues()));
|
||||
WkPaypalCommerceHelper::logMsg('payment', '--------------', true);
|
||||
|
||||
Tools::redirect($this->context->link->getPageLink('order-opc', true, null).'?pp_cancel=1');
|
||||
@@ -226,6 +227,7 @@ class QloPaypalCommercePaymentModuleFrontController extends ModuleFrontControlle
|
||||
// Save order data
|
||||
private function saveOrderData($orderData)
|
||||
{
|
||||
$transaction_id = '';
|
||||
if ($orderData) {
|
||||
$purchaseUnits = $orderData['data']['purchase_units'];
|
||||
foreach ($purchaseUnits as $purchase) {
|
||||
@@ -260,15 +262,13 @@ class QloPaypalCommercePaymentModuleFrontController extends ModuleFrontControlle
|
||||
$orderObj->pp_order_id = $orderData['data']['id'];
|
||||
$orderObj->pp_transaction_id = $transaction_id;
|
||||
$orderObj->pp_payment_status = $payment_status;
|
||||
$orderObj->response = Tools::jsonEncode($orderData);
|
||||
$orderObj->response = json_encode($orderData);
|
||||
$orderObj->order_date = date('Y-m-d H:i:s');
|
||||
$orderObj->save();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return $transaction_id;
|
||||
}
|
||||
|
||||
// Create order data to send to PayPal
|
||||
|
||||
@@ -44,25 +44,25 @@ class QloPaypalCommerceWebhookModuleFrontController extends ModuleFrontControlle
|
||||
}
|
||||
|
||||
if ($json) {
|
||||
$payload['webhook_event'] = Tools::jsonDecode($json, true);
|
||||
$payload['webhook_event'] = json_decode($json, true);
|
||||
}
|
||||
|
||||
if ($payload) {
|
||||
WkPaypalCommerceHelper::logMsg('webhook', 'Webhook initiated...', true);
|
||||
WkPaypalCommerceHelper::logMsg('webhook', 'Environment: '. Configuration::get('WK_PAYPAL_COMMERCE_PAYMENT_MODE'));
|
||||
WkPaypalCommerceHelper::logMsg('webhook', 'Webhook payload data: ');
|
||||
WkPaypalCommerceHelper::logMsg('webhook', Tools::jsonEncode($payload));
|
||||
WkPaypalCommerceHelper::logMsg('webhook', json_encode($payload));
|
||||
WkPaypalCommerceHelper::logMsg('webhook', 'Validating webhook signature...');
|
||||
|
||||
$validateSig = WkPaypalCommerceHelper::validateWebhookSig($payload);
|
||||
|
||||
WkPaypalCommerceHelper::logMsg('webhook', 'Webhook respose data: ');
|
||||
WkPaypalCommerceHelper::logMsg('webhook', Tools::jsonEncode($validateSig));
|
||||
WkPaypalCommerceHelper::logMsg('webhook', json_encode($validateSig));
|
||||
|
||||
if (isset($validateSig['verification_status'])
|
||||
&& $validateSig['verification_status'] == 'SUCCESS'
|
||||
) {
|
||||
$eventData = Tools::jsonDecode($json, true);
|
||||
$eventData = json_decode($json, true);
|
||||
$objWebhook = new WkPaypalCommerceWebhook();
|
||||
switch ($eventData['event_type']) {
|
||||
case 'CHECKOUT.ORDER.APPROVED':
|
||||
|
||||
@@ -70,7 +70,7 @@ class HttpHelper {
|
||||
$headerSize = curl_getinfo($this->_curl, CURLINFO_HEADER_SIZE);
|
||||
$body = substr($result, $headerSize);
|
||||
|
||||
return Tools::jsonDecode($body, true);
|
||||
return json_decode($body, true);
|
||||
}
|
||||
|
||||
public function resetHelper() {
|
||||
@@ -85,7 +85,7 @@ class HttpHelper {
|
||||
|
||||
public function setBody($postData) {
|
||||
if(is_array($postData)) {
|
||||
$postData = Tools::jsonEncode($postData);
|
||||
$postData = json_encode($postData);
|
||||
}
|
||||
curl_setopt($this->_curl, CURLOPT_POSTFIELDS, $postData);
|
||||
curl_setopt($this->_curl, CURLOPT_POST, true);
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
{if $transaction_data and $transaction_data.pp_payment_status == 'COMPLETED'}
|
||||
{* show refund form only if there is any remaing amount for refund *}
|
||||
{if $remaining_refund > 0}
|
||||
<form action="" method="post" class="form-horizontal" id="refund_form">
|
||||
<form action="{$transaction_url|escape:'html':'UTF-8'}" method="post" class="form-horizontal" id="refund_form">
|
||||
<div class="panel col-lg-12">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-reply"></i>
|
||||
|
||||
@@ -184,7 +184,11 @@ class StatsRegistrations extends ModuleGraph
|
||||
{
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->query.$this->getDate());
|
||||
foreach ($result as $row) {
|
||||
$this->_values[(int)Tools::substr($row['date_add'], 0, 4)]++;
|
||||
$year = (int)Tools::substr($row['date_add'], 0, 4);
|
||||
if (!isset($this->_values[$year])) {
|
||||
$this->_values[$year] = 0;
|
||||
}
|
||||
$this->_values[$year]++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +208,11 @@ class StatsRegistrations extends ModuleGraph
|
||||
{
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->query.$this->getDate());
|
||||
foreach ($result as $row) {
|
||||
$this->_values[(int)Tools::substr($row['date_add'], 8, 2)]++;
|
||||
$days = (int)Tools::substr($row['date_add'], 8, 2);
|
||||
if (!isset($this->_values[$days])) {
|
||||
$this->_values[$days] = 0;
|
||||
}
|
||||
$this->_values[$days]++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,7 +220,11 @@ class StatsRegistrations extends ModuleGraph
|
||||
{
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->query.$this->getDate());
|
||||
foreach ($result as $row) {
|
||||
$this->_values[(int)Tools::substr($row['date_add'], 11, 2)]++;
|
||||
$hour = (int)Tools::substr($row['date_add'], 11, 2);
|
||||
if (!isset($this->_values[$hour])) {
|
||||
$this->_values[$hour] = 0;
|
||||
}
|
||||
$this->_values[$hour]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<div class="col-sm-8 room_info_cont">
|
||||
{block name='room_type_list_room_quantity'}
|
||||
<div class="row">
|
||||
<p class="rm_heading col-sm-12 col-md-7">{$room_v['name']|escape:'htmlall':'UTF-8'}</p>
|
||||
<a href="{$room_v['product_link']|escape:'htmlall':'UTF-8'}"><p class="rm_heading col-sm-12 col-md-7">{$room_v['name']|escape:'htmlall':'UTF-8'}</p></a>
|
||||
{if !isset($restricted_country_mode) && !$PS_CATALOG_MODE && !$order_date_restrict}
|
||||
<p class="rm_left col-sm-12 col-md-5" {if !empty($display_all_room_types) || $room_v['room_left'] > $warning_num} style="display:none"{/if}>
|
||||
{l s='Hurry!'} <span class="remain_rm_qty">{$room_v['room_left']|escape:'htmlall':'UTF-8'}</span> {l s='rooms left'}
|
||||
|
||||
@@ -30,7 +30,8 @@ function classAutoLoader($class)
|
||||
return;
|
||||
}
|
||||
|
||||
$className = end(explode('\\', $class));
|
||||
$parts = explode('\\', $class);
|
||||
$className = end($parts);
|
||||
if(class_exists($className)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user