Update design of customer order detail page

This commit is contained in:
Abhishek Kumar
2024-02-26 20:01:39 +05:30
parent 9af78bcf14
commit 154e74fd5d
21 changed files with 3083 additions and 2027 deletions

View File

@@ -107,14 +107,14 @@ class QloHotelReview extends Module
public function reviewPopupResources()
{
$controllers = array('history', 'guesttracking');
$controllers = array('orderdetail', 'guesttracking');
$controller = Tools::getValue('controller');
if (!in_array($controller, $controllers)) {
return;
}
$idOrder = 0;
if ($controller == 'history') {
if ($controller == 'orderdetail') {
$idOrder = (int) Tools::getValue('id_order');
}
@@ -162,8 +162,6 @@ class QloHotelReview extends Module
public function loadMedia($idOrder)
{
Media::addJsDef(array('qlo_hotel_review_js_vars' => array(
'id_order' => (int) $idOrder, // 0 for guesttracking
'link' => $this->context->link->getPageLink('order-detail', true),
'review_ajax_link' => $this->context->link->getModuleLink($this->name),
'review_ajax_token' => $this->secure_key,
'raty_img_path' => $this->getPathUri().'views/img/raty',
@@ -201,7 +199,7 @@ class QloHotelReview extends Module
public function hookDisplayFooterBefore()
{
$controllers = array('history', 'guesttracking');
$controllers = array('orderdetail', 'guesttracking');
$controller = Tools::getValue('controller');
if (in_array($controller, $controllers)) {
$categories = QhrCategory::getAll();

View File

@@ -31,10 +31,12 @@
}
#add-review-popup {
width: 650px;
width: 600px;
margin: 0 auto;
padding-right: 20px;
padding-bottom: 20px;
}
#add-review-popup .card-body {
padding: 15px;
}
#add-review-popup .form-group {
@@ -43,7 +45,8 @@
#add-review-popup label {
font-size: 14px;
text-transform: uppercase;
font-weight: normal;
margin-bottom: 6px;
}
#add-review-popup .form-control {
@@ -53,10 +56,6 @@
border-radius: 4px;
}
#add-review-popup .hotel-name {
font-size: 18px;
}
#add-review-popup .form-control.description {
padding: 10px 10px;
}
@@ -74,28 +73,18 @@
font-size: 12px;
}
#add-review-popup .review-actions-wrap .btn-review {
font-size: 14px;
padding: 12px 30px;
font-weight: 600;
text-transform: uppercase;
text-align: center;
margin-left: 10px;
}
#add-review-popup .review-actions-wrap .btn-review.disabled {
#add-review-popup .review-actions-wrap .btn.disabled {
background-color: #1292FF;
border: 1px solid #1292FF;
}
#add-review-popup .image-input-btn {
width: 100px;
height: 100px;
border-radius: 4px;
border: 1px dashed #999;
display: table-cell;
vertical-align: middle;
cursor: pointer;
display: flex;
align-items: center;
}
#add-review-popup .image-input-btn .img-camera-plus {
@@ -109,7 +98,8 @@
}
#add-review-popup .previews-wrap {
margin-bottom: 15px;
margin-top: 10px;
margin-bottom: 20px;
}
#add-review-popup .previews-wrap span {
@@ -120,9 +110,10 @@
#add-review-popup .previews-wrap span i {
position: absolute;
top: 3px;
right: 14px;
font-size: 21px;
color: #7f7f7f;
right: 16px;
font-size: 30px;
font-weight: 100;
color: #fff;
cursor: pointer;
}
@@ -135,14 +126,6 @@
}
/* success popup */
.fancybox-add-review-success {
top: 80px !important;
.fancybox-order-detail.feedback .add-review-success-popup i.text-info {
color: #1292FF;
}
.add-review-success-popup {
width: 650px;
}
.add-review-success-popup i {
font-size: 40px;
}

View File

@@ -205,10 +205,6 @@ $(document).on('shown.bs.tab', 'a[href="#hotel-reviews"]', function(e) {
});
$(document).ready(function () {
if (typeof qlo_hotel_review_js_vars === 'object' && qlo_hotel_review_js_vars.id_order) {
showOrder(1, qlo_hotel_review_js_vars.id_order, qlo_hotel_review_js_vars.link);
}
// init raty
if (typeof qlo_hotel_review_js_vars === 'object' && qlo_hotel_review_js_vars.raty_img_path) {
initRaty(qlo_hotel_review_js_vars.raty_img_path);

View File

@@ -21,14 +21,14 @@ var QhrReviewForm = {
init: function(idOrder, idHotel, hotelName) {
$('#add-review-form').find('[name="id_order"]').val(idOrder);
$('#add-review-form').find('[name="id_hotel"]').val(idHotel);
$('#add-review-form').find('.hotel-name').html(hotelName);
$('#add-review-popup').find('.hotel-name').html(hotelName);
QhrReviewImages.init();
},
show: function() {
$.fancybox.open({
href: '#add-review-popup',
wrapCSS: 'fancybox-add-review',
padding: 20,
wrapCSS: 'fancybox-add-review fancybox-order-detail',
padding: 0,
});
},
close: function() {
@@ -95,8 +95,8 @@ var QhrReviewForm = {
$.fancybox.open({
href: href,
wrapCSS: 'fancybox-add-review-success',
padding: 20,
wrapCSS: 'fancybox-order-detail feedback',
padding: 0,
});
},
reset: function() {
@@ -139,7 +139,7 @@ var QhrReviewImages = {
addFileToPreview: function(file, iInput, iFile) {
var reader = new FileReader();
reader.onload = function (e) {
$('.previews-wrap').append('<span><img data-i-input="'+iInput+'" data-i-file="'+iFile+'" src="'+e.target.result+'" class="img-preview"><i class="icon icon-times-circle-o"></i></span>');
$('.previews-wrap').append('<span><img data-i-input="'+iInput+'" data-i-file="'+iFile+'" src="'+e.target.result+'" class="img-preview"><i>×</i></span>');
};
reader.readAsDataURL(file);
},
@@ -249,10 +249,6 @@ $(document).on('change', 'input.input-images', function(e) {
});
$(document).ready(function () {
if (typeof qlo_hotel_review_js_vars === 'object' && qlo_hotel_review_js_vars.id_order) {
showOrder(1, qlo_hotel_review_js_vars.id_order, qlo_hotel_review_js_vars.link);
}
// init raty
if (typeof qlo_hotel_review_js_vars === 'object' && qlo_hotel_review_js_vars.raty_img_path) {
initRaty(qlo_hotel_review_js_vars.raty_img_path);

View File

@@ -18,98 +18,103 @@
*}
<div id="qlohotelreview" style="display: none;">
<div id="add-review-popup">
<div id="add-review-popup" class="card">
<div class="card-header">
<span class="hotel-name"></span>
</div>
<form action="{$action}" id="add-review-form" method="post" enctype="multipart/form-data">
<input type="hidden" name="id_order" value="0"/>
<input type="hidden" name="id_hotel" value="0"/>
<div class="card-body">
<input type="hidden" name="id_order" value="0"/>
<input type="hidden" name="id_hotel" value="0"/>
<div class="alert alert-danger" id="review-general-errors" style="display:none;"></div>
<div class="form-group">
<label>{l s='Hotel Name' mod='qlohotelreview'}</label>
<p class="hotel-name" type="text" name=""></p>
</div>
<div class="alert alert-danger" id="review-general-errors" style="display:none;"></div>
<div class="form-group images-field">
<label>{l s='Images' mod='qlohotelreview'}</label>
<div class="inputs-wrap"></div>
<div class="form-group images-field">
<label>{l s='Images' mod='qlohotelreview'}</label>
<div class="previews-wrap"></div>
<div class="inputs-wrap"></div>
<div class="image-input-btn">
<img class="img-camera-plus">
</div>
</div>
<div class="form-group">
<label>
{l s='Tell us about your Overall experience' mod='qlohotelreview'}
</label>
<div class="stars-wrap">
<div class="raty" data-score-name="rating_overall" data-score="0"></div>
</div>
</div>
{if isset($categories) && count($categories)}
<div class="categories-wrap">
<div class="form-group">
<label>
{l s='Tell us more what went well?' mod='qlohotelreview'}
</label>
<div class="image-input-btn">
<img class="img-camera-plus">
</div>
{foreach $categories as $category}
<div class="form-group">
<label class="label-category">
{$category.name|escape:'html':'UTF-8'}
</label>
<div class="stars-wrap">
<div class="raty" data-score-name="rating_categories[{$category.id_category}]" data-score="0"></div>
</div>
</div>
{/foreach}
<div class="previews-wrap"></div>
</div>
{/if}
<div class="form-group">
<label>
{l s='Sumup your review' mod='qlohotelreview'}
</label>
<input class="form-control" type="text" name="subject" />
<p class="review-error subject"></p>
<div class="form-group">
<label>
{l s='Tell us about your Overall experience' mod='qlohotelreview'}
</label>
<div class="stars-wrap">
<div class="raty" data-score-name="rating_overall" data-score="0"></div>
</div>
</div>
{if isset($categories) && count($categories)}
<div class="categories-wrap">
<div class="form-group">
<label>
{l s='Tell us more what went well?' mod='qlohotelreview'}
</label>
</div>
{foreach $categories as $category}
<div class="form-group">
<label class="label-category">
{$category.name|escape:'html':'UTF-8'}
</label>
<div class="stars-wrap">
<div class="raty" data-score-name="rating_categories[{$category.id_category}]" data-score="0"></div>
</div>
</div>
{/foreach}
</div>
{/if}
<div class="form-group">
<label>
{l s='Sumup your review' mod='qlohotelreview'}
</label>
<input class="form-control" type="text" name="subject" />
<p class="review-error subject"></p>
</div>
<div class="form-group">
<label>
{l s='Write in detail' mod='qlohotelreview'}
</label>
<textarea class="form-control description" type="text" rows="5" name="description"></textarea>
<p class="review-error description"></p>
</div>
</div>
<div class="form-group">
<label>
{l s='Write in detail' mod='qlohotelreview'}
</label>
<textarea class="form-control description" type="text" rows="5" name="description"></textarea>
<p class="review-error description"></p>
</div>
<div class="review-actions-wrap text-right">
<a class="btn btn-default btn-review" id="btn-submit-review">
{l s='Make Review' mod='qlohotelreview'}
</a>
<a class="btn btn-default btn-review" id="btn-cancel-review">
{l s='Cancel' mod='qlohotelreview'}
</a>
<div class="card-footer clearfix review-actions-wrap">
<div class="pull-right">
<button class="btn btn-secondary" id="btn-cancel-review">
{l s='Cancel' mod='qlohotelreview'}
</button>
<button class="btn btn-primary" id="btn-submit-review">
{l s='Make Review' mod='qlohotelreview'}
</button>
</div>
</div>
</form>
</div>
<div id="popup-review-submit-success-no-approval"
class="add-review-success-popup">
<div class="text-center">
<div><i class="icon icon-check-circle text-success"></i></div>
<h3>{l s='Review added successfully.' mod='qlohotelreview'}</h3>
<p>{l s='Your review has been added successfully.' mod='qlohotelreview'}</p>
<div id="popup-review-submit-success-no-approval" class="add-review-success-popup">
<div class="card">
<div class="text-center">
<div><i class="icon icon-check-circle text-info"></i></div>
<h3>{l s='Review added successfully.' mod='qlohotelreview'}</h3>
<p>{l s='Your review has been added successfully.' mod='qlohotelreview'}</p>
</div>
</div>
</div>
<div id="popup-review-submit-success-with-approval"
class="add-review-success-popup">
<div class="text-center">
<div><i class="icon icon-check-circle text-success"></i></div>
<h3>{l s='Review submitted successfully.' mod='qlohotelreview'}</h3>
<p>{l s='Your review has been submitted for approval.' mod='qlohotelreview'}</p>
<div id="popup-review-submit-success-with-approval" class="add-review-success-popup">
<div class="card">
<div class="text-center">
<div><i class="icon icon-check-circle text-info"></i></div>
<h3>{l s='Review submitted successfully.' mod='qlohotelreview'}</h3>
<p>{l s='Your review has been submitted for approval.' mod='qlohotelreview'}</p>
</div>
</div>
</div>
</div>