Merge branch 'develop' into gli-2241-2
This commit is contained in:
@@ -96,3 +96,20 @@
|
||||
right: 0
|
||||
left: unset
|
||||
font-size: 14px
|
||||
|
||||
#order-details-price
|
||||
.icon-bold
|
||||
font-weight: 600
|
||||
#convenience_services, #order_tax_details
|
||||
.panel
|
||||
.table
|
||||
tr
|
||||
&:last-child td
|
||||
border-bottom: none
|
||||
td
|
||||
background-color: #F5F8F9
|
||||
padding: 10px
|
||||
background-color: #F5F8F9
|
||||
// Adding transparent border for display while printing screen
|
||||
border: solid 1px transparent
|
||||
border-radius: 0
|
||||
@@ -16,6 +16,7 @@ $kpi-gap: 10px
|
||||
flex-wrap: wrap
|
||||
margin-left: -($kpi-gap / 2)
|
||||
margin-right: -($kpi-gap / 2)
|
||||
flex-grow: 1
|
||||
.kpi-wrap
|
||||
display: inline-block
|
||||
width: 20%
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
margin-bottom: 0 !important
|
||||
#addressInvoice
|
||||
width: 49% !important
|
||||
float: right !important
|
||||
float: right !important
|
||||
margin-bottom: 0 !important
|
||||
#status
|
||||
tr:first-child td
|
||||
@@ -81,15 +81,14 @@
|
||||
i
|
||||
display: none !important
|
||||
.kpi-container.panel
|
||||
margin: 30px 0 20px 0 !important
|
||||
border: solid 1px black !important
|
||||
.actions-wrap
|
||||
display: none
|
||||
.box-stats
|
||||
padding: 10px 0 !important
|
||||
height: auto !important
|
||||
width: 25% !important
|
||||
font-size: 8pt !important
|
||||
i
|
||||
font-size: 20pt !important
|
||||
span.arrow
|
||||
display: none
|
||||
.alert
|
||||
border: 1px solid black !important
|
||||
&:before
|
||||
@@ -99,3 +98,38 @@
|
||||
margin: 0 !important
|
||||
.panel-total td
|
||||
font-size: 13pt!important
|
||||
|
||||
|
||||
#customer_cart_details
|
||||
thead
|
||||
display: none
|
||||
tr
|
||||
display: block
|
||||
border: 1px solid #ccc
|
||||
-webkit-box-shadow: #EAEDEF 0 2px 0 0
|
||||
box-shadow: #EAEDEF 0 2px 0 0
|
||||
width: 100%
|
||||
margin-bottom: 6px
|
||||
td
|
||||
display: block
|
||||
display: grid
|
||||
grid-template-columns: 2fr 3fr
|
||||
text-align: center !important
|
||||
position: relative
|
||||
width: 100% !important
|
||||
text-align: left !important
|
||||
line-height: 2em !important
|
||||
font-size: 1.15em !important
|
||||
white-space: nowrap
|
||||
overflow: hidden
|
||||
text-overflow: ellipsis
|
||||
> span
|
||||
padding: 0px 5px
|
||||
> span:nth-child(1)
|
||||
border-right: 1px solid #EAEDEF
|
||||
padding-right: 10px
|
||||
white-space: nowrap
|
||||
color: #aaa
|
||||
text-align: right
|
||||
font-size: .9em
|
||||
font-style: italic
|
||||
@@ -7,6 +7,7 @@
|
||||
font-size: $icon-size-base
|
||||
.tree
|
||||
list-style: none
|
||||
overflow: auto
|
||||
@include padding(0, 0, 0, 20px)
|
||||
input
|
||||
vertical-align: baseline
|
||||
@@ -42,6 +43,14 @@
|
||||
&:hover
|
||||
color: #ccc
|
||||
background-color: none
|
||||
.node-hint
|
||||
font-style: italic
|
||||
color: #959595
|
||||
margin-left: 30px
|
||||
margin-top: -4px
|
||||
margin-bottom: 4px
|
||||
.badge
|
||||
margin-left: 5px
|
||||
.tree-actions
|
||||
display: inline-block
|
||||
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
$('input[name=lastname]').val(infos[1]);
|
||||
$('input[name=company]').val(infos[2]);
|
||||
$('input[name=id_customer]').val(infos[3]);
|
||||
$('input[name=phone]').val(infos[4]);
|
||||
} else {
|
||||
resetCustomerRelatedAddressFields();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
{*
|
||||
* Since 2010 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><i class="icon-remove-sign"></i></button>
|
||||
<h4 class="modal-title"><i class="icon icon-exclamation-triangle"></i> {l s='Confirm Delete'}</h4>
|
||||
{if isset($cartRules)}
|
||||
<p>{l s='The following cart rules in your selection were created dynamically from refunds or credit slips. Please confirm if you also intend to delete these cart rules?'}</p>
|
||||
{else}
|
||||
<p>{l s='Are you sure, you want to delete the selected cart rules?'}</p>
|
||||
|
||||
{/if}
|
||||
</div>
|
||||
{if isset($cartRules)}
|
||||
<div class="modal-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
</th>
|
||||
<th>
|
||||
{l s='Cart Rule'}
|
||||
</th>
|
||||
<th>
|
||||
{l s='Reason'}
|
||||
</th>
|
||||
<th>
|
||||
{l s='Order'}
|
||||
</th>
|
||||
<th>
|
||||
{l s='Amount'}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{foreach $cartRules as $cartRule}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" class="cart_rule_to_delete" value="{$cartRule['id_cart_rule']}" checked>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{$link->getAdminLink('AdminCartRules')}&updatecart_rule&id_cart_rule={$cartRule['id_cart_rule']}" target="_blank">#{$cartRule['id_cart_rule']}</a>
|
||||
</td>
|
||||
<td>
|
||||
{if $cartRule['generated_by'] == CartRule::GENERATED_BY_REFUND}
|
||||
<b>{l s='Generated against refund'}</b>
|
||||
(<a href="{$link->getAdminLink('AdminOrderRefundRequests')}&vieworder_return&id_order_return={$cartRule['id_generated_by']}" target="_blank">#{$cartRule['id_generated_by']}</a>)
|
||||
{else if $cartRule['generated_by'] == CartRule::GENERATED_BY_ORDER_SLIP}
|
||||
<b>{l s='Generated against credit slip'}</b>
|
||||
(<a href="{$link->getAdminLink('AdminPdf')}&submitAction=generateOrderSlipPDF&id_order_slip={$cartRule['id_generated_by']}" target="_blank">#{$cartRule['id_generated_by']}</a>)
|
||||
{/if}
|
||||
{if !$cartRule['cart_rule']->quantity}
|
||||
<span class="badge badge-danger">{l s='Used'}</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{$link->getAdminLink('AdminOrders')}&vieworder&id_order={$cartRule['order']->id}" target="_blank">#{$cartRule['order']->id}</a>
|
||||
</td>
|
||||
<td>
|
||||
{displayPrice price=$cartRule['cart_rule']->reduction_amount currency=$cartRule['cart_rule']->reduction_currency}
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -0,0 +1,71 @@
|
||||
{*
|
||||
* Since 2010 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><i class="icon-remove-sign"></i></button>
|
||||
<h4 class="modal-title"><i class="icon icon-exclamation-triangle"></i> {l s='Confirm Delete'}</h4>
|
||||
<p>{l s='Are you sure, you want to delete this cart rule?'}</p>
|
||||
</div>
|
||||
{if isset($cartRule)}
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<label>{l s='Voucher'}</label>
|
||||
<p class="control-value">
|
||||
{$cartRule->code} (<a href="{$link->getAdminLink('AdminCartRules')}&updatecart_rule&id_cart_rule={$cartRule->id}" target="_blank">#{$cartRule->id}</a>)
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<label>{l s='Reason'}</label>
|
||||
<p class="control-value">
|
||||
{if $generatedBy == CartRule::GENERATED_BY_REFUND}
|
||||
{l s='Generated against refund'}
|
||||
(<a href="{$link->getAdminLink('AdminOrderRefundRequests')}&vieworder_return&id_order_return={$generatedById}" target="_blank">#{$generatedById}</a>)
|
||||
{else if $generatedBy == CartRule::GENERATED_BY_ORDER_SLIP}
|
||||
{l s='Generated against credit slip'}
|
||||
(<a href="{$link->getAdminLink('AdminPdf')}&submitAction=generateOrderSlipPDF&id_order_slip={$generatedById}" target="_blank">#{$generatedById}</a>)
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<label>{l s='Amount'}</label>
|
||||
<p class="control-value">{displayPrice price=$cartRule->reduction_amount currency=$cartRule->reduction_currency}</p>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<label>{l s='Customer'}</label>
|
||||
<p class="control-value">
|
||||
{$customer->firstname} {$customer->lastname} (<a href="{$link->getAdminLink('AdminCustomers')}&viewcustomer&id_customer={$customer->id}" target="_blank">#{$customer->id}</a>)
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<label>{l s='Order'}</label>
|
||||
<p class="control-value">
|
||||
{$order->reference} (<a href="{$link->getAdminLink('AdminOrders')}&vieworder&id_order={$order->id}" target="_blank">#{$order->id}</a>)
|
||||
</p>
|
||||
</div>
|
||||
{if !$cartRule->quantity}
|
||||
<div class="col-sm-4">
|
||||
<label>{l s='Status'}</label>
|
||||
<p class="control-value">
|
||||
<span class="badge badge-danger">{l s='Used'}</span>
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -54,6 +54,12 @@
|
||||
<p class="form-control-static">{if $gender->name}{$gender->name}{else}{l s='Unknown'}{/if}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="control-label col-lg-3">{l s='Phone'}</label>
|
||||
<div class="col-lg-9">
|
||||
<p class="form-control-static">{$customer->phone}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="control-label col-lg-3">{l s='Age'}</label>
|
||||
<div class="col-lg-9">
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<div class="leadin">{block name="leadin"}{/block}</div>
|
||||
{if $module_confirmation}
|
||||
<div class="alert alert-success clearfix">
|
||||
{l s='Your .CSV file has been successfully imported into your shop. Don\'t forget to re-build the products\' search index.'}
|
||||
{l s='Your .CSV file has been successfully imported to your website.'}
|
||||
</div>
|
||||
{/if}
|
||||
<div class="row">
|
||||
@@ -63,7 +63,6 @@
|
||||
<div class="alert alert-warning import_products_categories">
|
||||
<ul>
|
||||
<li>{l s='Note that the Category import does not support having two categories with the same name.'}</li>
|
||||
<li>{l s='Note that you can have several products with the same reference.'}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="alert alert-warning import_supply_orders_details">
|
||||
@@ -166,12 +165,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="csv_file_selected" style="display: none;">
|
||||
<div class="alert alert-success clearfix">
|
||||
<div class="alert alert-success clearfix" style="display:flex; align-items:center;">
|
||||
<input type="hidden" value="{$csv_selected}" name="csv" id="csv_selected_value" />
|
||||
<div class="col-lg-8">
|
||||
<div class="col-xs-8">
|
||||
<span id="csv_selected_filename">{$csv_selected|escape:'html':'UTF-8'}</span>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="col-xs-4">
|
||||
<div class="btn-group pull-right">
|
||||
<button id="file-remove-button" type="button" class="btn btn-default">
|
||||
<i class="icon-refresh"></i>
|
||||
@@ -199,42 +198,40 @@
|
||||
<div class="form-group">
|
||||
<label for="convert" class="control-label col-lg-4">{l s='ISO 8859-1 encoded file?'}</label>
|
||||
<div class="col-lg-8">
|
||||
<label class="switch-light prestashop-switch fixed-width-lg">
|
||||
<input name="convert" id="convert" type="checkbox" />
|
||||
<span>
|
||||
<span>{l s='Yes'}</span>
|
||||
<span>{l s='No'}</span>
|
||||
</span>
|
||||
<span class="switch prestashop-switch fixed-width-lg">
|
||||
<input type="radio" name="convert" id="convert_on" value="1">
|
||||
<label for="convert_on">{l s='Yes'}</label>
|
||||
<input type="radio" name="convert" id="convert_off" value="0" checked="checked">
|
||||
<label for="convert_off">{l s='No'}</label>
|
||||
<a class="slide-button btn"></a>
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="separator" class="control-label col-lg-4">{l s='Field separator'}</label>
|
||||
<div class="col-lg-8">
|
||||
<input id="separator" name="separator" class="fixed-width-xs form-control" type="text" value="{if isset($separator_selected)}{$separator_selected|escape:'html':'UTF-8'}{else};{/if}" />
|
||||
<div class="help-block">{l s='e.g. '} 1; Blouse; 129.90; 5</div>
|
||||
<div class="help-block">{l s='e.g. '} 6; 1; The Sunshine Luxury</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="multiple_value_separator" class="control-label col-lg-4">{l s='Multiple value separator'}</label>
|
||||
<div class="col-lg-8">
|
||||
<input id="multiple_value_separator" name="multiple_value_separator" class="fixed-width-xs form-control" type="text" value="{if isset($multiple_value_separator_selected)}{$multiple_value_separator_selected|escape:'html':'UTF-8'}{else},{/if}" />
|
||||
<div class="help-block">{l s='e.g. '} Blouse; red.jpg, blue.jpg, green.jpg; 129.90</div>
|
||||
<div class="help-block">{l s='e.g. '} The Sunshine Luxury; News Paper:2.jpg, Gym:7.jpg</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="form-group">
|
||||
<label for="truncate" class="control-label col-lg-4">{l s='Delete all'} <span id="entitie">{l s='categories'}</span> {l s='before import'} </label>
|
||||
<div class="col-lg-8">
|
||||
<label class="switch-light prestashop-switch fixed-width-lg">
|
||||
<input id="truncate" name="truncate" type="checkbox"/>
|
||||
<span>
|
||||
<span>{l s='Yes'}</span>
|
||||
<span>{l s='No'}</span>
|
||||
</span>
|
||||
<span class="switch prestashop-switch fixed-width-lg">
|
||||
<input type="radio" name="truncate" id="truncate_on" value="1">
|
||||
<label for="truncate_on">{l s='Yes'}</label>
|
||||
<input type="radio" name="truncate" id="truncate_off" value="0" checked="checked">
|
||||
<label for="truncate_off">{l s='No'}</label>
|
||||
<a class="slide-button btn"></a>
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="display: none">
|
||||
@@ -244,52 +241,49 @@
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-8">
|
||||
<label class="switch-light prestashop-switch fixed-width-lg">
|
||||
<input id="match_ref" name="match_ref" type="checkbox" />
|
||||
<span>
|
||||
<span>{l s='Yes'}</span>
|
||||
<span>{l s='No'}</span>
|
||||
</span>
|
||||
<span class="switch prestashop-switch fixed-width-lg">
|
||||
<input type="radio" name="match_ref" id="match_ref_on" value="1">
|
||||
<label for="match_ref_on">{l s='Yes'}</label>
|
||||
<input type="radio" name="match_ref" id="match_ref_off" value="0" checked="checked">
|
||||
<label for="match_ref_off">{l s='No'}</label>
|
||||
<a class="slide-button btn"></a>
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="regenerate" class="control-label col-lg-4">{l s='Skip thumbnails regeneration'}</label>
|
||||
<div class="col-lg-8">
|
||||
<label class="switch-light prestashop-switch fixed-width-lg">
|
||||
<input id="regenerate" name="regenerate" type="checkbox" />
|
||||
<span>
|
||||
<span>{l s='Yes'}</span>
|
||||
<span>{l s='No'}</span>
|
||||
</span>
|
||||
<span class="switch prestashop-switch fixed-width-lg">
|
||||
<input type="radio" name="regenerate" id="regenerate_on" value="1">
|
||||
<label for="regenerate_on">{l s='Yes'}</label>
|
||||
<input type="radio" name="regenerate" id="regenerate_off" value="0" checked="checked">
|
||||
<label for="regenerate_off">{l s='No'}</label>
|
||||
<a class="slide-button btn"></a>
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="forceIDs" class="control-label col-lg-4">
|
||||
<span data-toggle="tooltip" class="label-tooltip" data-original-title="{l s='If you enable this option, your imported items\' ID number will be used as-is. If you do not enable this option, the imported ID number will be ignored, and PrestaShop will instead create auto-incremented ID numbers for all the imported items.'}">
|
||||
<span data-toggle="tooltip" class="label-tooltip" data-original-title="{l s='If you enable this option, your imported items\' ID number will be used as-is. If you do not enable this option, the imported ID number will be ignored, and QloApps will instead create auto-incremented ID numbers for all the imported items.'}">
|
||||
{l s='Force all ID numbers'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-8">
|
||||
<label class="switch-light prestashop-switch fixed-width-lg">
|
||||
<input id="forceIDs" name="forceIDs" type="checkbox"/>
|
||||
<span>
|
||||
<span>{l s='Yes'}</span>
|
||||
<span>{l s='No'}</span>
|
||||
</span>
|
||||
<span class="switch prestashop-switch fixed-width-lg">
|
||||
<input type="radio" name="forceIDs" id="forceIDs_on" value="1">
|
||||
<label for="forceIDs_on">{l s='Yes'}</label>
|
||||
<input type="radio" name="forceIDs" id="forceIDs_off" value="0" checked="checked">
|
||||
<label for="forceIDs_off">{l s='No'}</label>
|
||||
<a class="slide-button btn"></a>
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<!--
|
||||
{*if empty($files_to_import)*}
|
||||
<div class="alert alert-info">{l s='You must upload a file in order to proceed to the next step'}</div>
|
||||
{*if !count($files_to_import)*}
|
||||
<p>{l s='There is no CSV file available. Please upload one using the \'Upload\' button above.'}</p>
|
||||
-->
|
||||
-->
|
||||
<div class="panel-footer">
|
||||
<button type="submit" name="submitImportFile" id="submitImportFile" class="btn btn-default pull-right" >
|
||||
<i class="process-icon-next"></i> <span>{l s='Next step'}</span>
|
||||
@@ -317,29 +311,26 @@
|
||||
</div>
|
||||
|
||||
<div class="list-group">
|
||||
<a class="list-group-item _blank" href="../docs/csv_import/hotels_import.csv">
|
||||
{l s='Sample Hotels file'}
|
||||
</a>
|
||||
<a class="list-group-item _blank" href="../docs/csv_import/room_types_import.csv">
|
||||
{l s='Sample Room Types file'}
|
||||
</a>
|
||||
<a class="list-group-item _blank" href="../docs/csv_import/rooms_import.csv">
|
||||
{l s='Sample Rooms file'}
|
||||
</a>
|
||||
<a class="list-group-item _blank" href="../docs/csv_import/service_products_import.csv">
|
||||
{l s='Sample Service Products file'}
|
||||
</a>
|
||||
<a class="list-group-item _blank" href="../docs/csv_import/categories_import.csv">
|
||||
{l s='Sample Categories file'}
|
||||
</a>
|
||||
<a class="list-group-item _blank" href="../docs/csv_import/products_import.csv">
|
||||
{l s='Sample Products file'}
|
||||
</a>
|
||||
<a class="list-group-item _blank" href="../docs/csv_import/combinations_import.csv">
|
||||
{l s='Sample Combinations file'}
|
||||
</a>
|
||||
<a class="list-group-item _blank" href="../docs/csv_import/customers_import.csv">
|
||||
{l s='Sample Customers file'}
|
||||
</a>
|
||||
<a class="list-group-item _blank" href="../docs/csv_import/addresses_import.csv">
|
||||
{l s='Sample Addresses file'}
|
||||
</a>
|
||||
<a class="list-group-item _blank" href="../docs/csv_import/manufacturers_import.csv">
|
||||
{l s='Sample Manufacturers file'}
|
||||
</a>
|
||||
<a class="list-group-item _blank" href="../docs/csv_import/suppliers_import.csv">
|
||||
{l s='Sample Suppliers file'}
|
||||
</a>
|
||||
<a class="list-group-item _blank" href="../docs/csv_import/alias_import.csv">
|
||||
{l s='Sample Aliases file'}
|
||||
<a class="list-group-item _blank" href="../docs/csv_import/bookings_import.csv">
|
||||
{l s='Sample Bookings file'}
|
||||
</a>
|
||||
{if $PS_ADVANCED_STOCK_MANAGEMENT}
|
||||
<a class="list-group-item _blank" href="../docs/csv_import/supply_orders_import.csv">
|
||||
@@ -352,9 +343,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
<script type="text/javascript">
|
||||
|
||||
function humanizeSize(bytes) {
|
||||
if (typeof bytes !== 'number')
|
||||
@@ -506,12 +497,13 @@
|
||||
else {
|
||||
$("#match_ref").closest('.form-group').hide();
|
||||
}
|
||||
if ($("#entity > option:selected").val() == 1 || $("#entity > option:selected").val() == 0) {
|
||||
if ($("#entity > option:selected").val() == 3) {
|
||||
$(".import_products_categories").show();
|
||||
}
|
||||
else {
|
||||
$(".import_products_categories").hide();
|
||||
}
|
||||
|
||||
if ($("#entity > option:selected").val() == 0 || $("#entity > option:selected").val() == 1 ||
|
||||
$("#entity > option:selected").val() == 5 || $("#entity > option:selected").val() == 6) {
|
||||
$("#regenerate").closest('.form-group').show();
|
||||
|
||||
@@ -37,11 +37,12 @@
|
||||
{/if}
|
||||
</p>
|
||||
<div class="panel-action clearfix">
|
||||
<span class="module-price">{if isset($element->price)}{if $element->price|floatval == 0}{l s='Free'}{else}{$element->price_formatted}{/if}{else}{l s='Free'}{/if}</span>
|
||||
{if isset($element->type) && $element->type == 'addonsMustHave' && !$element->not_on_disk} <span class="label label-primary">{l s='In Module Directory'}</span>{/if}
|
||||
{if isset($element->type) && $element->type == 'addonsMustHave' && $element->not_on_disk}
|
||||
<span class="module-price">{if isset($element->price)}{if $element->price|floatval == 0}{l s='Free'}{elseif isset($element->id_currency)}{displayPrice price=$element->price currency=$element->id_currency}{/if}{/if}</span>
|
||||
<a class="btn button-action pull-right btn-primary _blank" href="{$element->addons_buy_url|replace:' ':'+'|escape:'html':'UTF-8'}">{l s='Explore'}</a>
|
||||
{else}
|
||||
<a class="btn button-action pull-right btn-primary{if !$element->trusted} untrustedaddon{/if}" {if !$element->trusted} data-target="#moduleNotTrusted" data-toggle="modal"{/if} data-link="{$element->options.install_url|escape:'html':'UTF-8'}" data-module-display-name="{$element->displayName|escape:'html':'UTF-8'}" data-module-name="{$element->name|escape:'html':'UTF-8'}" data-module-image="{if isset($element->image)}{$element->image}{else}{$modules_uri}/{$element->name}/{$element->logo}{/if}" data-author-name="{$element->author|escape:'html':'UTF-8'}" data-author-uri="{if isset($element->author_uri)}{$element->author_uri|escape:'html':'UTF-8'}{/if}" href="{if !$element->trusted}#{else}{$element->options.install_url|escape:'html':'UTF-8'}{/if}" title="{l s='Install'}">{l s='Install'}</a>
|
||||
<a class="btn button-action pull-right btn-primary{if !$element->trusted} untrustedaddon{/if}" {if !$element->trusted} data-target="#moduleNotTrusted" data-toggle="modal"{/if} data-link="{$element->options.install_url|escape:'html':'UTF-8'}" data-module-display-name="{$element->displayName|escape:'html':'UTF-8'}" data-module-name="{$element->name|escape:'html':'UTF-8'}" data-module-image="{if isset($element->image)}{$element->image}{else}{$modules_uri}/{$element->name}/{$element->logo}{/if}" data-author-name="{$element->author|escape:'html':'UTF-8'}" data-author-uri="{if isset($element->author_uri)}{$element->author_uri|escape:'html':'UTF-8'}{/if}" href="{if !$element->trusted}#{else}{$element->options.install_url|escape:'html':'UTF-8'}{/if}" title="{l s='Install'}">{l s='Install'}</a>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,200 +0,0 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<div class="panel">
|
||||
{if isset($header)}{$header}{/if}
|
||||
{if isset($nodes)}
|
||||
<ul id="{$id|escape:'html':'UTF-8'}" class="cattree tree">
|
||||
{$nodes}
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var currentToken="{$token|@addslashes}";
|
||||
var treeClickFunc = function() {
|
||||
var newURL = window.location.protocol + "//" + window.location.host + window.location.pathname;
|
||||
var queryString = window.location.search.replace(/&id_category=[0-9]*/, "") + "&id_category=" + $(this).val();
|
||||
location.href = newURL+queryString; // hash part is dropped: window.location.hash
|
||||
};
|
||||
function addDefaultCategory(elem)
|
||||
{
|
||||
$('select#id_category_default').append('<option value="' + elem.val()+'">' + (elem.val() !=1 ? elem.parent().find('label').html() : home) + '</option>');
|
||||
if ($('select#id_category_default option').length > 0)
|
||||
{
|
||||
$('select#id_category_default').closest('.form-group').show();
|
||||
$('#no_default_category').hide();
|
||||
}
|
||||
}
|
||||
|
||||
{if isset($use_checkbox) && $use_checkbox == true}
|
||||
function checkAllAssociatedHotels($tree)
|
||||
{
|
||||
$tree.find(':input[type=checkbox]').each(function(){
|
||||
$(this).prop('checked', true);
|
||||
$(this).parent().addClass('tree-selected');
|
||||
});
|
||||
}
|
||||
|
||||
function uncheckAllAssociatedHotels($tree)
|
||||
{
|
||||
$tree.find(':input[type=checkbox]').each(function(){
|
||||
$(this).prop('checked', false);
|
||||
$(this).parent().removeClass('tree-selected');
|
||||
});
|
||||
}
|
||||
|
||||
function checkAllRoomTypeOfHotel(node)
|
||||
{
|
||||
$(node).find(':input[type=checkbox]').each(function(){
|
||||
$(this).prop('checked', true);
|
||||
$(this).parent().addClass('tree-selected');
|
||||
});
|
||||
}
|
||||
|
||||
function unCheckAllRoomTypeOfHotel(node)
|
||||
{
|
||||
$(node).find(':input[type=checkbox]').each(function(){
|
||||
$(this).prop('checked', false);
|
||||
$(this).parent().removeClass('tree-selected');
|
||||
});
|
||||
}
|
||||
{/if}
|
||||
$('#{$id|escape:'html':'UTF-8'}').find('.select_hotel').on('click', function(){
|
||||
if ($(this).is(":checked")) {
|
||||
checkAllRoomTypeOfHotel($(this).closest('li.tree-folder').find('ul.tree'));
|
||||
} else {
|
||||
unCheckAllRoomTypeOfHotel($(this).closest('li.tree-folder').find('ul.tree'));
|
||||
}
|
||||
});
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}').find(':input[type=checkbox].select_room_type').on('change', function(){
|
||||
var totalNodes = $(this).closest('ul.tree').find('li.tree-item');
|
||||
var checkedNodes = $(this).closest('ul.tree').find('li.tree-item :input[type=checkbox].select_room_type:checked');
|
||||
if (totalNodes.length == checkedNodes.length) {
|
||||
$(this).closest('li.tree-folder').find(':input[type=checkbox].select_hotel').prop('checked', true).parent().addClass('tree-selected');
|
||||
} else {
|
||||
$(this).closest('li.tree-folder').find(':input[type=checkbox].select_hotel').prop('checked', false).parent().removeClass('tree-selected');
|
||||
}
|
||||
});
|
||||
{if isset($use_search) && $use_search == true}
|
||||
$('#{$id|escape:'html':'UTF-8'}-categories-search').bind('typeahead:selected', function(obj, datum){
|
||||
var match = $('#{$id|escape:'html':'UTF-8'}').find(':input[value="'+datum.id_category+'"]').first();
|
||||
if (match.length)
|
||||
{
|
||||
match.each(function(){
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents('ul.tree').each(function(){
|
||||
$(this).show();
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
});
|
||||
addDefaultCategory($(this));
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
var selected = [];
|
||||
that = this;
|
||||
$('#{$id|escape:'html':'UTF-8'}').find('.tree-selected input').each(
|
||||
function()
|
||||
{
|
||||
selected.push($(this).val());
|
||||
}
|
||||
);
|
||||
{literal}
|
||||
$.get(
|
||||
'ajax-tab.php',
|
||||
{controller:'AdminNormalProducts',token:currentToken,action:'getCategoryTree', fullTree:1, selected:selected},
|
||||
function(content) {
|
||||
{/literal}
|
||||
$('#{$id|escape:'html':'UTF-8'}').html(content);
|
||||
$('#{$id|escape:'html':'UTF-8'}').tree('init');
|
||||
$('#{$id|escape:'html':'UTF-8'}').find(':input[value="'+datum.id_category+'"]').each(function(){
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents('ul.tree').each(function(){
|
||||
$(this).show();
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
});
|
||||
full_loaded = true;
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
{/if}
|
||||
function startTree() {
|
||||
if (typeof $.fn.tree === 'undefined') {
|
||||
setTimeout(startTree, 100);
|
||||
return;
|
||||
}
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}').tree('expandAll');
|
||||
$('#expand-all-{$id|escape:'html':'UTF-8'}').hide();
|
||||
$('#{$id|escape:'html':'UTF-8'}').find(':input[type=radio]').click(treeClickFunc);
|
||||
|
||||
{if isset($selected_hotels)}
|
||||
$('#no_default_category').hide();
|
||||
{assign var=imploded_selected_hotels value='","'|implode:$selected_hotels}
|
||||
var selected_hotels = new Array("{$imploded_selected_hotels}");
|
||||
|
||||
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}').find(':input.select_hotel').each(function(){
|
||||
if ($.inArray($(this).val(), selected_hotels) != -1)
|
||||
{
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents('ul.tree').each(function(){
|
||||
$(this).show();
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
});
|
||||
}
|
||||
});
|
||||
{/if}
|
||||
|
||||
{if isset($selected_roomtypes)}
|
||||
$('#no_default_category').hide();
|
||||
{assign var=imploded_selected_hotels value='","'|implode:$selected_roomtypes}
|
||||
var selected_roomtypes = new Array("{$imploded_selected_hotels}");
|
||||
|
||||
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}').find(':input.select_room_type').each(function(){
|
||||
if ($.inArray($(this).val(), selected_roomtypes) != -1)
|
||||
{
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents('ul.tree').each(function(){
|
||||
$(this).show();
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
});
|
||||
}
|
||||
});
|
||||
{/if}
|
||||
}
|
||||
startTree();
|
||||
</script>
|
||||
@@ -1,31 +0,0 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<div class="tree-actions pull-right">
|
||||
{if isset($actions)}
|
||||
{foreach from=$actions item=action}
|
||||
{$action->render()}
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
@@ -234,13 +234,13 @@
|
||||
</div>
|
||||
<div class="form-group" id="associated_hotel_rooms_tree" {if $product->service_product_type == Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE}style="display:none;"{/if}>
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="category_box" type="category_box"}</span></div>
|
||||
<label class="control-label col-lg-2" for="category_block">
|
||||
<label class="control-label col-lg-2" for="hotel_block">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select room type and hotels for which this service will be available.'}">
|
||||
{l s='Associated Hotels and Room Types'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<div id="category_block">
|
||||
<div id="hotel_block">
|
||||
{$hotel_tree}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
{assign var=shown_room_type_price value=$data.product_price_tax_excl}
|
||||
{/if}
|
||||
<div class="input-group">
|
||||
<input type="text" class="room_unit_price" value="{$shown_room_type_price|escape:'html':'UTF-8'}">
|
||||
<input type="text" class="room_unit_price" value="{Tools::ps_round($shown_room_type_price, $smarty.const._PS_PRICE_DISPLAY_PRECISION_)|escape:'html':'UTF-8'}">
|
||||
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<td>{dateFormat date=$data['date_from']} {l s='To'} {dateFormat date=$data['date_to']}</td>
|
||||
<td>
|
||||
{if $order->with_occupancy && $data['children']}
|
||||
<div class="dropdown booking_occupancy_show">
|
||||
<div class="dropdown">
|
||||
<a data-toggle="dropdown">
|
||||
<span>{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
|
||||
</a>
|
||||
@@ -62,7 +62,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
<span class="booking_occupancy_show">{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
|
||||
<span>{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
|
||||
@@ -35,33 +35,11 @@
|
||||
<p><a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&id_product={$data.id_product}&updateproduct" target="_blank"><span>{$data.room_type}</span></a></p>
|
||||
</td>
|
||||
<td>
|
||||
<span class="booking_duration_show">{dateFormat date=$data.date_from} - {dateFormat date=$data.date_to}</span>
|
||||
|
||||
{if $can_edit}
|
||||
<div class="booking_duration_edit" style="display:none;">
|
||||
<div class="form-group">
|
||||
<div class="fixed-width-xl room_check_in_div">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">{l s='Check In'}</div>
|
||||
<input type="text" class="form-control edit_product_date_from" name="edit_product[date_from]" value="{$data.date_from|date_format:"%d-%m-%Y"}" data-min_date="{$data.date_from|date_format:"%d-%m-%Y"}"/>
|
||||
<div class="input-group-addon"><i class="icon-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="fixed-width-xl room_check_out_div">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">{l s='Check Out'}</div>
|
||||
<input type="text" class="form-control edit_product_date_to" name="edit_product[date_to]" value="{$data.date_to|date_format:"%d-%m-%Y"}" data-min_date="{$data.date_from|date_format:"%d-%m-%Y"}"/>
|
||||
<div class="input-group-addon"><i class="icon-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{dateFormat date=$data.date_from} - {dateFormat date=$data.date_to}
|
||||
</td>
|
||||
<td>
|
||||
{if $data['children']}
|
||||
<div class="dropdown booking_occupancy_show">
|
||||
<div class="dropdown">
|
||||
<a data-toggle="dropdown">
|
||||
<span>{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
|
||||
</a>
|
||||
@@ -81,122 +59,31 @@
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
<span class="booking_occupancy_show">{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
|
||||
{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
|
||||
{/if}
|
||||
<div class="booking_occupancy_edit" style="display:none;">
|
||||
<div class="dropdown">
|
||||
<button class="booking_guest_occupancy btn btn-default btn-left btn-block input-occupancy" type="button">
|
||||
<span>
|
||||
{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
|
||||
</span>
|
||||
</button>
|
||||
<div class="dropdown-menu booking_occupancy_wrapper fixed-width-xxl well well-sm">
|
||||
<div class="booking_occupancy_inner row">
|
||||
<div class="occupancy_info_block col-sm-12" occ_block_index="0">
|
||||
<div class="row">
|
||||
<div class="col-xs-6 form-group occupancy_count_block">
|
||||
<div class="col-sm-12">
|
||||
<label>{l s='Adults'}</label>
|
||||
<input type="number" class="form-control num_occupancy num_adults" name="occupancy[0][adults]" value="{$data['adults']}" min="1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 form-group occupancy_count_block">
|
||||
<div class="col-sm-12">
|
||||
<label>{l s='Child'} <span class="label-desc-txt"></span></label>
|
||||
<input type="number" class="form-control num_occupancy num_children" name="occupancy[0][children]" value="{$data['children']}" min="0">
|
||||
({l s='Below'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years'})
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p style="display:none;"><span class="text-danger occupancy-input-errors"></span></p>
|
||||
<div class="row children_age_info_block" {if !isset($data['child_ages']) || !$data['child_ages']}style="display:none"{/if}>
|
||||
<div class="col-sm-12 form-group">
|
||||
<label class="col-sm-12">{l s='All Children'}</label>
|
||||
<div class="col-sm-12">
|
||||
<div class="row children_ages">
|
||||
{if isset($data['child_ages']) && $data['child_ages']}
|
||||
{foreach $data['child_ages'] as $childAge}
|
||||
<p class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
|
||||
<select class="guest_child_age room_occupancies" name="occupancy[0][child_ages][]">
|
||||
<option value="-1" {if $childAge == -1}selected{/if}>{l s='Select 1'}</option>
|
||||
<option value="0" {if $childAge == 0}selected{/if}>{l s='Under 1'}</option>
|
||||
{for $age=1 to ($max_child_age-1)}
|
||||
<option value="{$age|escape:'htmlall':'UTF-8'}" {if $childAge == $age}selected{/if}>{$age|escape:'htmlall':'UTF-8'}</option>
|
||||
{/for}
|
||||
</select>
|
||||
</p>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="occupancy-info-separator col-sm-12">
|
||||
<div class="col-sm-12">
|
||||
<a class="pull-right close_occupancy_link" href="#">{l s='close'} <i class="icon-remove"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span class="room_unit_price_show">
|
||||
<p>
|
||||
<span class="room_type_current_price">
|
||||
{convertPriceWithCurrency price=$data['total_price_tax_excl'] currency=$currency->id}
|
||||
</span>
|
||||
</p>
|
||||
<p class="help-block">{l s='Per day price:'} {convertPriceWithCurrency price=$data['paid_unit_price_tax_excl'] currency=$currency->id}</p>
|
||||
</span>
|
||||
<div class="room_unit_price_edit" style="display: none;">
|
||||
<input class="form-control" type="text" class="room_unit_price" name="room_unit_price" value="{$data['paid_unit_price_tax_excl']}">
|
||||
<p class="help-block">{l s='Set per day price'}</p>
|
||||
</div>
|
||||
<p>
|
||||
<span class="room_type_current_price">
|
||||
{convertPriceWithCurrency price=$data['total_price_tax_excl'] currency=$currency->id}
|
||||
</span>
|
||||
</p>
|
||||
<p class="help-block">{l s='Per day price:'} {convertPriceWithCurrency price=$data['paid_unit_price_tax_excl'] currency=$currency->id}</p>
|
||||
</td>
|
||||
<td>
|
||||
<span class="extra_service_show">
|
||||
{convertPriceWithCurrency price=($data['extra_demands_price_te'] + $data['additional_services_price_te'] + $data['convenience_fee_te'] + $data['additional_services_price_auto_add_te']) currency=$currency->id}
|
||||
{if $data['extra_demands']|count || $data['additional_services']|count}
|
||||
<a class="open_room_extra_services" href="#" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" id_htl_booking="{$data['id']}">
|
||||
<i class="icon icon-lg icon-info-circle"></i>
|
||||
</a>
|
||||
{/if}
|
||||
</span>
|
||||
<span class="extra_service_edit" style="display: none;">
|
||||
{convertPriceWithCurrency price=($data['extra_demands_price_te'] + $data['additional_services_price_te'] + $data['convenience_fee_te'] + $data['additional_services_price_auto_add_te']) currency=$currency->id}
|
||||
{if $data['extra_demands']|count || $data['additional_services']|count}
|
||||
<a class="open_room_extra_services" href="#" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" id_htl_booking="{$data['id']}">
|
||||
{convertPriceWithCurrency price=($data['extra_demands_price_te'] + $data['additional_services_price_te'] + $data['convenience_fee_te'] + $data['additional_services_price_auto_add_te']) currency=$currency->id}
|
||||
<i class="icon icon-lg icon-info-circle"></i>
|
||||
</a>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="product_price_show">{convertPriceWithCurrency price=($data['total_room_tax']) currency=$currency->id}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="product_price_show">{convertPriceWithCurrency price=($data['total_room_price_ti']) currency=$currency->id}</span>
|
||||
{if $can_edit}
|
||||
<div class="product_price_edit" style="display:none;">
|
||||
<div class="form-group">
|
||||
<div class="fixed-width-xl">
|
||||
<div class="input-group">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
|
||||
<input type="text" name="product_price_tax_excl" class="edit_product_price_tax_excl edit_product_price" value="{Tools::ps_round($data.original_unit_price_tax_excl, 2)}"/>
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="fixed-width-xl">
|
||||
<div class="input-group">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
|
||||
<input type="text" name="product_price_tax_incl" class="edit_product_price_tax_incl edit_product_price" value="{Tools::ps_round($data.original_unit_price_tax_incl, 2)}"/>
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{convertPriceWithCurrency price=($data['total_room_tax']) currency=$currency->id}
|
||||
</td>
|
||||
<td>
|
||||
{convertPriceWithCurrency price=($data['total_room_price_ti']) currency=$currency->id}
|
||||
</td>
|
||||
{if (isset($refundReqBookings) && $refundReqBookings)}
|
||||
<td>
|
||||
{if $data.id|in_array:$refundReqBookings}
|
||||
@@ -220,19 +107,6 @@
|
||||
</td>
|
||||
{/if}
|
||||
{if ($can_edit && !$order->hasBeenDelivered())}
|
||||
<td class="product_invoice" style="display: none;">
|
||||
{if sizeof($invoices_collection)}
|
||||
<select name="product_invoice" class="edit_product_invoice">
|
||||
{foreach from=$invoices_collection item=invoice}
|
||||
<option value="{$invoice->id}">
|
||||
#{Configuration::get('PS_INVOICE_PREFIX', $current_id_lang, null, $order->id_shop)}{'%06d'|sprintf:$invoice->number}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
{else}
|
||||
|
||||
{/if}
|
||||
</td>
|
||||
<td class="product_action">
|
||||
<div class="btn-group">
|
||||
{if isset($refundReqBookings) && $refundReqBookings && $data.id|in_array:$refundReqBookings && $data.is_cancelled}
|
||||
|
||||
@@ -275,7 +275,7 @@
|
||||
id_room: parseInt($(cart_row).attr('data-id-room')),
|
||||
date_from: $(cart_row).attr('data-date-from'),
|
||||
date_to: $(cart_row).attr('data-date-to'),
|
||||
price: new Number($(this).val().replace(",",".")).toFixed(4).toString(),
|
||||
price: new Number($(this).val().replace(",",".")).toString(),
|
||||
id_cart: id_cart
|
||||
};
|
||||
updateProductPrice(params, cart_row);
|
||||
@@ -667,6 +667,8 @@
|
||||
tab: "AdminCarts",
|
||||
action: "updateProductPrice",
|
||||
params: params,
|
||||
id_cart: id_cart,
|
||||
id_customer: id_customer
|
||||
},
|
||||
success : function(response) {
|
||||
updateCartLine(response.curr_booking_info, cart_row);
|
||||
@@ -1457,22 +1459,12 @@
|
||||
$('#address_delivery, #address_invoice').show();
|
||||
}
|
||||
|
||||
/*Changed by webkul to make delivery and invoice addresses same*/
|
||||
$('#id_address_delivery').html(addresses_delivery_options).hide();
|
||||
$('#id_address_invoice').html(addresses_delivery_options).hide();
|
||||
$('#address_delivery_detail').html(address_delivery_detail);
|
||||
$('#address_invoice_detail').html(address_delivery_detail);
|
||||
$('#edit_delivery_address').attr('href', delivery_address_edit_link);
|
||||
$('#edit_invoice_address').attr('href', delivery_address_edit_link);
|
||||
/*END*/
|
||||
|
||||
/*Original*/
|
||||
/*$('#id_address_delivery').html(addresses_delivery_options);
|
||||
$('#id_address_invoice').html(addresses_invoice_options);
|
||||
$('#id_address_invoice').html(addresses_invoice_options).hide();
|
||||
$('#address_delivery_detail').html(address_delivery_detail);
|
||||
$('#address_invoice_detail').html(address_invoice_detail);
|
||||
$('#edit_delivery_address').attr('href', delivery_address_edit_link);
|
||||
$('#edit_invoice_address').attr('href', invoice_address_edit_link);*/
|
||||
$('#edit_invoice_address').attr('href', invoice_address_edit_link);
|
||||
}
|
||||
|
||||
function updateAddresses()
|
||||
@@ -2002,7 +1994,7 @@
|
||||
<div id="addresses_err" class="alert alert-warning" style="display:none;"></div>
|
||||
|
||||
<div class="row">
|
||||
<div id="address_delivery" class="col-xs-6 col-sm-6">
|
||||
<div id="address_delivery" class="col-xs-6 col-sm-6 hidden">
|
||||
<h4>
|
||||
<i class="icon-map-marker"></i>
|
||||
{l s='Customer Address'}
|
||||
@@ -2015,7 +2007,7 @@
|
||||
<div id="address_delivery_detail"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="address_invoice" class="col-lg-6 hidden">
|
||||
<div id="address_invoice" class="col-lg-6">
|
||||
<h4>
|
||||
<i class="icon-file-text"></i>
|
||||
{l s='Invoice'}
|
||||
|
||||
@@ -554,11 +554,10 @@
|
||||
|
||||
<dd><i class="icon-user"></i> <b><a href="?tab=AdminCustomers&id_customer={$customer->id}&viewcustomer&token={getAdminToken tab='AdminCustomers'}">{$customer->firstname} {$customer->lastname}</a></b></dd>
|
||||
<dd><i class="icon-envelope"></i> <b><a href="mailto:{$customer->email}">{$customer->email}</a></b></dd>
|
||||
{if $addresses.invoice->phone_mobile || $addresses.invoice->phone}
|
||||
<dd><i class="icon-phone"></i> <b><a href="tel:{if $addresses.invoice->phone_mobile}{$addresses.invoice->phone_mobile}{else}{$addresses.invoice->phone}{/if}">{if $addresses.invoice->phone_mobile}{$addresses.invoice->phone_mobile}{else}{$addresses.invoice->phone}{/if}</a></b></dd>
|
||||
{if $customer->phone}
|
||||
<dd><i class="icon-phone"></i> <b><a href="tel:{$customer->phone}">{$customer->phone}</a></b></dd>
|
||||
{/if}
|
||||
</dl>
|
||||
|
||||
<form method="post" action="index.php?tab=AdminCustomers&id_customer={$customer->id}&id_order={$order->id|intval}&token={getAdminToken tab='AdminCustomers'}">
|
||||
<input type="hidden" name="id_lang" value="{$order->id_lang}" />
|
||||
<input class="btn btn-primary" type="submit" name="submitGuestToCustomer" value="{l s='Transform this guest into a customer'}" />
|
||||
@@ -575,8 +574,8 @@
|
||||
|
||||
<dd><i class="icon-user"></i> <b><a href="?tab=AdminCustomers&id_customer={$customer->id}&viewcustomer&token={getAdminToken tab='AdminCustomers'}">{$customer->firstname} {$customer->lastname}</a></b></dd>
|
||||
<dd><i class="icon-envelope"></i> <b><a href="mailto:{$customer->email}">{$customer->email}</a></b></dd>
|
||||
{if $addresses.invoice->phone_mobile || $addresses.invoice->phone}
|
||||
<dd><i class="icon-phone"></i> <b><a href="tel:{if $addresses.invoice->phone_mobile}{$addresses.invoice->phone_mobile}{else}{$addresses.invoice->phone}{/if}">{if $addresses.invoice->phone_mobile}{$addresses.invoice->phone_mobile}{else}{$addresses.invoice->phone}{/if}</a></b></dd>
|
||||
{if $customer->phone}
|
||||
<dd><i class="icon-phone"></i> <b><a href="tel:{$customer->phone}">{$customer->phone}</a></b></dd>
|
||||
{/if}
|
||||
</dl>
|
||||
<dl class="list-detail col-sm-6">
|
||||
@@ -837,7 +836,7 @@
|
||||
<div class="col-lg-4 col-sm-6 col-xs-12 pull-right">
|
||||
<div class="panel panel-total">
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<table class="table" id="order-details-price">
|
||||
{* Assign order price *}
|
||||
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
|
||||
{assign var=order_product_price value=($order->total_products)}
|
||||
@@ -855,6 +854,8 @@
|
||||
{assign var=room_price_tax_incl value=$order->getTotalProductsWithTaxes(false, true)}
|
||||
{assign var=service_products_price_tax_excl value=$order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE)}
|
||||
{assign var=service_products_price_tax_incl value=$order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE)}
|
||||
{assign var=convenience_fee_price_tax_excl value=$order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT)}
|
||||
{assign var=convenience_fee_price_tax_incl value=$order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT)}
|
||||
{assign var=additional_service_price_tax_excl value=($order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $totalDemandsPriceTE)}
|
||||
{assign var=additional_service_price_tax_incl value=($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $totalDemandsPriceTI)}
|
||||
{if $room_price_tax_excl}
|
||||
@@ -870,7 +871,7 @@
|
||||
<tr id="total_products">
|
||||
<td class="text-right">{l s='Total Extra services (Tax excl.)'}</td>
|
||||
<td class="amount text-right nowrap">
|
||||
{displayPrice price=($additional_service_price_tax_excl - $totalConvenienceFeeTE) currency=$currency->id}
|
||||
{displayPrice price=($additional_service_price_tax_excl - $convenience_fee_price_tax_excl) currency=$currency->id}
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
@@ -885,52 +886,84 @@
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{if isset($totalConvenienceFeeTE) && $totalConvenienceFeeTE > 0}
|
||||
{if isset($convenience_fee_price_tax_excl) && $convenience_fee_price_tax_excl > 0}
|
||||
<tr id="total_products">
|
||||
<td class="text-right">{l s='Convenience Fee (Tax excl.)'}</td>
|
||||
<td class="text-right">
|
||||
{l s='Convenience Fee (Tax excl.)'}
|
||||
{if isset($booking_auto_added_services) && count($booking_auto_added_services)}
|
||||
<span role="button" id="view_convenience_services" class="pull-left"><i class="icon-angle-down icon-bold"></i><i class="icon-angle-up icon-bold" style="display:none;"></i></span>
|
||||
{/if}
|
||||
</td>
|
||||
<td class="amount text-right nowrap">
|
||||
{displayPrice price=$totalConvenienceFeeTE currency=$currency->id}
|
||||
{displayPrice price=$convenience_fee_price_tax_excl currency=$currency->id}
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{if isset($booking_auto_added_services) && count($booking_auto_added_services)}
|
||||
<tr id="convenience_services" style="display:none;">
|
||||
<td colspan="3" class="panel">
|
||||
<table class="table table-responsive">
|
||||
<tbody>
|
||||
{foreach $booking_auto_added_services as $service}
|
||||
<tr>
|
||||
<td class="text-left"><span>{$service.name}</span></td>
|
||||
<td class="text-right"><span>{displayPrice price=$service.total_price_tax_excl currency=$currency->id}</span></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{if $room_price_tax_excl}
|
||||
<tr id="total_tax_order">
|
||||
<td class="text-right">{l s='Total Rooms Tax'}</td>
|
||||
<td class="text-right nowrap">
|
||||
{displayPrice price=($room_price_tax_incl - $room_price_tax_excl) currency=$currency->id}
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if isset($additional_service_price_tax_excl) && $additional_service_price_tax_excl > 0}
|
||||
<tr id="total_tax_order">
|
||||
<td class="text-right">{l s='Extra services Tax'}</td>
|
||||
<td class="text-right nowrap">
|
||||
{displayPrice price=(($additional_service_price_tax_incl - $additional_service_price_tax_excl) - ($totalConvenienceFeeTI - $totalConvenienceFeeTE)) currency=$currency->id}
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if isset($totalConvenienceFeeTE) && $totalConvenienceFeeTE > 0}
|
||||
<tr id="total_products">
|
||||
<td class="text-right">{l s='Convenience Fee Tax'}</td>
|
||||
<td class="amount text-right nowrap">
|
||||
{displayPrice price=($totalConvenienceFeeTI - $totalConvenienceFeeTE) currency=$currency->id}
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{* {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)} *}
|
||||
<tr id="total_taxes">
|
||||
<td class="text-right"><strong>{l s='Total Taxes'}</strong>
|
||||
<td class="text-right">
|
||||
<strong>{l s='Total Taxes'} </strong>
|
||||
{if ($order->total_paid_tax_incl - $order->total_paid_tax_excl) > 0}
|
||||
<span role="button" id="view_order_tax_details" class="pull-left"><i class="icon-angle-down icon-bold"></i><i class="icon-angle-up icon-bold" style="display:none;"></i></span>
|
||||
{/if}
|
||||
</td>
|
||||
<td class="amount text-right nowrap" ><strong>{displayPrice price=(($order->total_paid_tax_incl + $order->total_discounts_tax_incl) - ($order->total_paid_tax_excl + $order->total_discounts_tax_excl)) currency=$currency->id}</strong>
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{if ($order->total_paid_tax_incl - $order->total_paid_tax_excl) > 0}
|
||||
<tr id="order_tax_details" style="display:none;">
|
||||
<td colspan="3" class="panel">
|
||||
<table class="table table-responsive">
|
||||
<tbody>
|
||||
{if $room_price_tax_excl}
|
||||
<tr>
|
||||
<td class="text-left">{l s='Total Rooms Tax'}</td>
|
||||
<td class="text-right">
|
||||
{displayPrice price=($room_price_tax_incl - $room_price_tax_excl) currency=$currency->id}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if isset($additional_service_price_tax_incl) && (($additional_service_price_tax_incl - $additional_service_price_tax_excl) - ($convenience_fee_price_tax_incl - $convenience_fee_price_tax_excl)) > 0}
|
||||
<tr>
|
||||
<td class="text-left">{l s='Extra services Tax'}</td>
|
||||
<td class="text-right nowrap">
|
||||
{displayPrice price=(($additional_service_price_tax_incl - $additional_service_price_tax_excl) - ($convenience_fee_price_tax_incl - $convenience_fee_price_tax_excl)) currency=$currency->id}
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if isset($convenience_fee_price_tax_excl) && $convenience_fee_price_tax_excl > 0}
|
||||
<tr id="total_products">
|
||||
<td class="text-left">{l s='Convenience Fee Tax'}</td>
|
||||
<td class="amount text-right nowrap">
|
||||
{displayPrice price=($convenience_fee_price_tax_incl - $convenience_fee_price_tax_excl) currency=$currency->id}
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{* {/if} *}
|
||||
<tr id="total_discounts" {if $order->total_discounts_tax_incl == 0}style="display: none;"{/if}>
|
||||
<td class="text-right"><strong>{l s='Total Booking Amount'}</strong></td>
|
||||
@@ -1098,13 +1131,13 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="col-lg-4 col-sm-6 col-xs-12">
|
||||
<div class="col-lg-4 col-sm-6 col-xs-12 hidden-print">
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-envelope"></i> {l s='Messages'} <span class="badge">{sizeof($customer_thread_message)}</span>
|
||||
<a href="{$link->getAdminLink('AdminCustomerThreads')|escape:'html':'UTF-8'}&id_order={$order->id|intval}" class="pull-right">{l s='Show all messages'}</a>
|
||||
</div>
|
||||
<div id="messages" class="hidden-print">
|
||||
<div id="messages">
|
||||
<form action="{$smarty.server.REQUEST_URI|escape:'html':'UTF-8'}&token={$smarty.get.token|escape:'html':'UTF-8'}" method="post" onsubmit="if (getE('visibility').checked == true) return confirm('{l s='Do you want to send this message to the customer?'}');">
|
||||
<div id="message" class="form-horizontal">
|
||||
<div class="form-group">
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
* @license LICENSE.txt
|
||||
*}
|
||||
|
||||
<a href="{$status_change_link|escape:'html':'UTF-8'}" title="{l s='Change Status'}">
|
||||
<a href="{$status_change_link|escape:'html':'UTF-8'}" title="{l s='Change Status'}" class="change_status">
|
||||
<i class="icon-refresh"></i>
|
||||
{l s='Change Status'}
|
||||
</a>
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
{*
|
||||
* Since 2010 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><i class="icon-remove-sign"></i></button>
|
||||
<h4 class="modal-title"><i class="icon icon-exclamation-triangle"></i> {l s='Confirm Update'}</h4>
|
||||
<p>{l s='This action is irreversable, Are you sure you want to change the status?'}</p>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<label>{l s='Credit Slip'}</label>
|
||||
<p class="control-value">
|
||||
<a href="{$link->getAdminLink('AdminCartRules')}&updatecart_rule&id_cart_rule={$orderSlip->id}" target="_blank">#{$orderSlip->id}</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label>{l s='Amount'}</label>
|
||||
<p class="control-value">{displayPrice price=$orderSlip->amount currency=$order->id_currency}</p>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label>{l s='Customer'}</label>
|
||||
<p class="control-value">
|
||||
{$customer->firstname} {$customer->lastname} (<a href="{$link->getAdminLink('AdminCustomers')}&viewcustomer&id_customer={$customer->id}" target="_blank">#{$customer->id}</a>)
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label>{l s='Order'}</label>
|
||||
<p class="control-value">
|
||||
{$order->reference} (<a href="{$link->getAdminLink('AdminOrders')}&vieworder&id_order={$order->id}" target="_blank">#{$order->id}</a>)
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -22,11 +22,100 @@
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<div class="panel">
|
||||
{if isset($header)}{$header}{/if}
|
||||
{if isset($nodes)}
|
||||
<ul id="{$id|escape:'html':'UTF-8'}" class="tree">
|
||||
{$nodes}
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
{block name="tree_panel"}
|
||||
|
||||
<div class="panel">
|
||||
{block name="tree_header"}
|
||||
{if isset($header)}{$header}{/if}
|
||||
{/block}
|
||||
{block name="tree"}
|
||||
{if isset($nodes)}
|
||||
<ul id="{$id|escape:'html':'UTF-8'}" class="tree top" style="max-height: {$max_height}px;">
|
||||
{$nodes}
|
||||
</ul>
|
||||
{/if}
|
||||
{/block}
|
||||
</div>
|
||||
{/block}
|
||||
<script type="text/javascript">
|
||||
{block name="script"}
|
||||
{if isset($use_checkbox) && $use_checkbox == true}
|
||||
function checkAll($tree)
|
||||
{
|
||||
$tree.find(":input[type=checkbox]").each(
|
||||
function()
|
||||
{
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function uncheckAll($tree)
|
||||
{
|
||||
$tree.find(":input[type=checkbox]").each(
|
||||
function()
|
||||
{
|
||||
$(this).prop("checked", false);
|
||||
$(this).parent().removeClass("tree-selected");
|
||||
}
|
||||
);
|
||||
}
|
||||
{/if}
|
||||
{if isset($use_search) && $use_search == true}
|
||||
$("#{$id|escape:'html':'UTF-8'}-search").bind("typeahead:selected", function(obj, datum) {
|
||||
$("#{$id|escape:'html':'UTF-8'}").find(":input").each(
|
||||
function()
|
||||
{
|
||||
if ($(this).val() == datum.value)
|
||||
{
|
||||
{if (!(isset($use_checkbox) && $use_checkbox == true))}
|
||||
$("#{$id|escape:'html':'UTF-8'} label").removeClass("tree-selected");
|
||||
{/if}
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents('ul.tree').each(function(){
|
||||
$(this).show();
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
{/if}
|
||||
|
||||
{if isset($auto_select_children) && $auto_select_children == true}
|
||||
$('#{$id|escape:'html':'UTF-8'}').find(':input[type=checkbox]').on('click', function(){
|
||||
if ($(this).is(":checked")) {
|
||||
$(this).closest('.tree-folder').find(':input[type=checkbox]').each(function(){
|
||||
$(this).prop('checked', true);
|
||||
$(this).parent().addClass('tree-selected');
|
||||
});
|
||||
} else {
|
||||
$(this).closest('.tree-folder').find(':input[type=checkbox]').each(function(){
|
||||
$(this).prop('checked', false);
|
||||
$(this).parent().removeClass('tree-selected');
|
||||
});
|
||||
}
|
||||
});
|
||||
{/if}
|
||||
|
||||
$(document).ready(function () {
|
||||
var tree = $("#{$id|escape:'html':'UTF-8'}").tree('collapseAll');
|
||||
|
||||
|
||||
if ($("#{$id|escape:'html':'UTF-8'}").find(":input:checked").length > 1)
|
||||
$('#expand-all-{$id|escape:'html':'UTF-8'}').hide();
|
||||
else
|
||||
$('#collapse-all-{$id|escape:'html':'UTF-8'}').hide();
|
||||
|
||||
$("#{$id|escape:'html':'UTF-8'}").find(":input:checked").each(function(){
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents('ul.tree').each(function(){
|
||||
$(this).show();
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
});
|
||||
});
|
||||
});
|
||||
{/block}
|
||||
</script>
|
||||
@@ -69,7 +69,7 @@
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents('ul.tree').each(function(){
|
||||
$(this).show();
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents('ul.tree').each(function(){
|
||||
$(this).show();
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<div class="panel">
|
||||
{if isset($header)}{$header}{/if}
|
||||
{if isset($nodes)}
|
||||
<ul id="{$id|escape:'html':'UTF-8'}" class="cattree tree">
|
||||
{$nodes}
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var currentToken="{$token|@addslashes}";
|
||||
{if isset($use_checkbox) && $use_checkbox == true}
|
||||
function checkAllAssociatedCategories($tree)
|
||||
{
|
||||
$tree.find(":input[type=checkbox]").each(
|
||||
function()
|
||||
{
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function uncheckAllAssociatedCategories($tree)
|
||||
{
|
||||
$tree.find(":input[type=checkbox]").each(
|
||||
function()
|
||||
{
|
||||
$(this).prop("checked", false);
|
||||
$(this).parent().removeClass("tree-selected");
|
||||
}
|
||||
);
|
||||
}
|
||||
{/if}
|
||||
{if isset($use_search) && $use_search == true}
|
||||
$("#{$id|escape:'html':'UTF-8'}-categories-search").bind("typeahead:selected", function(obj, datum) {
|
||||
$("#{$id|escape:'html':'UTF-8'}").find(":input").each(
|
||||
function()
|
||||
{
|
||||
if ($(this).val() == datum.id_category)
|
||||
{
|
||||
{if (!(isset($use_checkbox) && $use_checkbox == true))}
|
||||
$("#{$id|escape:'html':'UTF-8'} label").removeClass("tree-selected");
|
||||
{/if}
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents('ul.tree').each(function(){
|
||||
$(this).show();
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
{/if}
|
||||
$(document).ready(function () {
|
||||
$("#{$id|escape:'html':'UTF-8'}").tree("collapseAll");
|
||||
|
||||
{if isset($selected_categories)}
|
||||
{assign var=imploded_selected_categories value='","'|implode:$selected_categories}
|
||||
var selected_categories = new Array("{$imploded_selected_categories}");
|
||||
|
||||
$("#{$id|escape:'html':'UTF-8'}").find(":input").each(
|
||||
function()
|
||||
{
|
||||
if ($.inArray($(this).val(), selected_categories) != -1)
|
||||
{
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents('ul.tree').each(function(){
|
||||
$(this).show();
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
{/if}
|
||||
});
|
||||
</script>
|
||||
@@ -27,6 +27,12 @@
|
||||
<i class="icon-folder-close"></i>
|
||||
<label class="tree-toggler">{$node['name']|escape:'html':'UTF-8'}</label>
|
||||
</span>
|
||||
{if isset($node['badge'])}
|
||||
<span class="badge {if isset($node['badge']['class'])}{$node['badge']['class']}{/if}">{$node['badge']['title']}</span>
|
||||
{/if}
|
||||
{if isset($node['hint'])}
|
||||
<div class="node-hint">{$node['hint']}</div>
|
||||
{/if}
|
||||
<ul class="tree">
|
||||
{$children|escape:'UTF-8'}
|
||||
</ul>
|
||||
|
||||
@@ -24,12 +24,18 @@
|
||||
*}
|
||||
<li class="tree-folder">
|
||||
<span class="tree-folder-name{if isset($node['disabled']) && $node['disabled'] == true} tree-folder-name-disable{/if}">
|
||||
{if isset($node['id_category']) && $node['id_category'] != $root_category}
|
||||
<input type="checkbox" name="{$input_name}[]" value="{$node['id_category']}"{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} />
|
||||
{if !isset($selectable) || $selectable}
|
||||
<input type="checkbox" name="{$node['input_name']}[]" value="{$node['value']}"{if isset($node['selected']) && $node['selected'] == true} checked="checked"{/if}{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} />
|
||||
{/if}
|
||||
<i class="icon-folder-close"></i>
|
||||
<label class="tree-toggler">{if isset($node['name'])}{$node['name']|escape:'html':'UTF-8'}{/if}{if isset($node['selected_childs']) && (int)$node['selected_childs'] > 0} {l s='(%s selected)' sprintf=$node['selected_childs']}{/if}</label>
|
||||
</span>
|
||||
{if isset($node['badge'])}
|
||||
<span class="badge {if isset($node['badge']['class'])}{$node['badge']['class']}{/if}">{$node['badge']['title']}</span>
|
||||
{/if}
|
||||
{if isset($node['hint'])}
|
||||
<div class="node-hint">{$node['hint']}</div>
|
||||
{/if}
|
||||
<ul class="tree">
|
||||
{$children|escape:'UTF-8'}
|
||||
</ul>
|
||||
|
||||
@@ -24,12 +24,18 @@
|
||||
*}
|
||||
<li class="tree-folder">
|
||||
<span class="tree-folder-name{if isset($node['disabled']) && $node['disabled'] == true} tree-folder-name-disable{/if}">
|
||||
{if $node['id_category'] != $root_category}
|
||||
<input type="radio" name="{$input_name}" value="{$node['id_category']}"{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} />
|
||||
{if !isset($selectable) || $selectable}
|
||||
<input type="radio" name="{$node['input_name']}" value="{$node['value']}"{if isset($node['selected']) && $node['selected'] == true} checked="checked"{/if}{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} />
|
||||
{/if}
|
||||
<i class="icon-folder-close"></i>
|
||||
<label class="tree-toggler">{$node['name']|escape:'html':'UTF-8'}</label>
|
||||
</span>
|
||||
{if isset($node['badge'])}
|
||||
<span class="badge {if isset($node['badge']['class'])}{$node['badge']['class']}{/if}">{$node['badge']['title']}</span>
|
||||
{/if}
|
||||
{if isset($node['hint'])}
|
||||
<div class="node-hint">{$node['hint']}</div>
|
||||
{/if}
|
||||
<ul class="tree">
|
||||
{$children}
|
||||
</ul>
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<li class="tree-folder">
|
||||
<span class="tree-folder-name{if isset($node['disabled']) && $node['disabled'] == true} tree-folder-name-disable{/if}">
|
||||
{if isset($node['id_hotel'])}
|
||||
<input type="checkbox" class="select_hotel" name="{$input_name}[]" value="{$node['id_hotel']}"{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} />
|
||||
{* {if isset($node['id_category']) && $node['id_category'] != $root_category} *}
|
||||
{/if}
|
||||
<i class="icon-folder-close"></i>
|
||||
<label class="tree-toggler">{if isset($node['name'])}{$node['name']|escape:'html':'UTF-8'}{/if}{if isset($node['selected_childs']) && (int)$node['selected_childs'] > 0} {l s='(%s selected)' sprintf=$node['selected_childs']}{/if}</label>
|
||||
</span>
|
||||
<ul class="tree">
|
||||
{$children|escape:'UTF-8'}
|
||||
</ul>
|
||||
</li>
|
||||
@@ -1,31 +0,0 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<li class="tree-item{if isset($node['disabled']) && $node['disabled'] == true} tree-item-disable{/if}">
|
||||
<span class="tree-item-name{if isset($node['disabled']) && $node['disabled'] == true} tree-item-name-disable{/if}">
|
||||
<input type="checkbox" class="select_room_type" name="{$input_name}[]" value="{$node['id_product']}"{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} />
|
||||
<i class="tree-dot"></i>
|
||||
<label class="tree-toggler">{$node['room_type']}</label>
|
||||
</span>
|
||||
</li>
|
||||
@@ -28,4 +28,10 @@
|
||||
<i class="tree-dot"></i>
|
||||
<label class="tree-toggler">{$node['name']}</label>
|
||||
</span>
|
||||
{if isset($node['badge'])}
|
||||
<span class="badge {if isset($node['badge']['class'])}{$node['badge']['class']}{/if}">{$node['badge']['title']}</span>
|
||||
{/if}
|
||||
{if isset($node['hint'])}
|
||||
<div class="node-hint">{$node['hint']}</div>
|
||||
{/if}
|
||||
</li>
|
||||
@@ -24,8 +24,14 @@
|
||||
*}
|
||||
<li class="tree-item{if isset($node['disabled']) && $node['disabled'] == true} tree-item-disable{/if}">
|
||||
<span class="tree-item-name{if isset($node['disabled']) && $node['disabled'] == true} tree-item-name-disable{/if}">
|
||||
<input type="checkbox" name="{$input_name}[]" value="{$node['id_category']}"{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} />
|
||||
<input type="checkbox" name="{$node['input_name']}[]" value="{$node['value']}"{if isset($node['selected']) && $node['selected'] == true} checked="checked"{/if}{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} />
|
||||
<i class="tree-dot"></i>
|
||||
<label class="tree-toggler">{$node['name']}</label>
|
||||
</span>
|
||||
</li>
|
||||
{if isset($node['badge'])}
|
||||
<span class="badge {if isset($node['badge']['class'])}{$node['badge']['class']}{/if}">{$node['badge']['title']}</span>
|
||||
{/if}
|
||||
{if isset($node['hint'])}
|
||||
<div class="node-hint">{$node['hint']}</div>
|
||||
{/if}
|
||||
</li>
|
||||
|
||||
@@ -24,8 +24,14 @@
|
||||
*}
|
||||
<li class="tree-item{if isset($node['disabled']) && $node['disabled'] == true} tree-item-disable{/if}">
|
||||
<span class="tree-item-name">
|
||||
<input type="radio" name="{$input_name}" value="{$node['id_category']}"{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} />
|
||||
<input type="radio" name="{$node['input_name']}" value="{$node['value']}"{if isset($node['selected']) && $node['selected'] == true} checked="checked"{/if}{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} />
|
||||
<i class="tree-dot"></i>
|
||||
<label class="tree-toggler">{$node['name']}</label>
|
||||
</span>
|
||||
{if isset($node['badge'])}
|
||||
<span class="badge {if isset($node['badge']['class'])}{$node['badge']['class']}{/if}">{$node['badge']['title']}</span>
|
||||
{/if}
|
||||
{if isset($node['hint'])}
|
||||
<div class="node-hint">{$node['hint']}</div>
|
||||
{/if}
|
||||
</li>
|
||||
@@ -26,10 +26,10 @@
|
||||
<div class="modal-dialog {if isset($modal_class)}{$modal_class}{/if}">
|
||||
<div class="modal-content">
|
||||
{if isset($modal_title)}
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><i class="icon-remove-sign"></i></button>
|
||||
<h4 class="modal-title">{$modal_title}</h4>
|
||||
</div>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><i class="icon-remove-sign"></i></button>
|
||||
<h4 class="modal-title">{$modal_title}</h4>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{$modal_content}
|
||||
|
||||
@@ -149,13 +149,16 @@ class AddressCore extends ObjectModel
|
||||
protected $webserviceParameters = array(
|
||||
'objectsNodeName' => 'addresses',
|
||||
'fields' => array(
|
||||
'id_customer' => array('xlink_resource'=> 'customers'),
|
||||
'id_customer' => array('xlink_resource'=> 'customers', 'required' => true),
|
||||
'id_manufacturer' => array('xlink_resource'=> 'manufacturers'),
|
||||
'id_supplier' => array('xlink_resource'=> 'suppliers'),
|
||||
'id_warehouse' => array('xlink_resource'=> 'warehouse'),
|
||||
'id_country' => array('xlink_resource'=> 'countries'),
|
||||
'id_state' => array('xlink_resource'=> 'states'),
|
||||
),
|
||||
'hidden_fields' => array(
|
||||
'id_hotel'
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -551,4 +554,37 @@ class AddressCore extends ObjectModel
|
||||
)
|
||||
');
|
||||
}
|
||||
|
||||
public function validateFields($die = true, $error_return = false)
|
||||
{
|
||||
if (isset($this->webservice_validation) && $this->webservice_validation) {
|
||||
if (!$this->id_customer || !Validate::isLoadedObject(new Customer((int) $this->id_customer))) {
|
||||
$message = Tools::displayError('Invalid Id customer.');
|
||||
} elseif (Customer::getCustomerIdAddress($this->id_customer, false) && !$this->id) {
|
||||
$message = Tools::displayError('A single customer cannot have multiple addresses.');
|
||||
} elseif (!$this->id_country || !Validate::isLoadedObject($objCountry = new Country($this->id_country))) {
|
||||
$message = Tools::displayError('Invalid Id country');
|
||||
} elseif ($objCountry->contains_states
|
||||
&& (!$this->id_state || !Validate::isLoadedObject($objState = new State((int) $this->id_state)))
|
||||
) {
|
||||
$message = Tools::displayError('Invalid Id state');
|
||||
} elseif (isset($objState) && ($objCountry->id != $objState->id_country)) {
|
||||
$message = Tools::displayError('The given provided Id state does not belongs to the provided Id country');
|
||||
} elseif ($objCountry->zip_code_format && !$objCountry->checkZipCode($this->postcode)) {
|
||||
$message = Tools::displayError('Your Zip/postal code is incorrect');
|
||||
} elseif (empty($this->postcode) && $objCountry->need_zip_code) {
|
||||
$message = Tools::displayError('A Zip/postal code is required.');
|
||||
} elseif ($this->postcode && !Validate::isPostCode($this->postcode)) {
|
||||
$message = Tools::displayError('The Zip/postal code is invalid.');
|
||||
}
|
||||
|
||||
if (isset($message)) {
|
||||
if ($die) {
|
||||
throw new PrestaShopException($message);
|
||||
}
|
||||
return $error_return ? $message : false;
|
||||
}
|
||||
}
|
||||
return parent::validateFields($die, $error_return);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1078,8 +1078,6 @@ class CartCore extends ObjectModel
|
||||
if (Context::getContext()->customer->id) {
|
||||
if ($id_address_delivery == 0 && (int)$this->id_address_delivery) { // The $id_address_delivery is null, use the cart delivery address
|
||||
$id_address_delivery = $this->id_address_delivery;
|
||||
} elseif ($id_address_delivery == 0) { // The $id_address_delivery is null, get the default customer address
|
||||
$id_address_delivery = (int)Address::getFirstCustomerAddressId((int)Context::getContext()->customer->id);
|
||||
} elseif (!Customer::customerHasAddress(Context::getContext()->customer->id, $id_address_delivery)) { // The $id_address_delivery must be linked with customer
|
||||
$id_address_delivery = 0;
|
||||
}
|
||||
@@ -4109,7 +4107,7 @@ class CartCore extends ObjectModel
|
||||
$cart->id_shop_group = $this->id_shop_group;
|
||||
|
||||
if (!Customer::customerHasAddress((int)$cart->id_customer, (int)$cart->id_address_delivery)) {
|
||||
$cart->id_address_delivery = (int)Address::getFirstCustomerAddressId((int)$cart->id_customer);
|
||||
$cart->id_address_delivery = 0;
|
||||
}
|
||||
|
||||
if (!Customer::customerHasAddress((int)$cart->id_customer, (int)$cart->id_address_invoice)) {
|
||||
@@ -4501,11 +4499,9 @@ class CartCore extends ObjectModel
|
||||
public function autosetProductAddress()
|
||||
{
|
||||
$id_address_delivery = 0;
|
||||
// Get the main address of the customer
|
||||
|
||||
if ((int)$this->id_address_delivery > 0) {
|
||||
$id_address_delivery = (int)$this->id_address_delivery;
|
||||
} else {
|
||||
$id_address_delivery = (int)Address::getFirstCustomerAddressId(Context::getContext()->customer->id);
|
||||
}
|
||||
|
||||
if (!$id_address_delivery) {
|
||||
@@ -4702,7 +4698,7 @@ class CartCore extends ObjectModel
|
||||
public function getWsCartBookings()
|
||||
{
|
||||
return Db::getInstance()->executeS('
|
||||
SELECT `id`
|
||||
SELECT `id`, `date_from`, `date_to`, `id_hotel`, `id_product`
|
||||
FROM `'._DB_PREFIX_.'htl_cart_booking_data`
|
||||
WHERE id_cart = '.(int)$this->id.' ORDER BY `id` ASC'
|
||||
);
|
||||
|
||||
@@ -63,6 +63,45 @@ class CartCustomerGuestDetailCore extends ObjectModel
|
||||
);
|
||||
}
|
||||
|
||||
public static function getCustomerDefaultDetails($email)
|
||||
{
|
||||
return Db::getInstance()->getRow(
|
||||
'SELECT * FROM `'._DB_PREFIX_.'cart_customer_guest_detail`
|
||||
WHERE `id_cart` = 0 AND `email` = "'.pSQL($email).'"'
|
||||
);
|
||||
}
|
||||
|
||||
public static function updateCustomerPhoneNumber($email, $phone)
|
||||
{
|
||||
if ($customerDetail = self::getCustomerDefaultDetails($email)) {
|
||||
$objCartCustomerGuestDetail = new CartCustomerGuestDetail($customerDetail['id_customer_guest_detail']);
|
||||
$objCartCustomerGuestDetail->phone = $phone;
|
||||
return $objCartCustomerGuestDetail->save();
|
||||
} else {
|
||||
$objCustomer = new Customer();
|
||||
if (Validate::isLoadedObject($customer = $objCustomer->getByEmail($email, null, false))) {
|
||||
$objCartCustomerGuestDetail = new CartCustomerGuestDetail();
|
||||
$objCartCustomerGuestDetail->id_cart = 0;
|
||||
$objCartCustomerGuestDetail->id_gender = $customer->id_gender;
|
||||
$objCartCustomerGuestDetail->firstname = $customer->firstname;
|
||||
$objCartCustomerGuestDetail->lastname = $customer->lastname;
|
||||
$objCartCustomerGuestDetail->email = $customer->email;
|
||||
$objCartCustomerGuestDetail->phone = $phone;
|
||||
return $objCartCustomerGuestDetail->save();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function getCustomerPhone($email)
|
||||
{
|
||||
return Db::getInstance()->getValue(
|
||||
'SELECT `phone` FROM `'._DB_PREFIX_.'cart_customer_guest_detail`
|
||||
WHERE `id_cart` = 0 AND `email` = "'.pSQL($email).'"'
|
||||
);
|
||||
}
|
||||
|
||||
public function validateGuestInfo()
|
||||
{
|
||||
$isValid = true;
|
||||
|
||||
@@ -72,6 +72,9 @@ class CartRuleCore extends ObjectModel
|
||||
public $date_add;
|
||||
public $date_upd;
|
||||
|
||||
const GENERATED_BY_REFUND = 1;
|
||||
const GENERATED_BY_ORDER_SLIP = 2;
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
@@ -407,6 +410,8 @@ class CartRuleCore extends ObjectModel
|
||||
}
|
||||
unset($cart_rule);
|
||||
|
||||
Hook::exec('actionCustomerCartRulesModifier', array('cart_rules' => &$result, 'id_customer' => (int)$id_customer));
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -515,6 +520,38 @@ class CartRuleCore extends ObjectModel
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* If null is provided, default validation will be processed. Useful if you want your own conditions,
|
||||
* but also want to retain functionality of the core.
|
||||
*
|
||||
* If true is provided, the validation ends here and the rule is VALID, ignoring the rest of core validation.
|
||||
*
|
||||
* If false is provided, the validation ends here and the rule is not VALID, ignoring the rest of core validation.
|
||||
* In this case, it's recommended to properly alter the isValidatedByModulesError error message so the user knows why.
|
||||
*/
|
||||
$isValidatedByModules = null;
|
||||
$isValidatedByModulesError = Tools::displayError('This voucher is not valid.');
|
||||
Hook::exec(
|
||||
'actionValidateCartRule',
|
||||
array(
|
||||
'cart_rule' => $this,
|
||||
'context' => $context,
|
||||
'alreadyInCart' => $alreadyInCart,
|
||||
'display_error' => $display_error,
|
||||
'check_carrier' => $check_carrier,
|
||||
'isValidatedByModules' => &$isValidatedByModules,
|
||||
'isValidatedByModulesError' => &$isValidatedByModulesError,
|
||||
)
|
||||
);
|
||||
|
||||
if ($isValidatedByModules === false) {
|
||||
return (!$display_error) ? false : $isValidatedByModulesError;
|
||||
}
|
||||
|
||||
if ($isValidatedByModules === true) {
|
||||
return (!$display_error) ? true : null;
|
||||
}
|
||||
|
||||
if (!$this->active) {
|
||||
return (!$display_error) ? false : Tools::displayError('This voucher is disabled');
|
||||
}
|
||||
@@ -909,7 +946,7 @@ class CartRuleCore extends ObjectModel
|
||||
|
||||
$reduction_value = 0;
|
||||
$objHotelAdvancePayment = new HotelAdvancedPayment();
|
||||
$cache_id = 'getContextualValue_'.(int)$this->id.'_'.(int)$use_tax.'_'.(int)$context->cart->id.'_'.(int)$filter.'_'.(int)$only_advance_payment_products;
|
||||
$cache_id = 'getContextualValue_'.(int)$this->id.'_'.(int)$use_tax.'_'.(int)$context->cart->id.'_'.(int)$context->currency->id.'_'.(int)$filter.'_'.(int)$only_advance_payment_products;
|
||||
foreach ($package['products'] as $key => $product) {
|
||||
if ($only_advance_payment_products) {
|
||||
if ($advancePaymentInfo = $objHotelAdvancePayment->getIdAdvPaymentByIdProduct($product['id_product'])) {
|
||||
@@ -1498,4 +1535,25 @@ class CartRuleCore extends ObjectModel
|
||||
return Db::getInstance()->executeS($sql_base.' AND code LIKE \'%'.pSQL($name).'%\'');
|
||||
}
|
||||
}
|
||||
|
||||
public static function getGeneratedBy($id)
|
||||
{
|
||||
if (!$id) {
|
||||
return false;
|
||||
}
|
||||
$response = array();
|
||||
$sql = 'SELECT `id_order_slip` FROM '._DB_PREFIX_.'order_slip os
|
||||
WHERE os.`id_cart_rule` = '.(int)$id;
|
||||
if ($result = Db::getInstance()->getValue($sql)) {
|
||||
$response['generated_by'] = self::GENERATED_BY_ORDER_SLIP;
|
||||
$response['id_generated_by'] = $result;
|
||||
}
|
||||
$sql = 'SELECT `id_order_return` FROM '._DB_PREFIX_.'order_return o
|
||||
WHERE o.`return_type` = '.OrderReturn::RETURN_TYPE_CART_RULE.' AND o.`id_return_type` = '.(int)$id;
|
||||
if ($result = Db::getInstance()->getValue($sql)) {
|
||||
$response['generated_by'] = self::GENERATED_BY_REFUND;
|
||||
$response['id_generated_by'] = $result;
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,8 +326,6 @@ class ContextCore
|
||||
$this->cart->setDeliveryOption(null);
|
||||
}
|
||||
$this->cart->id_customer = (int) $customer->id;
|
||||
$this->cart->updateAddressId($this->cart->id_address_delivery, (int) Address::getFirstCustomerAddressId((int) ($customer->id)));
|
||||
$this->cart->id_address_delivery = (int) Address::getFirstCustomerAddressId((int) ($customer->id));
|
||||
$this->cart->id_address_invoice = (int) Address::getFirstCustomerAddressId((int) ($customer->id));
|
||||
|
||||
// update id guest in htl_cart_booking_data for bookings added to the cart as a visitor
|
||||
|
||||
@@ -135,6 +135,8 @@ class CustomerCore extends ObjectModel
|
||||
|
||||
public $groupBox;
|
||||
|
||||
public $phone;
|
||||
|
||||
const STATUS_BANNED = 1;
|
||||
const STATUS_DELETED = 2;
|
||||
|
||||
@@ -202,6 +204,10 @@ class CustomerCore extends ObjectModel
|
||||
{
|
||||
$this->id_default_group = (int)Configuration::get('PS_CUSTOMER_GROUP');
|
||||
parent::__construct($id);
|
||||
|
||||
if ($this->email) {
|
||||
$this->phone = CartCustomerGuestDetail::getCustomerPhone($this->email);
|
||||
}
|
||||
}
|
||||
|
||||
public function add($autodate = true, $null_values = true)
|
||||
@@ -484,6 +490,18 @@ class CustomerCore extends ObjectModel
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
public static function getPhone($id_customer)
|
||||
{
|
||||
|
||||
return Db::getInstance()->getValue(
|
||||
'SELECT cgd.`phone`
|
||||
FROM `'._DB_PREFIX_.'customer` c
|
||||
INNER JOIN `'._DB_PREFIX_.'cart_customer_guest_detail` cgd
|
||||
ON (cgd.`email` = c.`email`)
|
||||
WHERE `id_cart` = 0 AND c.`id_customer` = '.(int)($id_customer)
|
||||
);
|
||||
}
|
||||
|
||||
public static function getCustomerIdAddress($id_customer, $use_cache = true)
|
||||
{
|
||||
$cache_id = 'Customer::getCustomerIdAddress'.(int)$id_customer;
|
||||
|
||||
@@ -141,4 +141,12 @@ class CustomerMessageCore extends ObjectModel
|
||||
');
|
||||
}
|
||||
|
||||
public function validateFields($die = true, $error_return = false)
|
||||
{
|
||||
if (isset($this->webservice_validation) && $this->webservice_validation) {
|
||||
$this->message = trim($this->message);
|
||||
}
|
||||
|
||||
return parent::validateFields($die, $error_return);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,9 +173,18 @@ class GuestCore extends ObjectModel
|
||||
public function mergeWithCustomer($idGuest, $idCustomer)
|
||||
{
|
||||
// Since the guests are merged, the guest id in the connections table must be changed too
|
||||
Db::getInstance()->update('connections', [
|
||||
'id_guest' => (int) $idGuest,
|
||||
], 'id_guest = ' . (int) $this->id);
|
||||
// If guest entry is already there in the connection within 30 mins then delete the visitor entry else update it with guest id of the customer
|
||||
|
||||
$sql = 'SELECT SQL_NO_CACHE `id_guest` FROM `'._DB_PREFIX_.'connections`
|
||||
WHERE `id_guest` = '.(int)$idGuest.' AND `date_add` > \''.pSQL(date('Y-m-d H:i:00', time() - 1800)).'\''.
|
||||
Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).' ORDER BY `date_add` DESC';
|
||||
if (Db::getInstance()->getRow($sql, false)) {
|
||||
Db::getInstance()->delete('connections', 'id_guest = ' . (int) $this->id);
|
||||
} else {
|
||||
Db::getInstance()->update('connections', [
|
||||
'id_guest' => (int) $idGuest,
|
||||
], 'id_guest = ' . (int) $this->id);
|
||||
}
|
||||
|
||||
// Since the guests are merged, the guest id in the cart table must be changed too
|
||||
Db::getInstance()->update('cart', [
|
||||
@@ -198,4 +207,21 @@ class GuestCore extends ObjectModel
|
||||
$guest->save();
|
||||
$cookie->id_guest = (int)($guest->id);
|
||||
}
|
||||
|
||||
public function validateFields($die = true, $error_return = false)
|
||||
{
|
||||
if (isset($this->webservice_validation) && $this->webservice_validation) {
|
||||
if ((int) $this->id_customer && !Validate::isLoadedObject(new Customer((int) $this->id_customer))) {
|
||||
$message = Tools::displayError('Invalid Id customer.');
|
||||
}
|
||||
|
||||
if (isset($message)) {
|
||||
if ($die) {
|
||||
throw new PrestaShopException($message);
|
||||
}
|
||||
return $error_return ? $message : false;
|
||||
}
|
||||
}
|
||||
return parent::validateFields($die, $error_return);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1163,16 +1163,6 @@ abstract class PaymentModuleCore extends Module
|
||||
$this->context->currency,
|
||||
false
|
||||
),
|
||||
'{delivery_block_txt}' => $this->_getFormatedAddress($delivery, "\n"),
|
||||
'{invoice_block_txt}' => $this->_getFormatedAddress($invoice, "\n"),
|
||||
'{delivery_block_html}' => $this->_getFormatedAddress($delivery, '<br />', array(
|
||||
'firstname' => '<span style="font-weight:bold;">%s</span>',
|
||||
'lastname' => '<span style="font-weight:bold;">%s</span>'
|
||||
)),
|
||||
'{invoice_block_html}' => $this->_getFormatedAddress($invoice, '<br />', array(
|
||||
'firstname' => '<span style="font-weight:bold;">%s</span>',
|
||||
'lastname' => '<span style="font-weight:bold;">%s</span>'
|
||||
)),
|
||||
'{delivery_company}' => $delivery->company,
|
||||
'{delivery_firstname}' => $delivery->firstname,
|
||||
'{delivery_lastname}' => $delivery->lastname,
|
||||
@@ -1650,8 +1640,6 @@ abstract class PaymentModuleCore extends Module
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
$result['total_extra_demands_te'] = 0;
|
||||
$result['total_extra_demands_ti'] = 0;
|
||||
$result['total_additional_services_te'] =0;
|
||||
$result['total_additional_services_ti'] =0;
|
||||
$cart_htl_data = array();
|
||||
if (!empty($products)) {
|
||||
foreach ($products as $type_key => $type_value) {
|
||||
@@ -1697,67 +1685,12 @@ abstract class PaymentModuleCore extends Module
|
||||
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount'] = $roomTypeDateRangePrice['total_price_tax_incl']*$vart_quant;
|
||||
// extra demands prices
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order->id,
|
||||
$type_value['product_id'],
|
||||
0,
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to']
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order->id,
|
||||
$type_value['product_id'],
|
||||
0,
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
0,
|
||||
1,
|
||||
0
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order->id,
|
||||
$type_value['product_id'],
|
||||
0,
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
0,
|
||||
1,
|
||||
1
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
$type_value['product_id'],
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
$data_v['id_room'],
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
Product::PRICE_ADDITION_TYPE_WITH_ROOM
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
$type_value['product_id'],
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
$data_v['id_room'],
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
Product::PRICE_ADDITION_TYPE_WITH_ROOM
|
||||
);
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_incl']/$num_days;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] = $data_v['total_price_tax_excl']/$num_days;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] += ($cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti']);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] += ($cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_incl'] += ($data_v['total_price_tax_incl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_excl'] += ($data_v['total_price_tax_excl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'];
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'];
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_incl'] += $data_v['total_price_tax_incl'];
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_excl'] += $data_v['total_price_tax_excl'];
|
||||
} else {
|
||||
$num_days = $obj_htl_bk_dtl->getNumberOfDays($data_v['date_from'], $data_v['date_to']);
|
||||
|
||||
@@ -1809,28 +1742,6 @@ abstract class PaymentModuleCore extends Module
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to']
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
$type_value['product_id'],
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
$data_v['id_room'],
|
||||
1,
|
||||
1
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_te'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
$type_value['product_id'],
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
$data_v['id_room'],
|
||||
1,
|
||||
0
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
@@ -1838,7 +1749,7 @@ abstract class PaymentModuleCore extends Module
|
||||
$type_value['product_id'],
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
$data_v['id_room'],
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
@@ -1851,7 +1762,7 @@ abstract class PaymentModuleCore extends Module
|
||||
$type_value['product_id'],
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
$data_v['id_room'],
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
@@ -1867,8 +1778,6 @@ abstract class PaymentModuleCore extends Module
|
||||
|
||||
$result['total_extra_demands_te'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'];
|
||||
$result['total_extra_demands_ti'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'];
|
||||
$result['total_additional_services_te'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_te'];
|
||||
$result['total_additional_services_ti'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_ti'];
|
||||
}
|
||||
}
|
||||
// calculate averages now
|
||||
|
||||
@@ -373,36 +373,22 @@ class ProductCore extends ObjectModel
|
||||
|
||||
protected $webserviceParameters = array(
|
||||
'objectMethods' => array(
|
||||
'add' => 'addWs',
|
||||
'update' => 'updateWs',
|
||||
'add' => 'addWsRoomType',
|
||||
'update' => 'updateWsRoomType',
|
||||
'delete' => 'deleteWs'
|
||||
),
|
||||
|
||||
'objectsNodeName' => 'room_types',
|
||||
'objectNodeName' => 'room_type',
|
||||
'retrieveData' => array(
|
||||
'retrieveMethod' => 'getRoomTypesObjectList'
|
||||
),
|
||||
'fields' => array(
|
||||
'id_hotel' => array(
|
||||
'getter' => 'getWsHotel',
|
||||
'setter' => 'setWsHotel',
|
||||
'xlink_resource' => 'hotels'
|
||||
),
|
||||
'adults' => array(
|
||||
'getter' => 'getWsAdults',
|
||||
'setter' => 'setWsAdults',
|
||||
),
|
||||
'children' => array(
|
||||
'getter' => 'getWsChildren',
|
||||
'setter' => 'setWsChildren',
|
||||
),
|
||||
'id_manufacturer' => array(
|
||||
'xlink_resource' => 'manufacturers'
|
||||
),
|
||||
'id_supplier' => array(
|
||||
'xlink_resource' => 'suppliers'
|
||||
),
|
||||
'id_category_default' => array(
|
||||
'xlink_resource' => 'categories'
|
||||
),
|
||||
'id_hotel' => array('getter' => 'getWsHotel','setter' => 'setWsHotel', 'xlink_resource' => 'hotels'),
|
||||
'adults' => array('getter' => 'getWsAdults','setter' => 'setWsAdults'),
|
||||
'children' => array('getter' => 'getWsChildren','setter' => 'setWsChildren'),
|
||||
'id_manufacturer' => array('xlink_resource' => 'manufacturers'),
|
||||
'id_supplier' => array('xlink_resource' => 'suppliers'),
|
||||
'id_category_default' => array('xlink_resource' => 'categories'),
|
||||
'new' => array(),
|
||||
'cache_default_attribute' => array(),
|
||||
'id_default_image' => array(
|
||||
@@ -420,36 +406,28 @@ class ProductCore extends ObjectModel
|
||||
// 'resourceName' => 'combinations'
|
||||
// )
|
||||
// ),
|
||||
'id_tax_rules_group' => array(
|
||||
'xlink_resource' => array(
|
||||
'resourceName' => 'tax_rule_groups'
|
||||
)
|
||||
),
|
||||
'position_in_category' => array(
|
||||
'getter' => 'getWsPositionInCategory',
|
||||
'setter' => 'setWsPositionInCategory'
|
||||
),
|
||||
'id_tax_rules_group' => array('xlink_resource' => array('resourceName' => 'tax_rule_groups')),
|
||||
'position_in_category' => array('getter' => 'getWsPositionInCategory', 'setter' => 'setWsPositionInCategory'),
|
||||
// 'manufacturer_name' => array(
|
||||
// 'getter' => 'getWsManufacturerName',
|
||||
// 'setter' => false
|
||||
// ),
|
||||
'quantity' => array(
|
||||
'getter' => false,
|
||||
'setter' => false
|
||||
),
|
||||
'type' => array(
|
||||
'getter' => 'getWsType',
|
||||
'setter' => 'setWsType',
|
||||
),
|
||||
'id_advance_paypent' => array(
|
||||
'xlink_resource' => array(
|
||||
'resourceName' => 'advance_payments'
|
||||
),
|
||||
'getter' => 'getWsRoomTypeAdvancePayment',
|
||||
'setter' => false
|
||||
),
|
||||
'type' => array('getter' => 'getWsType', 'setter' => 'setWsType'),
|
||||
),
|
||||
'associations' => array(
|
||||
'advance_payments' => array(
|
||||
'resource' => 'advance_payment',
|
||||
'getter' => 'getWsAdvancePayments',
|
||||
'setter' => 'setWsAdvancePayments',
|
||||
'fields' => array(
|
||||
'id' => array(),
|
||||
'payment_type' => array(),
|
||||
'tax_include' => array(),
|
||||
'value' => array(),
|
||||
'active' => array(),
|
||||
'calculate_from' => array(),
|
||||
),
|
||||
),
|
||||
'categories' => array(
|
||||
'resource' => 'category',
|
||||
'fields' => array(
|
||||
@@ -466,7 +444,8 @@ class ProductCore extends ObjectModel
|
||||
'id' => array('required' => true),
|
||||
)
|
||||
),
|
||||
'tags' => array('resource' => 'tag',
|
||||
'tags' => array(
|
||||
'resource' => 'tag',
|
||||
'fields' => array(
|
||||
'id' => array('required' => true),
|
||||
)
|
||||
@@ -484,13 +463,78 @@ class ProductCore extends ObjectModel
|
||||
)
|
||||
),
|
||||
'extra_demands' => array(
|
||||
'setter' => false,
|
||||
'resource' => 'extra_demand',
|
||||
'fields' => array(
|
||||
'id' => array('required' => true),
|
||||
'id_option' => array(),
|
||||
'price' => array(),
|
||||
)
|
||||
),
|
||||
'services' => array(
|
||||
'resource' => 'service',
|
||||
'fields' => array(
|
||||
'id' => array('validate' => 'isUnsignedId', 'required' => true),
|
||||
'price' => array('validate' => 'isPrice', 'required' => true),
|
||||
'id_tax_rules_group' => array('validate' => 'isUnsignedId')
|
||||
)
|
||||
),
|
||||
),
|
||||
'hidden_fields' => array(
|
||||
'booking_product',
|
||||
'service_product_type'
|
||||
),
|
||||
);
|
||||
|
||||
protected $webserviceServicesParameters = array(
|
||||
'objectMethods' => array(
|
||||
'add' => 'addWsServices',
|
||||
'update' => 'updateWsServices',
|
||||
'delete' => 'deleteWs'
|
||||
),
|
||||
'objectsNodeName' => 'services',
|
||||
'objectNodeName' => 'service',
|
||||
'retrieveData' => array(
|
||||
'retrieveMethod' => 'getServicesObjectList'
|
||||
),
|
||||
'fields' => array(
|
||||
'id_manufacturer' => array('xlink_resource' => 'manufacturers'),
|
||||
'id_supplier' => array('xlink_resource' => 'suppliers'),
|
||||
'id_category_default' => array('xlink_resource' => 'categories'),
|
||||
'new' => array(),
|
||||
'cache_default_attribute' => array(),
|
||||
'id_default_image' => array(
|
||||
'getter' => 'getCoverWs',
|
||||
'setter' => 'setCoverWs',
|
||||
'xlink_resource' => array(
|
||||
'resourceName' => 'images',
|
||||
'subResourceName' => 'room_types'
|
||||
)
|
||||
),
|
||||
'id_tax_rules_group' => array('xlink_resource' => array('resourceName' => 'tax_rule_groups')),
|
||||
'position_in_category' => array('getter' => 'getWsPositionInCategory', 'setter' => 'setWsPositionInCategory'),
|
||||
// 'manufacturer_name' => array(
|
||||
// 'getter' => 'getWsManufacturerName',
|
||||
// 'setter' => false
|
||||
// ),
|
||||
'quantity' => array('getter' => false, 'setter' => false),
|
||||
'type' => array('getter' => 'getWsType', 'setter' => 'setWsType'),
|
||||
),
|
||||
'associations' => array(
|
||||
'categories' => array(
|
||||
'resource' => 'category',
|
||||
'fields' => array('id' => array('required' => true))
|
||||
),
|
||||
'images' => array('resource' => 'image', 'fields' => array('id' => array())),
|
||||
'feature_prices' => array(
|
||||
'setter' => false, 'resource' => 'feature_price',
|
||||
'fields' => array(
|
||||
'id' => array('required' => true),
|
||||
)
|
||||
),
|
||||
),
|
||||
'hidden_fields' => array(
|
||||
'booking_product',
|
||||
),
|
||||
);
|
||||
|
||||
const CUSTOMIZE_FILE = 0;
|
||||
@@ -5709,8 +5753,11 @@ class ProductCore extends ObjectModel
|
||||
*/
|
||||
public function getCoverWs()
|
||||
{
|
||||
$result = $this->getCover($this->id);
|
||||
return $result['id_image'];
|
||||
if ($result = $this->getCover($this->id)) {
|
||||
return $result['id_image'];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5999,8 +6046,9 @@ class ProductCore extends ObjectModel
|
||||
return true;
|
||||
}
|
||||
|
||||
public function addWs($autodate = true, $null_values = false)
|
||||
public function addWsRoomType($autodate = true, $null_values = false)
|
||||
{
|
||||
$this->booking_product = 1;
|
||||
if ($success = $this->add($autodate, $null_values)) {
|
||||
if (Configuration::get('PS_SEARCH_INDEXATION')) {
|
||||
Search::indexation(false, $this->id);
|
||||
@@ -6012,19 +6060,56 @@ class ProductCore extends ObjectModel
|
||||
return $success;
|
||||
}
|
||||
|
||||
public function updateWs($null_values = false)
|
||||
public function updateWsRoomType($null_values = false)
|
||||
{
|
||||
$success = parent::update($null_values);
|
||||
if ($success && Configuration::get('PS_SEARCH_INDEXATION')) {
|
||||
Search::indexation(false, $this->id);
|
||||
if (self::isBookingProduct($this->id)) {
|
||||
$this->booking_product = 1; // Since there is nothing set from the API, it might get set as false
|
||||
$success = parent::update($null_values);
|
||||
if ($success && Configuration::get('PS_SEARCH_INDEXATION')) {
|
||||
Search::indexation(false, $this->id);
|
||||
}
|
||||
|
||||
$this->setWsRoomTypeInfo();
|
||||
|
||||
Hook::exec('updateProduct', array('id_product' => (int)$this->id));
|
||||
return $success;
|
||||
}
|
||||
|
||||
$this->setWsRoomTypeInfo();
|
||||
WebserviceRequest::getInstance()->setError(500, Tools::displayError('Room type not found.'), 134);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function addWsServices()
|
||||
{
|
||||
$this->booking_product = 0;
|
||||
if ($success = $this->add()) {
|
||||
if (Configuration::get('PS_SEARCH_INDEXATION')) {
|
||||
Search::indexation(false, $this->id);
|
||||
}
|
||||
}
|
||||
|
||||
Hook::exec('updateProduct', array('id_product' => (int)$this->id));
|
||||
return $success;
|
||||
}
|
||||
|
||||
public function updateWsServices($null_values = false)
|
||||
{
|
||||
if (!self::isBookingProduct($this->id)) {
|
||||
$this->booking_product = 0; // Since there is nothing set from the API.
|
||||
$success = parent::update($null_values);
|
||||
if ($success && Configuration::get('PS_SEARCH_INDEXATION')) {
|
||||
Search::indexation(false, $this->id);
|
||||
}
|
||||
|
||||
Hook::exec('updateProduct', array('id_product' => (int)$this->id));
|
||||
return $success;
|
||||
}
|
||||
|
||||
WebserviceRequest::getInstance()->setError(500, Tools::displayError('Service not found.'), 134);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* For a given product, returns its real quantity
|
||||
*
|
||||
@@ -6384,6 +6469,20 @@ class ProductCore extends ObjectModel
|
||||
return $cache_id;
|
||||
}
|
||||
|
||||
public function getRoomTypesObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit)
|
||||
{
|
||||
$sql_filter .= ' AND main.`booking_product` = 1';
|
||||
|
||||
return parent::getWebserviceObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit);
|
||||
}
|
||||
|
||||
public function getServicesObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit)
|
||||
{
|
||||
$sql_filter .= ' AND main.`booking_product` = 0';
|
||||
|
||||
return parent::getWebserviceObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit);
|
||||
}
|
||||
|
||||
public static function setPackStockType($id_product, $pack_stock_type)
|
||||
{
|
||||
return Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'product p
|
||||
@@ -6408,10 +6507,55 @@ class ProductCore extends ObjectModel
|
||||
public function getWsAdvancePayments()
|
||||
{
|
||||
return Db::getInstance()->executeS(
|
||||
'SELECT `id` FROM `'._DB_PREFIX_.'htl_advance_payment` WHERE `id_product` = '.(int)$this->id.' ORDER BY `id` ASC'
|
||||
'SELECT * FROM `'._DB_PREFIX_.'htl_advance_payment` WHERE `id_product` = '.(int)$this->id.' ORDER BY `id` ASC'
|
||||
);
|
||||
}
|
||||
|
||||
public function setWsAdvancePayments($adv_payment)
|
||||
{
|
||||
$obj_adv_pmt = new HotelAdvancedPayment();
|
||||
if (!$adv_payment) {
|
||||
if ($adv_pmt_info = $obj_adv_pmt->getIdAdvPaymentByIdProduct($this->id)) {
|
||||
$obj_adv_pmt = new HotelAdvancedPayment((int) $adv_pmt_info['id']);
|
||||
}
|
||||
|
||||
$obj_adv_pmt->payment_type = '';
|
||||
$obj_adv_pmt->id_product = $this->id;
|
||||
$obj_adv_pmt->value = '';
|
||||
$obj_adv_pmt->id_currency = '';
|
||||
$obj_adv_pmt->tax_include = '';
|
||||
$obj_adv_pmt->calculate_from = 0;
|
||||
$obj_adv_pmt->active = 0;
|
||||
|
||||
return $obj_adv_pmt->save();
|
||||
} else if (is_array($adv_payment) && count($adv_payment) == 1) {
|
||||
$fields = array_shift($adv_payment);
|
||||
if (!Validate::isLoadedObject($obj_adv_pmt = new HotelAdvancedPayment($fields['id']))) {
|
||||
if ($adv_pmt_info = $obj_adv_pmt->getIdAdvPaymentByIdProduct($this->id)) {
|
||||
$obj_adv_pmt = new HotelAdvancedPayment((int) $adv_pmt_info['id']);
|
||||
}
|
||||
}
|
||||
|
||||
$obj_adv_pmt->id_product = $this->id;
|
||||
$obj_adv_pmt->active = 1;
|
||||
$obj_adv_pmt->payment_type = $fields['payment_type'];
|
||||
$obj_adv_pmt->value = $fields['value'];
|
||||
|
||||
if ($fields['payment_type'] == 2) {
|
||||
$obj_adv_pmt->id_currency = (int) Configuration::get('PS_CURRENCY_DEFAULT');
|
||||
} else {
|
||||
$obj_adv_pmt->id_currency = '';
|
||||
}
|
||||
|
||||
$obj_adv_pmt->tax_include = $fields['tax_include'];
|
||||
$obj_adv_pmt->calculate_from = $fields['calculate_from'];
|
||||
|
||||
return $obj_adv_pmt->save();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getWsHotel()
|
||||
{
|
||||
return Db::getInstance()->getValue(
|
||||
@@ -6435,8 +6579,41 @@ class ProductCore extends ObjectModel
|
||||
|
||||
public function getWsExtraDemands()
|
||||
{
|
||||
return Db::getInstance()->getValue(
|
||||
'SELECT `id_global_demand` as `id` FROM `'._DB_PREFIX_.'htl_room_type_demand` WHERE `id_product` = '.(int)$this->id
|
||||
$objHotelRoomTypeDemand = new HotelRoomTypeDemand();
|
||||
$selectedDemands = Db::getInstance()->executeS(
|
||||
'SELECT `id_global_demand` as `id` FROM `'._DB_PREFIX_.'htl_room_type_demand`
|
||||
WHERE `id_product` = '.(int)$this->id
|
||||
);
|
||||
$res = array();
|
||||
$demands = $objHotelRoomTypeDemand->getRoomTypeDemands($this->id);
|
||||
if ($selectedDemands) {
|
||||
foreach ($selectedDemands as $id_demand => $demand) {
|
||||
$option['id'] = $demand['id'];
|
||||
if (isset($demands[$demand['id']]['adv_option']) && count($demands[$demand['id']]['adv_option'])) {
|
||||
foreach ($demands[$demand['id']]['adv_option'] as $id_option => $adv_option) {
|
||||
$option['id_option'] = $id_option;
|
||||
$option['price'] = $adv_option['price_tax_excl'];
|
||||
$res[] = $option;
|
||||
}
|
||||
} else {
|
||||
$option['id_option'] = false;
|
||||
$option['price'] = $demand['price_tax_excl'];
|
||||
$res[] = $option;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function getWsServices()
|
||||
{
|
||||
return Db::getInstance()->executeS(
|
||||
'SELECT spp.`price`, spp.`id_tax_rules_group`, sp.`id_product` AS id
|
||||
FROM `'._DB_PREFIX_.'htl_room_type_service_product` sp
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product_price` spp
|
||||
ON (spp.`id_product` = sp.`id_product` AND spp.`id_element` = sp.`id_element` AND spp.`element_type` = sp.`element_type`)
|
||||
WHERE sp.`id_element` = '.(int)$this->id
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6490,4 +6667,106 @@ class ProductCore extends ObjectModel
|
||||
{
|
||||
return $this->delete();
|
||||
}
|
||||
|
||||
public function setWsExtraDemands($demands)
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'htl_room_type_demand`
|
||||
WHERE `id_product` = '.(int)$this->id
|
||||
);
|
||||
Db::getInstance()->execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'htl_room_type_demand_price`
|
||||
WHERE `id_product` = '.(int)$this->id
|
||||
);
|
||||
$objAdvOption = new HotelRoomTypeGlobalDemandAdvanceOption();
|
||||
$savedDemands = array();
|
||||
foreach ($demands as $globalDemand) {
|
||||
if (Validate::isLoadedObject($objGlobalDemand = new HotelRoomTypeGlobalDemand($globalDemand['id']))) {
|
||||
if (!isset($savedDemands[$globalDemand['id']])) {
|
||||
$objRoomTypeDemand = new HotelRoomTypeDemand();
|
||||
$objRoomTypeDemand->id_product = $this->id;
|
||||
$objRoomTypeDemand->id_global_demand = $objGlobalDemand->id;
|
||||
$objRoomTypeDemand->save();
|
||||
$savedDemands[$globalDemand['id']] = $objRoomTypeDemand->id;
|
||||
}
|
||||
|
||||
if (isset($globalDemand['price'])) {
|
||||
if ($objAdvOption->getGlobalDemandAdvanceOptions($objGlobalDemand->id)
|
||||
&& isset($globalDemand['id_option'])
|
||||
&& Validate::isLoadedObject($objAdvOption = new HotelRoomTypeGlobalDemandAdvanceOption($globalDemand['id_option']))
|
||||
) {
|
||||
if ($globalDemand['price'] != $objAdvOption->price) {
|
||||
$objRoomTypeDemandPrice = new HotelRoomTypeDemandPrice();
|
||||
$objRoomTypeDemandPrice->id_product = $this->id;
|
||||
$objRoomTypeDemandPrice->id_global_demand = $objGlobalDemand->id;
|
||||
$objRoomTypeDemandPrice->id_option = $objAdvOption->id;
|
||||
$objRoomTypeDemandPrice->price = $globalDemand['price'];
|
||||
$objRoomTypeDemandPrice->save();
|
||||
}
|
||||
} else {
|
||||
// save selected demands prices for this room type
|
||||
if ($objGlobalDemand->price != $globalDemand['price']) {
|
||||
$objRoomTypeDemandPrice = new HotelRoomTypeDemandPrice();
|
||||
$objRoomTypeDemandPrice->id_product = $this->id;
|
||||
$objRoomTypeDemandPrice->id_global_demand = $objGlobalDemand->id;
|
||||
$objRoomTypeDemandPrice->id_option = 0;
|
||||
$objRoomTypeDemandPrice->price = $globalDemand['price'];
|
||||
$objRoomTypeDemandPrice->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function setWsServices($services)
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'htl_room_type_service_product`
|
||||
WHERE `id_element` = '.(int)$this->id
|
||||
);
|
||||
Db::getInstance()->execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'htl_room_type_service_product_price`
|
||||
WHERE `id_element` = '.(int)$this->id
|
||||
);
|
||||
if ($this->booking_product) {
|
||||
if ($allServiceProducts = $this->getServiceProducts()) {
|
||||
$formttedServiceProducts = array();
|
||||
foreach ($allServiceProducts as $product) {
|
||||
$formttedServiceProducts[$product['id_product']] = $product;
|
||||
}
|
||||
|
||||
$allServiceProducts = $formttedServiceProducts;
|
||||
|
||||
foreach ($services as $service) {
|
||||
if (isset($service['id'])
|
||||
&& Validate::isLoadedObject($objServiceProduct = new Product($service['id']))
|
||||
&& !$objServiceProduct->booking_product
|
||||
&& isset($allServiceProducts[$objServiceProduct->id])
|
||||
) {
|
||||
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
|
||||
$objRoomTypeServiceProduct->addRoomProductLink(
|
||||
$objServiceProduct->id,
|
||||
$this->id,
|
||||
RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE
|
||||
);
|
||||
|
||||
$objRoomTypeServiceProductPrice = new RoomTypeServiceProductPrice();
|
||||
$objRoomTypeServiceProductPrice->id_product = $objServiceProduct->id;
|
||||
$objRoomTypeServiceProductPrice->id_element = $this->id;
|
||||
$objRoomTypeServiceProductPrice->element_type = RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE;
|
||||
$objRoomTypeServiceProductPrice->price = isset($service['price']) ? $service['price'] : $allServiceProducts[$objServiceProduct->id]['price'];
|
||||
$objRoomTypeServiceProductPrice->id_tax_rules_group = isset($service['id_tax_rules_group']) ? $service['id_tax_rules_group'] : $allServiceProducts[$objServiceProduct->id]['id_tax_rules_group'];
|
||||
$objRoomTypeServiceProductPrice->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ class TranslatedConfigurationCore extends Configuration
|
||||
'id_shop' => array('type' => self::TYPE_NOTHING, 'validate' => 'isUnsignedId'),
|
||||
'value' => array('type' => self::TYPE_STRING, 'lang' => true),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'lang' => true),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@@ -534,7 +534,7 @@ class ValidateCore
|
||||
*/
|
||||
public static function isPhoneNumber($number)
|
||||
{
|
||||
return preg_match('/^[+0-9. ()-]*$/', $number);
|
||||
return preg_match('/^\+?[\s\d.()-]*\d+$/', $number);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -365,13 +365,13 @@ class FrontControllerCore extends Controller
|
||||
$cart->update();
|
||||
}
|
||||
/* Select an address if not set */
|
||||
if (isset($cart) && (!isset($cart->id_address_delivery) || $cart->id_address_delivery == 0 ||
|
||||
!isset($cart->id_address_invoice) || $cart->id_address_invoice == 0) && $this->context->cookie->id_customer) {
|
||||
if (isset($cart)
|
||||
&& (!isset($cart->id_address_invoice)
|
||||
|| $cart->id_address_invoice == 0
|
||||
)
|
||||
&& $this->context->cookie->id_customer
|
||||
) {
|
||||
$to_update = false;
|
||||
if (!isset($cart->id_address_delivery) || $cart->id_address_delivery == 0) {
|
||||
$to_update = true;
|
||||
$cart->id_address_delivery = (int)Address::getFirstCustomerAddressId($cart->id_customer);
|
||||
}
|
||||
if (!isset($cart->id_address_invoice) || $cart->id_address_invoice == 0) {
|
||||
$to_update = true;
|
||||
$cart->id_address_invoice = (int)Address::getFirstCustomerAddressId($cart->id_customer);
|
||||
@@ -391,8 +391,7 @@ class FrontControllerCore extends Controller
|
||||
$cart->id_shop = $this->context->shop->id;
|
||||
if ($this->context->cookie->id_customer) {
|
||||
$cart->id_customer = (int)$this->context->cookie->id_customer;
|
||||
$cart->id_address_delivery = (int)Address::getFirstCustomerAddressId($cart->id_customer);
|
||||
$cart->id_address_invoice = (int)$cart->id_address_delivery;
|
||||
$cart->id_address_invoice = (int)Address::getFirstCustomerAddressId($cart->id_customer);
|
||||
} else {
|
||||
$cart->id_address_delivery = 0;
|
||||
$cart->id_address_invoice = 0;
|
||||
@@ -1217,6 +1216,7 @@ class FrontControllerCore extends Controller
|
||||
*/
|
||||
if ($this->context->language->is_rtl) {
|
||||
$this->addCSS(_THEME_CSS_DIR_.'rtl.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'rtl_grid.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.$this->context->language->iso_code.'.css');
|
||||
}
|
||||
}
|
||||
|
||||
160
classes/helper/HelperTree.php
Normal file
160
classes/helper/HelperTree.php
Normal file
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
/**
|
||||
* Since 2010 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
class HelperTreeCore extends TreeCore
|
||||
{
|
||||
|
||||
const DEFAULT_NODE_FOLDER_TEMPLATE = 'tree_node_folder_radio.tpl';
|
||||
const DEFAULT_NODE_ITEM_TEMPLATE = 'tree_node_item_radio.tpl';
|
||||
|
||||
|
||||
private $_use_search;
|
||||
private $_use_bulk_actions;
|
||||
private $_use_checkbox;
|
||||
private $_show_collapse_expand_button = true;
|
||||
private $_auto_select_children = false;
|
||||
private $_max_height = 350;
|
||||
|
||||
|
||||
public function setUseSearch($value)
|
||||
{
|
||||
$this->_use_search = (bool)$value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function useSearch()
|
||||
{
|
||||
return (isset($this->_use_search) && $this->_use_search);
|
||||
}
|
||||
|
||||
public function setAutoSelectChildren($value)
|
||||
{
|
||||
$this->_auto_select_children = (bool)$value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function autoSelectChildren()
|
||||
{
|
||||
return (isset($this->_auto_select_children) && $this->_auto_select_children);
|
||||
}
|
||||
|
||||
|
||||
public function setUseBulkActions($value)
|
||||
{
|
||||
$this->_use_bulk_actions = (bool)$value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function useBulkActions()
|
||||
{
|
||||
return (isset($this->_use_bulk_actions) && $this->_use_bulk_actions);
|
||||
}
|
||||
|
||||
public function setUseCheckBox($value)
|
||||
{
|
||||
$this->_use_checkbox = (bool)$value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function useCheckBox()
|
||||
{
|
||||
return (isset($this->_use_checkbox) && $this->_use_checkbox);
|
||||
}
|
||||
|
||||
public function setShowCollapseExpandButton($value)
|
||||
{
|
||||
$this->_show_collapse_expand_button = (bool)$value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setMaxHeight($value)
|
||||
{
|
||||
$this->_max_height = (bool)$value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function maxHeight()
|
||||
{
|
||||
return $this->_max_height;
|
||||
}
|
||||
|
||||
|
||||
public function showCollapseExpandButton()
|
||||
{
|
||||
return (isset($this->_show_collapse_expand_button) && $this->_show_collapse_expand_button);
|
||||
}
|
||||
|
||||
public function render($data = null)
|
||||
{
|
||||
if ($this->useCheckBox()) {
|
||||
if($this->useBulkActions()) {
|
||||
$check_all = new TreeToolbarLink(
|
||||
'Check All',
|
||||
'#',
|
||||
'checkAll($(\'#'.$this->getId().'\')); return false;',
|
||||
'icon-check-sign');
|
||||
$check_all->setAttribute('id', 'check-all-'.$this->getId());
|
||||
$uncheck_all = new TreeToolbarLink(
|
||||
'Uncheck All',
|
||||
'#',
|
||||
'uncheckAll($(\'#'.$this->getId().'\')); return false;',
|
||||
'icon-check-empty');
|
||||
$uncheck_all->setAttribute('id', 'uncheck-all-'.$this->getId());
|
||||
$this->addAction($check_all);
|
||||
$this->addAction($uncheck_all);
|
||||
}
|
||||
$this->setNodeFolderTemplate('tree_node_folder_checkbox.tpl');
|
||||
$this->setNodeItemTemplate('tree_node_item_checkbox.tpl');
|
||||
$this->setAttribute('use_checkbox', $this->useCheckBox());
|
||||
}
|
||||
|
||||
if ($this->useSearch()) {
|
||||
$this->addAction(new TreeToolbarSearch(
|
||||
$this->getId().' search',
|
||||
$this->getId().'-search')
|
||||
);
|
||||
$this->setAttribute('use_search', $this->useSearch());
|
||||
}
|
||||
$this->setAttribute('auto_select_children', $this->autoSelectChildren());
|
||||
|
||||
if ($this->showCollapseExpandButton()) {
|
||||
$collapse_all = new TreeToolbarLink(
|
||||
'Collapse All',
|
||||
'#',
|
||||
'$(\'#'.$this->getId().'\').tree(\'collapseAll\');$(\'#collapse-all-'.$this->getId().'\').hide();$(\'#expand-all-'.$this->getId().'\').show(); return false;',
|
||||
'icon-collapse-alt');
|
||||
$collapse_all->setAttribute('id', 'collapse-all-'.$this->getId());
|
||||
$expand_all = new TreeToolbarLink(
|
||||
'Expand All',
|
||||
'#',
|
||||
'$(\'#'.$this->getId().'\').tree(\'expandAll\');$(\'#collapse-all-'.$this->getId().'\').show();$(\'#expand-all-'.$this->getId().'\').hide(); return false;',
|
||||
'icon-expand-alt');
|
||||
$expand_all->setAttribute('id', 'expand-all-'.$this->getId());
|
||||
$this->addAction($collapse_all);
|
||||
$this->addAction($expand_all);
|
||||
}
|
||||
|
||||
$this->setAttribute('max_height', $this->maxHeight());
|
||||
$this->setAttribute('root_selectable', $this->rootElementSelectable());
|
||||
|
||||
|
||||
return parent::render($data);
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,7 @@ class HelperTreeCategoriesCore extends TreeCore
|
||||
|
||||
private $_disabled_categories;
|
||||
private $_input_name;
|
||||
private $_input_id;
|
||||
private $_lang;
|
||||
private $_root_category;
|
||||
private $_selected_categories;
|
||||
@@ -69,6 +70,8 @@ class HelperTreeCategoriesCore extends TreeCore
|
||||
foreach ($categories[$rootCategoryId] as $category) {
|
||||
$categoryId = (int)$category['id_category'];
|
||||
$tree[$categoryId] = $category;
|
||||
$tree[$categoryId]['value'] = $category['id_category'];
|
||||
$tree[$categoryId]['input_name'] = 'categoryBox';
|
||||
|
||||
if (Category::hasChildren($categoryId, $this->getLang(), false, $this->getShop()->id)) {
|
||||
$categoryChildren = Category::getChildren(
|
||||
@@ -144,7 +147,8 @@ class HelperTreeCategoriesCore extends TreeCore
|
||||
}
|
||||
|
||||
$tree = Category::getCategoryInformations(array($root_category), $lang);
|
||||
|
||||
$tree[$root_category]['value'] = $tree[$root_category]['id_category'];
|
||||
$tree[$root_category]['input_name'] = 'categoryBox';
|
||||
$children = $this->fillTree($categories, $root_category);
|
||||
|
||||
if (!empty($children)) {
|
||||
@@ -214,6 +218,21 @@ class HelperTreeCategoriesCore extends TreeCore
|
||||
return $this->_input_name;
|
||||
}
|
||||
|
||||
public function setInputId($value)
|
||||
{
|
||||
$this->_input_id = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getInputId()
|
||||
{
|
||||
if (!isset($this->_input_id)) {
|
||||
$this->setInputId('id_category');
|
||||
}
|
||||
|
||||
return $this->_input_id;
|
||||
}
|
||||
|
||||
public function setLang($value)
|
||||
{
|
||||
$this->_lang = $value;
|
||||
@@ -229,24 +248,6 @@ class HelperTreeCategoriesCore extends TreeCore
|
||||
return $this->_lang;
|
||||
}
|
||||
|
||||
public function getNodeFolderTemplate()
|
||||
{
|
||||
if (!isset($this->_node_folder_template)) {
|
||||
$this->setNodeFolderTemplate(self::DEFAULT_NODE_FOLDER_TEMPLATE);
|
||||
}
|
||||
|
||||
return $this->_node_folder_template;
|
||||
}
|
||||
|
||||
public function getNodeItemTemplate()
|
||||
{
|
||||
if (!isset($this->_node_item_template)) {
|
||||
$this->setNodeItemTemplate(self::DEFAULT_NODE_ITEM_TEMPLATE);
|
||||
}
|
||||
|
||||
return $this->_node_item_template;
|
||||
}
|
||||
|
||||
public function setRootCategory($value)
|
||||
{
|
||||
if (!Validate::isInt($value)) {
|
||||
@@ -304,15 +305,6 @@ class HelperTreeCategoriesCore extends TreeCore
|
||||
return $this->_shop;
|
||||
}
|
||||
|
||||
public function getTemplate()
|
||||
{
|
||||
if (!isset($this->_template)) {
|
||||
$this->setTemplate(self::DEFAULT_TEMPLATE);
|
||||
}
|
||||
|
||||
return $this->_template;
|
||||
}
|
||||
|
||||
public function setUseCheckBox($value)
|
||||
{
|
||||
$this->_use_checkbox = (bool)$value;
|
||||
@@ -430,7 +422,7 @@ class HelperTreeCategoriesCore extends TreeCore
|
||||
}
|
||||
|
||||
/* Override */
|
||||
public function renderNodes($data = null)
|
||||
public function renderNodes($data = null, $root = false)
|
||||
{
|
||||
if (!isset($data)) {
|
||||
$data = $this->getData();
|
||||
@@ -449,6 +441,7 @@ class HelperTreeCategoriesCore extends TreeCore
|
||||
$this->getContext()->smarty
|
||||
)->assign(array(
|
||||
'input_name' => $this->getInputName(),
|
||||
'input_id' => $this->getInputId(),
|
||||
'children' => $this->renderNodes($item['children']),
|
||||
'node' => $item
|
||||
))->fetch();
|
||||
@@ -458,6 +451,7 @@ class HelperTreeCategoriesCore extends TreeCore
|
||||
$this->getContext()->smarty
|
||||
)->assign(array(
|
||||
'input_name' => $this->getInputName(),
|
||||
'input_id' => $this->getInputId(),
|
||||
'node' => $item
|
||||
))->fetch();
|
||||
}
|
||||
|
||||
@@ -1,485 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
class HelperTreeHotelsCore extends TreeCore
|
||||
{
|
||||
const DEFAULT_TEMPLATE = 'tree_categories.tpl';
|
||||
const DEFAULT_NODE_FOLDER_TEMPLATE = 'tree_node_folder_radio.tpl';
|
||||
const DEFAULT_NODE_ITEM_TEMPLATE = 'tree_node_item_radio.tpl';
|
||||
|
||||
private $_disabled_categories;
|
||||
private $_input_name;
|
||||
private $_lang;
|
||||
private $_root_category;
|
||||
private $_selected_hotels;
|
||||
private $_selected_room_types;
|
||||
private $_full_tree = false;
|
||||
private $_shop;
|
||||
private $_use_checkbox;
|
||||
private $_use_bulk_actions = true;
|
||||
private $_use_search;
|
||||
private $_use_shop_restriction;
|
||||
private $_rooms_only = false;
|
||||
private $_disable_all_categories = false;
|
||||
private $_accessed_hotels = false;
|
||||
|
||||
public function __construct($id, $title = null, $root_category = null,
|
||||
$lang = null, $use_shop_restriction = true)
|
||||
{
|
||||
parent::__construct($id);
|
||||
|
||||
if (isset($title)) {
|
||||
$this->setTitle($title);
|
||||
}
|
||||
|
||||
if (isset($root_category)) {
|
||||
$this->setRootCategory($root_category);
|
||||
}
|
||||
|
||||
$this->setLang($lang);
|
||||
$this->setUseShopRestriction($use_shop_restriction);
|
||||
}
|
||||
|
||||
private function fillTree($hotels, $onlyRoomType = false)
|
||||
{
|
||||
$tree = array();
|
||||
$idLang = Context::getContext()->language->id;
|
||||
$objRoomType = new HotelRoomType();
|
||||
foreach($hotels as $hotel) {
|
||||
|
||||
if (!$onlyRoomType) {
|
||||
$tree[$hotel['id_hotel']] = array(
|
||||
'id_hotel' => $hotel['id_hotel'],
|
||||
'id_category' => $hotel['id_category'],
|
||||
'name' => $hotel['hotel_name'],
|
||||
'children' => array()
|
||||
);
|
||||
}
|
||||
|
||||
if (!empty($roomTypes = $objRoomType->getRoomTypeByHotelId($hotel['id_hotel'], $idLang))) {
|
||||
if ($onlyRoomType) {
|
||||
$tree = array_merge($tree, $roomTypes);
|
||||
} else {
|
||||
$tree[$hotel['id_hotel']]['children'] = array_merge($tree[$hotel['id_hotel']]['children'], $roomTypes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $tree;
|
||||
}
|
||||
|
||||
public function getData()
|
||||
{
|
||||
if (!isset($this->_data)) {
|
||||
$shop = $this->getShop();
|
||||
$lang = $this->getLang();
|
||||
$root_category = (int)$this->getRootCategory();
|
||||
if (($hotels = $this->getAccessedHotels()) === false) {
|
||||
$objHotelBanch = new HotelBranchInformation();
|
||||
$hotels = $objHotelBanch->hotelBranchesInfo();
|
||||
}
|
||||
$tree = $this->fillTree($hotels, $this->_rooms_only);
|
||||
if (!empty($children)) {
|
||||
$tree[$root_category]['children'] = $children;
|
||||
}
|
||||
|
||||
$this->setData($tree);
|
||||
$this->setDataSearch(Category::getAllCategoriesName($root_category, $lang, false, null, $this->useShopRestriction()));
|
||||
}
|
||||
|
||||
return $this->_data;
|
||||
}
|
||||
|
||||
public function setRoomsOnly($value)
|
||||
{
|
||||
$this->_rooms_only = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setFullTree($value)
|
||||
{
|
||||
$this->_full_tree = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFullTree()
|
||||
{
|
||||
return $this->_full_tree;
|
||||
}
|
||||
|
||||
|
||||
public function setDisabledCategories($value)
|
||||
{
|
||||
$this->_disabled_categories = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setAccessedHotels($values)
|
||||
{
|
||||
$this->_accessed_hotels = $values;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAccessedHotels()
|
||||
{
|
||||
return $this->_accessed_hotels;
|
||||
}
|
||||
|
||||
public function setDisablAllCategories($value)
|
||||
{
|
||||
$this->_disable_all_categories = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDisabledCategories()
|
||||
{
|
||||
return $this->_disabled_categories;
|
||||
}
|
||||
|
||||
public function getDisablAllCategories()
|
||||
{
|
||||
return $this->_disable_all_categories;
|
||||
}
|
||||
|
||||
public function setInputName($value)
|
||||
{
|
||||
$this->_input_name = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getInputName()
|
||||
{
|
||||
if (!isset($this->_input_name)) {
|
||||
$this->setInputName('categoryBox');
|
||||
}
|
||||
|
||||
return $this->_input_name;
|
||||
}
|
||||
|
||||
public function setLang($value)
|
||||
{
|
||||
$this->_lang = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLang()
|
||||
{
|
||||
if (!isset($this->_lang)) {
|
||||
$this->setLang($this->getContext()->employee->id_lang);
|
||||
}
|
||||
|
||||
return $this->_lang;
|
||||
}
|
||||
|
||||
public function getNodeFolderTemplate()
|
||||
{
|
||||
if (!isset($this->_node_folder_template)) {
|
||||
$this->setNodeFolderTemplate(self::DEFAULT_NODE_FOLDER_TEMPLATE);
|
||||
}
|
||||
|
||||
return $this->_node_folder_template;
|
||||
}
|
||||
|
||||
public function getNodeItemTemplate()
|
||||
{
|
||||
if (!isset($this->_node_item_template)) {
|
||||
$this->setNodeItemTemplate(self::DEFAULT_NODE_ITEM_TEMPLATE);
|
||||
}
|
||||
|
||||
return $this->_node_item_template;
|
||||
}
|
||||
|
||||
public function setRootCategory($value)
|
||||
{
|
||||
if (!Validate::isInt($value)) {
|
||||
throw new PrestaShopException('Root category must be an integer value');
|
||||
}
|
||||
|
||||
$this->_root_category = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRootCategory()
|
||||
{
|
||||
return $this->_root_category;
|
||||
}
|
||||
|
||||
public function setSelectedHotels($value)
|
||||
{
|
||||
if (!is_array($value)) {
|
||||
throw new PrestaShopException('Selected categories value must be an array');
|
||||
}
|
||||
|
||||
$this->_selected_hotels = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSelectedHotels()
|
||||
{
|
||||
if (!isset($this->_selected_hotels)) {
|
||||
$this->_selected_hotels = array();
|
||||
}
|
||||
|
||||
return $this->_selected_hotels;
|
||||
}
|
||||
|
||||
public function setSelectedRoomTypes($value)
|
||||
{
|
||||
if (!is_array($value)) {
|
||||
throw new PrestaShopException('Selected categories value must be an array');
|
||||
}
|
||||
|
||||
$this->_selected_room_types = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSelectedRoomTypes()
|
||||
{
|
||||
if (!isset($this->_selected_room_types)) {
|
||||
$this->_selected_room_types = array();
|
||||
}
|
||||
|
||||
return $this->_selected_room_types;
|
||||
}
|
||||
|
||||
public function setShop($value)
|
||||
{
|
||||
$this->_shop = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getShop()
|
||||
{
|
||||
if (!isset($this->_shop)) {
|
||||
if (Tools::isSubmit('id_shop')) {
|
||||
$this->setShop(new Shop(Tools::getValue('id_shop')));
|
||||
} elseif ($this->getContext()->shop->id) {
|
||||
$this->setShop(new Shop($this->getContext()->shop->id));
|
||||
} elseif (!Shop::isFeatureActive()) {
|
||||
$this->setShop(new Shop(Configuration::get('PS_SHOP_DEFAULT')));
|
||||
} else {
|
||||
$this->setShop(new Shop(0));
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_shop;
|
||||
}
|
||||
|
||||
public function getTemplate()
|
||||
{
|
||||
if (!isset($this->_template)) {
|
||||
$this->setTemplate(self::DEFAULT_TEMPLATE);
|
||||
}
|
||||
|
||||
return $this->_template;
|
||||
}
|
||||
|
||||
public function setUseCheckBox($value)
|
||||
{
|
||||
$this->_use_checkbox = (bool)$value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setUseBulkActions($value)
|
||||
{
|
||||
$this->_use_bulk_actions = (bool)$value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setUseSearch($value)
|
||||
{
|
||||
$this->_use_search = (bool)$value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setUseShopRestriction($value)
|
||||
{
|
||||
$this->_use_shop_restriction = (bool)$value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function useCheckBox()
|
||||
{
|
||||
return (isset($this->_use_checkbox) && $this->_use_checkbox);
|
||||
}
|
||||
|
||||
public function useBulkActions()
|
||||
{
|
||||
return (isset($this->_use_bulk_actions) && $this->_use_bulk_actions);
|
||||
}
|
||||
|
||||
public function useSearch()
|
||||
{
|
||||
return (isset($this->_use_search) && $this->_use_search);
|
||||
}
|
||||
|
||||
public function useShopRestriction()
|
||||
{
|
||||
return (isset($this->_use_shop_restriction) && $this->_use_shop_restriction);
|
||||
}
|
||||
|
||||
public function render($data = null)
|
||||
{
|
||||
if (!isset($data)) {
|
||||
$data = $this->getData();
|
||||
}
|
||||
|
||||
if (isset($this->_disabled_categories)
|
||||
&& !empty($this->_disabled_categories)) {
|
||||
$this->_disableCategories($data, $this->getDisabledCategories());
|
||||
}
|
||||
|
||||
if($this->getDisablAllCategories()) {
|
||||
$this->_disableCategories($data);
|
||||
}
|
||||
|
||||
//Default bootstrap style of search is push-right, so we add this button first
|
||||
if ($this->useSearch()) {
|
||||
$this->addAction(new TreeToolbarSearchCategories(
|
||||
'Find a category:',
|
||||
$this->getId().'-categories-search')
|
||||
);
|
||||
$this->setAttribute('use_search', $this->useSearch());
|
||||
}
|
||||
|
||||
$collapse_all = new TreeToolbarLink(
|
||||
'Collapse All',
|
||||
'#',
|
||||
'$(\'#'.$this->getId().'\').tree(\'collapseAll\');$(\'#collapse-all-'.$this->getId().'\').hide();$(\'#expand-all-'.$this->getId().'\').show(); return false;',
|
||||
'icon-collapse-alt');
|
||||
$collapse_all->setAttribute('id', 'collapse-all-'.$this->getId());
|
||||
|
||||
$expand_all = new TreeToolbarLink(
|
||||
'Expand All',
|
||||
'#',
|
||||
'$(\'#'.$this->getId().'\').tree(\'expandAll\');$(\'#collapse-all-'.$this->getId().'\').show();$(\'#expand-all-'.$this->getId().'\').hide(); return false;',
|
||||
'icon-expand-alt');
|
||||
$expand_all->setAttribute('id', 'expand-all-'.$this->getId());
|
||||
$this->addAction($collapse_all);
|
||||
$this->addAction($expand_all);
|
||||
|
||||
if ($this->useCheckBox()) {
|
||||
if ($this->useBulkActions()) {
|
||||
$check_all = new TreeToolbarLink(
|
||||
'Check All',
|
||||
'#',
|
||||
'checkAllAssociatedHotels($(\'#'.$this->getId().'\'));return false;',
|
||||
'icon-check-sign');
|
||||
$check_all->setAttribute('id', 'check-all-'.$this->getId());
|
||||
$uncheck_all = new TreeToolbarLink(
|
||||
'Uncheck All',
|
||||
'#',
|
||||
'uncheckAllAssociatedHotels($(\'#'.$this->getId().'\'));return false;',
|
||||
'icon-check-empty');
|
||||
$uncheck_all->setAttribute('id', 'uncheck-all-'.$this->getId());
|
||||
$this->addAction($check_all);
|
||||
$this->addAction($uncheck_all);
|
||||
}
|
||||
|
||||
$this->setNodeFolderTemplate('tree_node_hotel_folder_checkbox.tpl');
|
||||
$this->setNodeItemTemplate('tree_node_hotel_item_checkbox.tpl');
|
||||
$this->setAttribute('use_checkbox', $this->useCheckBox());
|
||||
}
|
||||
|
||||
$this->setAttribute('selected_hotels', $this->getSelectedHotels());
|
||||
$this->setAttribute('selected_roomtypes', $this->getSelectedRoomTypes());
|
||||
$this->getContext()->smarty->assign('root_category', Configuration::get('PS_ROOT_CATEGORY'));
|
||||
$this->getContext()->smarty->assign('token', Tools::getAdminTokenLite('AdminProducts'));
|
||||
return parent::render($data);
|
||||
}
|
||||
|
||||
/* Override */
|
||||
public function renderNodes($data = null)
|
||||
{
|
||||
if (!isset($data)) {
|
||||
$data = $this->getData();
|
||||
}
|
||||
|
||||
if (!is_array($data) && !$data instanceof Traversable) {
|
||||
throw new PrestaShopException('Data value must be an traversable array');
|
||||
}
|
||||
|
||||
$html = '';
|
||||
foreach ($data as $item) {
|
||||
if (array_key_exists('children', $item)) {
|
||||
$html .= $this->getContext()->smarty->createTemplate(
|
||||
$this->getTemplateFile($this->getNodeFolderTemplate()),
|
||||
$this->getContext()->smarty
|
||||
)->assign(array(
|
||||
'input_name' => 'hotelBox',
|
||||
'children' => $this->renderNodes($item['children']),
|
||||
'node' => $item
|
||||
))->fetch();
|
||||
} else {
|
||||
$html .= $this->getContext()->smarty->createTemplate(
|
||||
$this->getTemplateFile($this->getNodeItemTemplate()),
|
||||
$this->getContext()->smarty
|
||||
)->assign(array(
|
||||
'input_name' => 'roomTypeBox',
|
||||
'node' => $item
|
||||
))->fetch();
|
||||
}
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
private function _disableCategories(&$categories, $disabled_categories = null)
|
||||
{
|
||||
foreach ($categories as &$category) {
|
||||
if (!isset($disabled_categories) || in_array($category['id_category'], $disabled_categories)) {
|
||||
$category['disabled'] = true;
|
||||
if (array_key_exists('children', $category) && is_array($category['children'])) {
|
||||
self::_disableCategories($category['children']);
|
||||
}
|
||||
} elseif (array_key_exists('children', $category) && is_array($category['children'])) {
|
||||
self::_disableCategories($category['children'], $disabled_categories);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function _getSelectedChildNumbers(&$categories, $selected, &$parent = null)
|
||||
{
|
||||
$selected_childs = 0;
|
||||
|
||||
foreach ($categories as $key => &$category) {
|
||||
if (isset($parent) && in_array($category['id_category'], $selected)) {
|
||||
$selected_childs++;
|
||||
}
|
||||
|
||||
if (isset($category['children']) && !empty($category['children'])) {
|
||||
$selected_childs += $this->_getSelectedChildNumbers($category['children'], $selected, $category);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($parent['selected_childs'])) {
|
||||
$parent['selected_childs'] = 0;
|
||||
}
|
||||
|
||||
$parent['selected_childs'] = $selected_childs;
|
||||
return $selected_childs;
|
||||
}
|
||||
}
|
||||
@@ -68,24 +68,6 @@ class HelperTreeShopsCore extends TreeCore
|
||||
return $this->_lang;
|
||||
}
|
||||
|
||||
public function getNodeFolderTemplate()
|
||||
{
|
||||
if (!isset($this->_node_folder_template)) {
|
||||
$this->setNodeFolderTemplate(self::DEFAULT_NODE_FOLDER_TEMPLATE);
|
||||
}
|
||||
|
||||
return $this->_node_folder_template;
|
||||
}
|
||||
|
||||
public function getNodeItemTemplate()
|
||||
{
|
||||
if (!isset($this->_node_item_template)) {
|
||||
$this->setNodeItemTemplate(self::DEFAULT_NODE_ITEM_TEMPLATE);
|
||||
}
|
||||
|
||||
return $this->_node_item_template;
|
||||
}
|
||||
|
||||
public function setSelectedShops($value)
|
||||
{
|
||||
if (!is_array($value)) {
|
||||
@@ -105,15 +87,6 @@ class HelperTreeShopsCore extends TreeCore
|
||||
return $this->_selected_shops;
|
||||
}
|
||||
|
||||
public function getTemplate()
|
||||
{
|
||||
if (!isset($this->_template)) {
|
||||
$this->setTemplate(self::DEFAULT_TEMPLATE);
|
||||
}
|
||||
|
||||
return $this->_template;
|
||||
}
|
||||
|
||||
public function render($data = null, $use_default_actions = true, $use_selected_shop = true)
|
||||
{
|
||||
if (!isset($data)) {
|
||||
@@ -153,7 +126,7 @@ class HelperTreeShopsCore extends TreeCore
|
||||
return parent::render($data);
|
||||
}
|
||||
|
||||
public function renderNodes($data = null)
|
||||
public function renderNodes($data = null, $root = false)
|
||||
{
|
||||
if (!isset($data)) {
|
||||
$data = $this->getData();
|
||||
|
||||
@@ -1665,17 +1665,9 @@ abstract class ModuleCore
|
||||
if ($item->type == 'addonsMustHave') {
|
||||
$item->addons_buy_url = strip_tags((string)$modaddons->url);
|
||||
$prices = (array)$modaddons->price;
|
||||
$id_default_currency = Configuration::get('PS_CURRENCY_DEFAULT');
|
||||
|
||||
foreach ($prices as $currency => $price) {
|
||||
if ($id_currency = Currency::getIdByIsoCode($currency)) {
|
||||
$item->price = (float)$price;
|
||||
$item->id_currency = (int)$id_currency;
|
||||
|
||||
if ($id_default_currency == $id_currency) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
foreach ($prices as $key => $value) {
|
||||
$item->{$key} = $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -317,6 +317,8 @@ class OrderHistoryCore extends ObjectModel
|
||||
// if order is created by API then create a direct object instead of creating an object from module
|
||||
if ($order->module == 'wsorder') {
|
||||
$payment_method = new WebserviceOrder();
|
||||
} else if ($order->module == 'bo_order') {
|
||||
$payment_method = new BoOrder();
|
||||
} else {
|
||||
$payment_method = Module::getInstanceByName($order->module);
|
||||
}
|
||||
|
||||
@@ -206,6 +206,11 @@ class OrderReturnCore extends ObjectModel
|
||||
$objBookingDemands = new HotelBookingDemands();
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
|
||||
$calcServicePriceFirst = false;
|
||||
if ($objOrder->is_advance_payment && $objOrder->advance_paid_amount <= $objOrder->total_paid_real) {
|
||||
$calcServicePriceFirst = true;
|
||||
}
|
||||
|
||||
foreach ($returnDetails as $key => &$bookingRow) {
|
||||
if ($skipReqCompletedNonRefunded) {
|
||||
$objReturnState = new OrderReturnState($bookingRow['id_return_state']);
|
||||
@@ -219,24 +224,27 @@ class OrderReturnCore extends ObjectModel
|
||||
$bookingRow['extra_service_total_paid_amount'] = 0;
|
||||
$bookingRow['extra_service_total_price_tax_incl'] = 0;
|
||||
$bookingRow['room_paid_amount'] = 0;
|
||||
if ($bookingRow['total_price_tax_incl'] > 0) {
|
||||
if ($objOrder->total_paid_real > 0) {
|
||||
$bookingRow['room_paid_amount'] = ($objOrder->total_paid_real*$bookingRow['total_price_tax_incl'])/$objOrder->total_paid_tax_incl;
|
||||
}
|
||||
}
|
||||
|
||||
$roomSelectedDemands = $objBookingDemands->getRoomTypeBookingExtraDemands(
|
||||
$idOrder,
|
||||
$bookingRow['id_product'],
|
||||
$bookingRow['id_room'],
|
||||
$bookingRow['date_from'],
|
||||
$bookingRow['date_to'],
|
||||
0
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
$bookingRow['id']
|
||||
);
|
||||
if (count($roomSelectedDemands)) {
|
||||
foreach ($roomSelectedDemands as $demand) {
|
||||
if ($demand['total_price_tax_incl'] > 0) {
|
||||
if ($objOrder->total_paid_real > 0) {
|
||||
$bookingRow['extra_service_total_paid_amount'] += ($objOrder->total_paid_real*$demand['total_price_tax_incl'])/$objOrder->total_paid_tax_incl;
|
||||
if ($calcServicePriceFirst) {
|
||||
$bookingRow['extra_service_total_paid_amount'] += $demand['total_price_tax_incl'];
|
||||
} else {
|
||||
$bookingRow['extra_service_total_paid_amount'] += ($objOrder->total_paid_real*$demand['total_price_tax_incl'])/($objOrder->total_paid_tax_incl + $objOrder->total_discounts_tax_incl);
|
||||
}
|
||||
}
|
||||
$bookingRow['extra_service_total_price_tax_incl'] += $demand['total_price_tax_incl'];
|
||||
}
|
||||
@@ -250,13 +258,27 @@ class OrderReturnCore extends ObjectModel
|
||||
foreach ($roomSelectedServices['additional_services'] as $service) {
|
||||
if ($service['total_price_tax_incl'] > 0) {
|
||||
if ($objOrder->total_paid_real > 0) {
|
||||
$bookingRow['extra_service_total_paid_amount'] += ($objOrder->total_paid_real*$service['total_price_tax_incl'])/$objOrder->total_paid_tax_incl;
|
||||
if ($calcServicePriceFirst) {
|
||||
$bookingRow['extra_service_total_paid_amount'] += $service['total_price_tax_incl'];
|
||||
} else {
|
||||
$bookingRow['extra_service_total_paid_amount'] += ($objOrder->total_paid_real*$service['total_price_tax_incl'])/($objOrder->total_paid_tax_incl + $objOrder->total_discounts_tax_incl);
|
||||
}
|
||||
}
|
||||
$bookingRow['extra_service_total_price_tax_incl'] += $service['total_price_tax_incl'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($bookingRow['total_price_tax_incl'] > 0) {
|
||||
if ($objOrder->total_paid_real > 0) {
|
||||
if ($calcServicePriceFirst) {
|
||||
$totalRoomShare = ($objOrder->total_paid_real*($bookingRow['total_price_tax_incl'] + $bookingRow['extra_service_total_price_tax_incl'])/ ($objOrder->total_paid_tax_incl + $objOrder->total_discounts_tax_incl));
|
||||
$bookingRow['room_paid_amount'] += $totalRoomShare - $bookingRow['extra_service_total_price_tax_incl'];
|
||||
} else {
|
||||
$bookingRow['room_paid_amount'] = ($objOrder->total_paid_real*$bookingRow['total_price_tax_incl'])/ ($objOrder->total_paid_tax_incl + $objOrder->total_discounts_tax_incl);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($customerView) {
|
||||
$dateJoin = $bookingRow['id_product'].'_'.strtotime($bookingRow['date_from']).strtotime($bookingRow['date_to']);
|
||||
if (isset($returnsCustView[$dateJoin]['num_rooms'])) {
|
||||
|
||||
@@ -54,4 +54,30 @@ class OrderReturnDetailCore extends ObjectModel
|
||||
'refunded_amount' => array('type' => self::TYPE_FLOAT),
|
||||
),
|
||||
);
|
||||
|
||||
public static function getReturnDetailByIdBookingDetail($idHtlBooking)
|
||||
{
|
||||
$idOrderReturnDetail = Db::getInstance()->getValue('
|
||||
SELECT `id_order_return_detail` FROM `'._DB_PREFIX_.'order_return_detail` ord
|
||||
WHERE `id_htl_booking` = '.(int)$idHtlBooking
|
||||
);
|
||||
|
||||
if ($idOrderReturnDetail) {
|
||||
return new OrderReturnDetail($idOrderReturnDetail);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function deleteReturnDetailByIdBookingDetail($idOrder, $idHtlBooking)
|
||||
{
|
||||
if (Validate::isLoadedObject($objOrderReturnDetail = OrderReturnDetail::getReturnDetailByIdBookingDetail($idHtlBooking))) {
|
||||
if ($objOrderReturnDetail->delete()) {
|
||||
$objOrderReturn = new OrderReturn();
|
||||
if (empty($objOrderReturn->getOrderRefundRequestedBookings($idOrder, $objOrderReturnDetail->id_order_return, true))) {
|
||||
$objOrderReturn = new OrderReturn($objOrderReturnDetail->id_order_return);
|
||||
$objOrderReturn->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -372,62 +372,6 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
$cart_htl_data[$type_key]['unit_price_tax_incl'] = $unit_price_tax_incl;
|
||||
|
||||
if (isset($cart_htl_data[$type_key]['date_diff'][$date_join])) {
|
||||
// $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
// $order_obj->id,
|
||||
// $type_value['product_id'],
|
||||
// 0,
|
||||
// $data_v['date_from'],
|
||||
// $data_v['date_to']
|
||||
// );
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order_obj->id,
|
||||
$type_value['product_id'],
|
||||
0,
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
$type_value['id_order_detail']
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order_obj->id,
|
||||
$type_value['product_id'],
|
||||
0,
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
$type_value['id_order_detail']
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order_obj->id,
|
||||
0,
|
||||
0,
|
||||
$data_v['id_product'],
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
$data_v['id_room'],
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
Product::PRICE_ADDITION_TYPE_WITH_ROOM
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order_obj->id,
|
||||
0,
|
||||
0,
|
||||
$data_v['id_product'],
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
$data_v['id_room'],
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
Product::PRICE_ADDITION_TYPE_WITH_ROOM
|
||||
);
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['num_rm'] += 1;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['adults'] += $data_v['adults'];
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['children'] += $data_v['children'];
|
||||
@@ -437,20 +381,13 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] = $data_v['total_price_tax_excl']/$num_days;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_excl']/$num_days;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] += ($cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'];
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount'] += ($data_v['total_price_tax_excl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount'] += ($data_v['total_price_tax_excl']);
|
||||
|
||||
// For order refund
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['id_room'] = $data_v['id_room'];
|
||||
} else {
|
||||
// $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
// $order_obj->id,
|
||||
// $type_value['product_id'],
|
||||
// 0,
|
||||
// $data_v['date_from'],
|
||||
// $data_v['date_to']
|
||||
// );
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order_obj->id,
|
||||
$type_value['product_id'],
|
||||
@@ -460,6 +397,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
$type_value['id_order_detail']
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
@@ -471,6 +409,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
$type_value['id_order_detail']
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
@@ -513,7 +452,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
$data_v['id_product'],
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
$data_v['id_room'],
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
@@ -526,7 +465,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
$data_v['id_product'],
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
$data_v['id_room'],
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
@@ -559,7 +498,11 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
$type_value['product_id'],
|
||||
$data_v['id_room'],
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to']
|
||||
$data_v['date_to'],
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
$data_v['id']
|
||||
)) {
|
||||
$extraDemands = array_shift($extraDemands);
|
||||
$extraDemands['product_id'] = $type_value['product_id'];
|
||||
@@ -569,16 +512,12 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
$room_extra_demands[] = $extraDemands;
|
||||
}
|
||||
|
||||
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order_obj->id,
|
||||
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
|
||||
$data_v['id'],
|
||||
0,
|
||||
0,
|
||||
$type_value['product_id'],
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
$data_v['id_room']
|
||||
1,
|
||||
0
|
||||
)) {
|
||||
$additionalServices = array_shift($additionalServices);
|
||||
$additionalServices['product_id'] = $type_value['product_id'];
|
||||
$additionalServices['room_type_name'] = $type_value['product_name'];
|
||||
$additionalServices['date_from'] = $data_v['date_from'];
|
||||
|
||||
@@ -42,6 +42,8 @@ class TreeCore
|
||||
protected $_node_folder_template;
|
||||
protected $_node_item_template;
|
||||
protected $_template;
|
||||
private $_root_element_selectable = true;
|
||||
|
||||
|
||||
/** @var string */
|
||||
private $_template_directory;
|
||||
@@ -191,7 +193,7 @@ class TreeCore
|
||||
public function getHeaderTemplate()
|
||||
{
|
||||
if (!isset($this->_headerTemplate)) {
|
||||
$this->setHeaderTemplate(self::DEFAULT_HEADER_TEMPLATE);
|
||||
$this->setHeaderTemplate(static::DEFAULT_HEADER_TEMPLATE);
|
||||
}
|
||||
|
||||
return $this->_headerTemplate;
|
||||
@@ -217,7 +219,7 @@ class TreeCore
|
||||
public function getNodeFolderTemplate()
|
||||
{
|
||||
if (!isset($this->_node_folder_template)) {
|
||||
$this->setNodeFolderTemplate(self::DEFAULT_NODE_FOLDER_TEMPLATE);
|
||||
$this->setNodeFolderTemplate(static::DEFAULT_NODE_FOLDER_TEMPLATE);
|
||||
}
|
||||
|
||||
return $this->_node_folder_template;
|
||||
@@ -232,7 +234,7 @@ class TreeCore
|
||||
public function getNodeItemTemplate()
|
||||
{
|
||||
if (!isset($this->_node_item_template)) {
|
||||
$this->setNodeItemTemplate(self::DEFAULT_NODE_ITEM_TEMPLATE);
|
||||
$this->setNodeItemTemplate(static::DEFAULT_NODE_ITEM_TEMPLATE);
|
||||
}
|
||||
|
||||
return $this->_node_item_template;
|
||||
@@ -247,7 +249,7 @@ class TreeCore
|
||||
public function getTemplate()
|
||||
{
|
||||
if (!isset($this->_template)) {
|
||||
$this->setTemplate(self::DEFAULT_TEMPLATE);
|
||||
$this->setTemplate(static::DEFAULT_TEMPLATE);
|
||||
}
|
||||
|
||||
return $this->_template;
|
||||
@@ -271,7 +273,7 @@ class TreeCore
|
||||
{
|
||||
if (!isset($this->_template_directory)) {
|
||||
$this->_template_directory = $this->_normalizeDirectory(
|
||||
self::DEFAULT_TEMPLATE_DIRECTORY);
|
||||
static::DEFAULT_TEMPLATE_DIRECTORY);
|
||||
}
|
||||
|
||||
return $this->_template_directory;
|
||||
@@ -342,6 +344,17 @@ class TreeCore
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setRootElementSelectable($value)
|
||||
{
|
||||
$this->_root_element_selectable = (bool)$value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function rootElementSelectable()
|
||||
{
|
||||
return (isset($this->_root_element_selectable) && $this->_root_element_selectable);
|
||||
}
|
||||
|
||||
public function getToolbar()
|
||||
{
|
||||
if (isset($this->_toolbar)) {
|
||||
@@ -419,14 +432,14 @@ class TreeCore
|
||||
//Assign Tree nodes
|
||||
$template->assign($this->getAttributes())->assign(array(
|
||||
'id' => $this->getId(),
|
||||
'nodes' => $this->renderNodes($data),
|
||||
'nodes' => $this->renderNodes($data, true),
|
||||
'id_tree' => $this->getIdTree()
|
||||
));
|
||||
|
||||
return (isset($html) ? $html : '').$template->fetch();
|
||||
}
|
||||
|
||||
public function renderNodes($data = null)
|
||||
public function renderNodes($data = null, $root = false)
|
||||
{
|
||||
if (!isset($data)) {
|
||||
$data = $this->getData();
|
||||
@@ -446,14 +459,16 @@ class TreeCore
|
||||
$this->getContext()->smarty
|
||||
)->assign(array(
|
||||
'children' => $this->renderNodes($item['children']),
|
||||
'node' => $item
|
||||
'node' => $item,
|
||||
'selectable' => !$root || $this->rootElementSelectable()
|
||||
))->fetch();
|
||||
} else {
|
||||
$html .= $this->getContext()->smarty->createTemplate(
|
||||
$this->getTemplateFile($this->getNodeItemTemplate()),
|
||||
$this->getContext()->smarty
|
||||
)->assign(array(
|
||||
'node' => $item
|
||||
'node' => $item,
|
||||
'selectable' => !$root || $this->rootElementSelectable()
|
||||
))->fetch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -632,6 +632,7 @@ class WebserviceOutputBuilderCore
|
||||
$value = $object_assoc;
|
||||
}
|
||||
if (empty($fields_assoc)) {
|
||||
$value['id'] = isset($value['id']) ? $value['id'] : '';
|
||||
$fields_assoc = array(array('id' => $value['id']));
|
||||
}
|
||||
$output_details .= $this->renderFlatAssociation($object, $depth, $assoc_name, $association['resource'], $fields_assoc, $value, $parent_details);
|
||||
@@ -680,7 +681,7 @@ class WebserviceOutputBuilderCore
|
||||
$field['sqlId'] = 'id';
|
||||
$field['value'] = isset($object_assoc['id']) ? $object_assoc['id'] : null;
|
||||
} elseif (!isset($field['sqlId'])) {
|
||||
$field['sqlId'] = $field_name;
|
||||
$field['sqlId'] = $field_name ? $field_name : 'id';
|
||||
$field['value'] = isset($object_assoc[$field_name]) ? $object_assoc[$field_name] : null;
|
||||
}
|
||||
|
||||
@@ -829,4 +830,10 @@ class WebserviceOutputBuilderCore
|
||||
{
|
||||
$this->fieldsToDisplay = $fields;
|
||||
}
|
||||
|
||||
public function setWsParameters($class, $parameters)
|
||||
{
|
||||
WebserviceOutputBuilder::$_cache_ws_parameters[$class] = $parameters;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ class WebserviceOutputXMLCore implements WebserviceOutputInterface
|
||||
if (array_key_exists('setter', $params['associations'][$assoc_name]) && !$params['associations'][$assoc_name]['setter']) {
|
||||
$more .= ' readOnly="true"';
|
||||
}
|
||||
$more .= ' nodeType="'.$params['associations'][$assoc_name]['resource'].'"';
|
||||
$more .= (isset($params['associations'][$assoc_name]['resource'])? ' nodeType="'.$params['associations'][$assoc_name]['resource'].'"' : ' ');
|
||||
if (isset($params['associations'][$assoc_name]['virtual_entity']) && $params['associations'][$assoc_name]['virtual_entity']) {
|
||||
$more .= ' virtualEntity="true"';
|
||||
} else {
|
||||
|
||||
@@ -290,6 +290,7 @@ class WebserviceRequestCore
|
||||
'room_type_options' => array('description' => 'The product options','class' => 'AttributeGroup'),
|
||||
'room_type_option_values' => array('description' => 'The product options value','class' => 'Attribute'),
|
||||
'room_types' => array('description' => 'The room types','class' => 'Product'),
|
||||
'services' => array('description' => 'Services', 'class' => 'Product', 'parameters_attribute' => 'webserviceServicesParameters'),
|
||||
'states' => array('description' => 'The available states of countries','class' => 'State'),
|
||||
'stores' => array('description' => 'The stores', 'class' => 'Store'),
|
||||
'suppliers' => array('description' => 'The product suppliers','class' => 'Supplier'),
|
||||
@@ -512,6 +513,8 @@ class WebserviceRequestCore
|
||||
$object = new $url_resource['class']();
|
||||
if (isset($this->resourceList[$this->urlSegment[0]]['parameters_attribute'])) {
|
||||
$this->resourceConfiguration = $object->getWebserviceParameters($this->resourceList[$this->urlSegment[0]]['parameters_attribute']);
|
||||
// Setting the parameters for the output builder in cache for the resources having parameters_attribute.
|
||||
$this->objOutput->setWsParameters($url_resource['class'], $this->resourceConfiguration);
|
||||
} else {
|
||||
$this->resourceConfiguration = $object->getWebserviceParameters();
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
'room_types' => array(),
|
||||
'hotels' => array(),
|
||||
'categories' => array(),
|
||||
'extra_service' => array(),
|
||||
// 'manufacturers' => array(),
|
||||
// 'suppliers' => array(),
|
||||
// 'stores' => array(),
|
||||
@@ -286,7 +287,9 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
|
||||
$this->imageType = $this->wsObject->urlSegment[1];
|
||||
// if image type requested is room_types then process products images
|
||||
if ($this->imageType == 'room_types') {
|
||||
if ($this->imageType == 'room_types'
|
||||
|| $this->imageType == 'extra_services'
|
||||
) {
|
||||
$this->imageType = 'products';
|
||||
}
|
||||
|
||||
|
||||
@@ -544,7 +544,8 @@ class AdminAddressesControllerCore extends AdminController
|
||||
$customer = Customer::searchByName($email);
|
||||
if (!empty($customer)) {
|
||||
$customer = $customer['0'];
|
||||
echo json_encode(array('infos' => pSQL($customer['firstname']).'_'.pSQL($customer['lastname']).'_'.pSQL($customer['company']).'_'.pSQL($customer['id_customer'])));
|
||||
$phone = Customer::getPhone($customer['id_customer']);
|
||||
echo json_encode(array('infos' => pSQL($customer['firstname']).'_'.pSQL($customer['lastname']).'_'.pSQL($customer['company']).'_'.pSQL($customer['id_customer']).'_'.pSQL($phone)));
|
||||
}
|
||||
}
|
||||
die;
|
||||
|
||||
@@ -41,7 +41,8 @@ class AdminCartRulesControllerCore extends AdminController
|
||||
|
||||
$this->context = Context::getContext();
|
||||
|
||||
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'),'icon' => 'icon-trash', 'confirm' => $this->l('Delete selected items?')));
|
||||
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'),'icon' => 'icon-trash'));
|
||||
$this->specificConfirmDelete = false;
|
||||
|
||||
$this->fields_list = array(
|
||||
'id_cart_rule' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'),
|
||||
@@ -143,15 +144,117 @@ class AdminCartRulesControllerCore extends AdminController
|
||||
echo json_encode(array('html' => $html, 'next_link' => $next_link));
|
||||
}
|
||||
|
||||
public function ajaxProcessInitCartRuleDeleteModal()
|
||||
{
|
||||
$response = array('success' => false);
|
||||
$modalConfirmDelete = $this->createTemplate('modal_confirm_delete.tpl');
|
||||
$modalClass = 'modal-md';
|
||||
if ($idCartRule = Tools::getValue('id_cart_rule')) {
|
||||
if ($generatedByDetails = CartRule::getGeneratedBy($idCartRule)) {
|
||||
if (Validate::isLoadedObject($objCartRule = new CartRule($idCartRule, $this->context->language->id))) {
|
||||
if ($generatedByDetails['generated_by'] == CartRule::GENERATED_BY_REFUND) {
|
||||
$obj = new OrderReturn($generatedByDetails['id_generated_by']);
|
||||
} else {
|
||||
$obj = new OrderSlip($generatedByDetails['id_generated_by']);
|
||||
}
|
||||
$objOrder = new Order($obj->id_order);
|
||||
$objCustomer = new Customer($objOrder->id_customer);
|
||||
|
||||
$modalConfirmDelete->assign(array(
|
||||
'generatedBy' => $generatedByDetails['generated_by'],
|
||||
'generatedById' => $generatedByDetails['id_generated_by'],
|
||||
'customer' => $objCustomer,
|
||||
'order' => $objOrder,
|
||||
'cartRule' => $objCartRule,
|
||||
'link' => $this->context->link
|
||||
));
|
||||
$modalClass = 'modal-lg';
|
||||
}
|
||||
}
|
||||
}
|
||||
$tpl = $this->createTemplate('modal.tpl');
|
||||
$tpl->assign(array(
|
||||
'modal_id' => 'moduleConfirmDelete',
|
||||
'modal_class' => $modalClass,
|
||||
'modal_content' => $modalConfirmDelete->fetch(),
|
||||
'modal_actions' => array(
|
||||
array(
|
||||
'type' => 'button',
|
||||
'class' => 'process_delete btn-primary',
|
||||
'label' => $this->l('Delete'),
|
||||
),
|
||||
),
|
||||
|
||||
));
|
||||
$response['confirm_delete'] = true;
|
||||
$response['modalHtml'] = $tpl->fetch();
|
||||
$response['confirm_delete'] = true;
|
||||
$response['success'] = true;
|
||||
|
||||
die(Tools::jsonEncode($response));
|
||||
}
|
||||
|
||||
public function ajaxProcessInitCartRuleBulkDeleteModal()
|
||||
{
|
||||
$response = array('success' => false);
|
||||
$modalConfirmDelete = $this->createTemplate('modal_confirm_bulk_delete.tpl');
|
||||
if ($idCartRules = Tools::getValue('id_cart_rules')) {
|
||||
$toConfirm = array();
|
||||
foreach($idCartRules as $idCartRule) {
|
||||
if ($ruleDetails = CartRule::getGeneratedBy($idCartRule)) {
|
||||
$ruleDetails['id_cart_rule'] = $idCartRule;
|
||||
$objCartRule = new CartRule($idCartRule, $this->context->language->id);
|
||||
$ruleDetails['cart_rule'] = $objCartRule;
|
||||
if ($ruleDetails['generated_by'] == CartRule::GENERATED_BY_REFUND) {
|
||||
$obj = new OrderReturn($ruleDetails['id_generated_by']);
|
||||
} else {
|
||||
$obj = new OrderSlip($ruleDetails['id_generated_by']);
|
||||
}
|
||||
$objOrder = new Order($obj->id_order);
|
||||
$ruleDetails['order'] = $objOrder;
|
||||
$toConfirm[] = $ruleDetails;
|
||||
}
|
||||
}
|
||||
if (count($toConfirm)) {
|
||||
$modalConfirmDelete->assign(array(
|
||||
'cartRules' => $toConfirm,
|
||||
'link' => $this->context->link
|
||||
));
|
||||
|
||||
}
|
||||
}
|
||||
$tpl = $this->createTemplate('modal.tpl');
|
||||
$tpl->assign(array(
|
||||
'modal_id' => 'moduleConfirmDelete',
|
||||
'modal_class' => 'modal-md',
|
||||
'modal_content' => $modalConfirmDelete->fetch(),
|
||||
'modal_actions' => array(
|
||||
array(
|
||||
'type' => 'button',
|
||||
'class' => 'process_delete btn-primary',
|
||||
'label' => $this->l('Delete'),
|
||||
),
|
||||
),
|
||||
|
||||
));
|
||||
$response['confirm_delete'] = true;
|
||||
$response['modalHtml'] = $tpl->fetch();
|
||||
$response['success'] = true;
|
||||
|
||||
die(Tools::jsonEncode($response));
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Media::addJsDef(
|
||||
array(
|
||||
'admin_cart_rule_tab_link' => $this->context->link->getAdminLink('AdminCartRules'),
|
||||
'room_access_err' => $this->l('You can only select room types which hotel(s) access is provided to this employee.'),
|
||||
'room_rmv_txt' => $this->l('Unselect below room types'),
|
||||
)
|
||||
);
|
||||
$this->addJS(_PS_JS_DIR_.'admin/cart-rules.js');
|
||||
$this->addJqueryPlugin(array('typewatch', 'fancybox', 'autocomplete'));
|
||||
}
|
||||
|
||||
|
||||
@@ -395,19 +395,19 @@ class AdminCartsControllerCore extends AdminController
|
||||
$this->context->cart->id_currency = (($id_currency = (int)Tools::getValue('id_currency')) ? $id_currency : Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
}
|
||||
|
||||
$addresses = $customer->getAddresses((int)$this->context->cart->id_lang);
|
||||
$id_address_delivery = (int)Tools::getValue('id_address_delivery');
|
||||
$id_address_invoice = (int)Tools::getValue('id_address_invoice');
|
||||
if (Validate::isLoadedObject($customer)) {
|
||||
$addresses = $customer->getAddresses((int)$this->context->cart->id_lang);
|
||||
$id_address_delivery = (int)Tools::getValue('id_address_delivery');
|
||||
$id_address_invoice = (int)Tools::getValue('id_address_invoice');
|
||||
|
||||
if (!$this->context->cart->id_address_invoice && isset($addresses[0])) {
|
||||
$this->context->cart->id_address_invoice = (int)$addresses[0]['id_address'];
|
||||
} elseif ($id_address_invoice) {
|
||||
$this->context->cart->id_address_invoice = (int)$id_address_delivery;
|
||||
}
|
||||
if (!$this->context->cart->id_address_delivery && isset($addresses[0])) {
|
||||
$this->context->cart->id_address_delivery = $addresses[0]['id_address'];
|
||||
} elseif ($id_address_delivery) {
|
||||
$this->context->cart->id_address_delivery = (int)$id_address_delivery;
|
||||
if (!$this->context->cart->id_address_invoice && isset($addresses[0])) {
|
||||
$this->context->cart->id_address_invoice = (int)$addresses[0]['id_address'];
|
||||
} elseif ($id_address_invoice) {
|
||||
$this->context->cart->id_address_invoice = (int)$id_address_delivery;
|
||||
}
|
||||
if ($id_address_delivery) {
|
||||
$this->context->cart->id_address_delivery = (int)$id_address_delivery;
|
||||
}
|
||||
}
|
||||
$this->context->cart->setNoMultishipping();
|
||||
|
||||
@@ -417,7 +417,6 @@ class AdminCartsControllerCore extends AdminController
|
||||
$this->context->cart->secure_key = $this->context->customer->secure_key;
|
||||
$addresses = $customer->getAddresses((int)$this->context->cart->id_lang);
|
||||
$this->context->cart->id_address_invoice = (int)$addresses[0]['id_address'];
|
||||
$this->context->cart->id_address_delivery = (int)$addresses[0]['id_address'];
|
||||
$this->context->cart->setNoMultishipping();
|
||||
}
|
||||
/*END*/
|
||||
@@ -946,6 +945,11 @@ class AdminCartsControllerCore extends AdminController
|
||||
$date_from = date('Y-m-d', strtotime($date_from));
|
||||
$date_to = date('Y-m-d', strtotime($date_to));
|
||||
|
||||
if ($this->context->cart->id_currency != (int)Configuration::get('PS_CURRENCY_DEFAULT')) {
|
||||
$currency = Currency::getCurrencyInstance($this->context->cart->id_currency);
|
||||
$price = Tools::ps_round($price/$currency->conversion_rate, 6);
|
||||
}
|
||||
|
||||
if ($this->tabAccess['edit'] === '1') {
|
||||
HotelRoomTypeFeaturePricing::deleteByIdCart($id_cart, $id_product, $id_room, $date_from, $date_to);
|
||||
$feature_price_name = array();
|
||||
@@ -977,7 +981,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
if ($bookingInfo['id'] == $id_booking_data) {
|
||||
$amt_with_qty = $bookingInfo['amt_with_qty'];
|
||||
$bookingInfo['amt_with_qty'] = Tools::displayPrice($amt_with_qty);
|
||||
$bookingInfo['total_price'] = Tools::displayPrice($amt_with_qty + $bookingInfo['demand_price'] + $bookingInfo['additional_service_price']);
|
||||
$bookingInfo['total_price'] = Tools::displayPrice($amt_with_qty + $bookingInfo['demand_price'] + $bookingInfo['additional_service_price'] + $bookingInfo['additional_services_auto_add_price']);
|
||||
$response = array(
|
||||
'curr_booking_info' => $bookingInfo,
|
||||
'cart_info' => $this->ajaxReturnVars(),
|
||||
|
||||
@@ -64,7 +64,7 @@ class AdminCustomerPreferencesControllerCore extends AdminController
|
||||
),
|
||||
'PS_ONE_PHONE_AT_LEAST' => array(
|
||||
'title' => $this->l('Phone number is mandatory'),
|
||||
'hint' => $this->l('If you chose yes, your customer will have to provide at least one phone number to register.'),
|
||||
'hint' => $this->l('If you chose yes, your customer will have to provide phone number to register.'),
|
||||
'validation' => 'isBool',
|
||||
'cast' => 'intval',
|
||||
'type' => 'bool'
|
||||
|
||||
@@ -431,6 +431,15 @@ class AdminCustomersControllerCore extends AdminController
|
||||
'required' => true,
|
||||
'autocomplete' => false
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'prefix' => '<i class="icon-phone"></i>',
|
||||
'label' => $this->l('Phone'),
|
||||
'name' => 'phone',
|
||||
'col' => '4',
|
||||
'required' => true,
|
||||
'autocomplete' => false
|
||||
),
|
||||
array(
|
||||
'type' => 'password',
|
||||
'label' => $this->l('Password'),
|
||||
@@ -990,11 +999,19 @@ class AdminCustomersControllerCore extends AdminController
|
||||
// If customer is going to be deleted permanently then if customer has orders the change this customer as an anonymous customer
|
||||
if (Validate::isLoadedObject($objCustomer = $this->loadObject())) {
|
||||
if ($this->delete_mode == 'real' && Order::getCustomerOrders($objCustomer->id, true)) {
|
||||
$customerEmail = $objCustomer->email;
|
||||
$objCustomer->email = 'anonymous'.'-'.$objCustomer->id.'@'.Tools::link_rewrite(Configuration::get('PS_SHOP_NAME')).'_anonymous.com';
|
||||
$objCustomer->deleted = Customer::STATUS_DELETED;
|
||||
if (!$objCustomer->update()) {
|
||||
$this->errors[] = Tools::displayError('Some error ocurred while deleting the Customer');
|
||||
return;
|
||||
} else {
|
||||
if ($customerDetail = CartCustomerGuestDetail::getCustomerDefaultDetails($customerEmail)) {
|
||||
$objCartCustomerGuestDetail = new CartCustomerGuestDetail($customerDetail['id_customer_guest_detail']);
|
||||
$objCartCustomerGuestDetail->phone = preg_replace('/[0-9]/', '0', $objCustomer->phone);
|
||||
$objCartCustomerGuestDetail->email = $objCustomer->email;
|
||||
$objCartCustomerGuestDetail->save();
|
||||
}
|
||||
}
|
||||
|
||||
$this->redirect_after = self::$currentIndex.'&conf=1&token='.$this->token;
|
||||
@@ -1088,6 +1105,7 @@ class AdminCustomersControllerCore extends AdminController
|
||||
$this->errors[] = Tools::displayError('Password can not be empty.');
|
||||
$this->display = 'edit';
|
||||
} elseif ($customer = parent::processAdd()) {
|
||||
CartCustomerGuestDetail::updateCustomerPhoneNumber($customer->email, Tools::getValue('phone'));
|
||||
$this->context->smarty->assign('new_customer', $customer);
|
||||
return $customer;
|
||||
}
|
||||
@@ -1119,7 +1137,10 @@ class AdminCustomersControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
return parent::processUpdate();
|
||||
if ($res = parent::processUpdate()) {
|
||||
CartCustomerGuestDetail::updateCustomerPhoneNumber($this->object->email, Tools::getValue('phone'));
|
||||
return $res;
|
||||
}
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('An error occurred while loading the object.').'
|
||||
<b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
|
||||
@@ -1149,6 +1170,21 @@ class AdminCustomersControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
$phone = Tools::getValue('phone');
|
||||
if (Configuration::get('PS_ONE_PHONE_AT_LEAST')) {
|
||||
if ($phone == '') {
|
||||
$this->errors[] = Tools::displayError('Phone number is required.');
|
||||
}
|
||||
}
|
||||
$className = 'CartCustomerGuestDetail';
|
||||
$rules = call_user_func(array($className, 'getValidationRules'), $className);
|
||||
if ($phone && !Validate::isPhoneNumber($phone)) {
|
||||
$this->errors[] = Tools::displayError('Invaid phone number.');
|
||||
} elseif ($phone && Tools::strlen($phone) > $rules['size']['phone']) {
|
||||
$this->errors[] = sprintf(Tools::displayError('Phone number is too long. (%s chars max).'), $rules['size']['phone']);
|
||||
}
|
||||
|
||||
|
||||
$customer = new Customer();
|
||||
$this->errors = array_merge($this->errors, $customer->validateFieldsRequiredDatabase());
|
||||
|
||||
|
||||
@@ -295,9 +295,12 @@ class AdminDashboardControllerCore extends AdminController
|
||||
public function postProcess()
|
||||
{
|
||||
if (Tools::isSubmit('submitDateRange')) {
|
||||
if (!Validate::isDate(Tools::getValue('date_from'))
|
||||
|| !Validate::isDate(Tools::getValue('date_to'))) {
|
||||
if (!Validate::isDate(Tools::getValue('date_from')) && !Validate::isDate(Tools::getValue('date_to'))) {
|
||||
$this->errors[] = Tools::displayError('The selected date range is not valid.');
|
||||
} elseif (!Validate::isDate(Tools::getValue('date_from'))) {
|
||||
$this->errors[] = Tools::displayError('Date from in not selected. Please select a date range from the calendar.');
|
||||
} elseif (!Validate::isDate(Tools::getValue('date_to'))) {
|
||||
$this->errors[] = Tools::displayError('Date to in not selected. Please select a date range from the calendar.');
|
||||
}
|
||||
|
||||
if (Tools::getValue('datepicker_compare')) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -256,15 +256,23 @@ class AdminModulesCatalogControllerCore extends AdminController
|
||||
if ($criteria == 'name') {
|
||||
return strnatcasecmp($a->displayName, $b->displayName);
|
||||
} else if ($criteria == 'price_increasing') {
|
||||
if (isset($a->price) && isset($b->price))
|
||||
return $a->price > $b->price;
|
||||
else if (isset($b->price) && $b->price)
|
||||
return true;
|
||||
$priceA = $priceB = 0;
|
||||
if (isset($a->price)) {
|
||||
$priceA = $a->price;
|
||||
}
|
||||
if (isset($b->price)) {
|
||||
$priceB = $b->price;
|
||||
}
|
||||
return $priceA > $priceB;
|
||||
} else if ($criteria == 'price_decreasing') {
|
||||
if (isset($a->price) && isset($b->price))
|
||||
return $a->price < $b->price;
|
||||
else if (isset($b->price) && $b->price)
|
||||
return true;
|
||||
$priceA = $priceB = 0;
|
||||
if (isset($a->price)) {
|
||||
$priceA = $a->price;
|
||||
}
|
||||
if (isset($b->price)) {
|
||||
$priceB = $b->price;
|
||||
}
|
||||
return $priceA < $priceB;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -2875,9 +2875,9 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
{
|
||||
if (Validate::isLoadedObject($product)) {
|
||||
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
|
||||
$associatedRoomTypes = $objRoomTypeServiceProduct->getAssociatedHotelsAndRoomType($product->id)['room_types'];
|
||||
$associatedRoomTypes = $objRoomTypeServiceProduct->getAssociatedHotelsAndRoomType($product->id)['room_type'];
|
||||
if (Product::SERVICE_PRODUCT_WITH_ROOMTYPE == $product->service_product_type) {
|
||||
$selectedRoomTypes = Tools::getValue('roomTypeBox');
|
||||
$selectedRoomTypes = Tools::getValue('room_type_box');
|
||||
|
||||
// Generate list of new associations
|
||||
$newRoomTypes = array();
|
||||
@@ -3499,18 +3499,17 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
|
||||
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
|
||||
$selectedElements = $objRoomTypeServiceProduct->getAssociatedHotelsAndRoomType($product->id);
|
||||
$tree = new HelperTreeHotels('associated-hotels-tree', 'Associated hotels');
|
||||
$tree->setTemplate('tree_associated_hotels.tpl')
|
||||
->setHeaderTemplate('tree_associated_header.tpl')
|
||||
->setRootCategory((int)Configuration::get('PS_LOCATIONS_CATEGORY'))
|
||||
->setUseCheckBox(true)
|
||||
->setFullTree(true)
|
||||
->setRoomsOnly(false)
|
||||
->setSelectedHotels($selectedElements['hotels'])
|
||||
->setSelectedRoomTypes($selectedElements['room_types'])
|
||||
->setUseBulkActions(true)
|
||||
->setAccessedHotels(HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1, 0));
|
||||
|
||||
$tree = new HelperTree('hotels-tree');
|
||||
$tree->setData(HotelHelper::generateTreeData([
|
||||
'rootNode' => HotelHelper::NODE_HOTEL,
|
||||
'leafNode' => HotelHelper::NODE_ROOM_TYPE,
|
||||
'selectedElements' => $selectedElements
|
||||
]))
|
||||
->setUseCheckBox(true)
|
||||
->setAutoSelectChildren(true)
|
||||
->setUseBulkActions(true)
|
||||
->setUseSearch(true);
|
||||
$data->assign('hotel_tree', $tree->render());
|
||||
|
||||
// TinyMCE
|
||||
|
||||
@@ -91,6 +91,12 @@ class AdminOrdersControllerCore extends AdminController
|
||||
} elseif (Tools::getValue('orders_stay_over')) {
|
||||
$this->_where .= ' AND hbd.`is_refunded` = 0 AND hbd.`is_back_order` = 0 AND hbd.`id_status` = '.(int) HotelBookingDetail::STATUS_CHECKED_IN.'
|
||||
AND hbd.`date_to` > \''.pSQL(date('Y-m-d')).' 00:00:00\'';
|
||||
} elseif (Tools::getValue('orders_not_paid')) {
|
||||
$this->_where .= ' AND os.`paid` = 0 AND a.`current_state` NOT IN ('.implode(',', array(
|
||||
Configuration::get('PS_OS_CANCELED'),
|
||||
Configuration::get('PS_OS_REFUND'),
|
||||
Configuration::get('PS_OS_ERROR')
|
||||
)).')';
|
||||
}
|
||||
|
||||
$this->_orderBy = 'id_order';
|
||||
@@ -352,6 +358,19 @@ class AdminOrdersControllerCore extends AdminController
|
||||
return Tools::displayPrice($echo, (int)$idCurrency);
|
||||
}
|
||||
|
||||
public function initPageHeaderToolbar()
|
||||
{
|
||||
if (empty($this->display)) {
|
||||
$this->page_header_toolbar_btn['new_order'] = array(
|
||||
'href' => self::$currentIndex.'&addorder&token='.$this->token,
|
||||
'desc' => $this->l('Add new order', null, null, false),
|
||||
'icon' => 'process-icon-new'
|
||||
);
|
||||
}
|
||||
|
||||
parent::initPageHeaderToolbar();
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
if (Context::getContext()->shop->getContext() != Shop::CONTEXT_SHOP && Shop::isFeatureActive()) {
|
||||
@@ -867,8 +886,9 @@ class AdminOrdersControllerCore extends AdminController
|
||||
&& ($idRoom = Tools::getValue('id_room'))
|
||||
&& ($dateFrom = Tools::getValue('date_from'))
|
||||
&& ($dateTo = Tools::getValue('date_to'))
|
||||
&& ($productLineData = Tools::getValue('product_line_data'))
|
||||
) {
|
||||
$productLineData = json_decode(Tools::getValue('product_line_data'), true);
|
||||
$productLineData = json_decode($productLineData, true);
|
||||
|
||||
$smartyVars = array(
|
||||
'order' => $objOrder,
|
||||
@@ -883,16 +903,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$smartyVars['currencySign'] = $objCurrency->sign;
|
||||
$smartyVars['link'] = $this->context->link;
|
||||
|
||||
$objBookingDemand = new HotelBookingDetail();
|
||||
$htlBookingDetail = $objBookingDemand->getRowByIdOrderIdProductInDateRange(
|
||||
$idOrder,
|
||||
$idProduct,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
$idRoom
|
||||
);
|
||||
|
||||
$smartyVars['id_booking_detail'] = $htlBookingDetail['id'];
|
||||
$smartyVars['id_booking_detail'] = $productLineData['id'];
|
||||
|
||||
$objBookingDemand = new HotelBookingDemands();
|
||||
|
||||
@@ -901,10 +912,14 @@ class AdminOrdersControllerCore extends AdminController
|
||||
|
||||
if ($extraDemands = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$idOrder,
|
||||
$idProduct,
|
||||
$idRoom,
|
||||
$dateFrom,
|
||||
$dateTo
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
$productLineData['id']
|
||||
)) {
|
||||
$smartyVars['extraDemands'] = $extraDemands;
|
||||
}
|
||||
@@ -923,7 +938,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
|
||||
$htlBookingDetail['id']
|
||||
$productLineData['id']
|
||||
)) {
|
||||
$smartyVars['additionalServices'] = $additionalServices;
|
||||
}
|
||||
@@ -2748,11 +2763,10 @@ class AdminOrdersControllerCore extends AdminController
|
||||
|
||||
$total_room_tax = 0;
|
||||
$totalRoomsCostTE = 0;
|
||||
$totalConvenienceFeeTE = 0;
|
||||
$totalConvenienceFeeTI = 0;
|
||||
$totalDemandsPriceTE = 0;
|
||||
$totalDemandsPriceTI = 0;
|
||||
$totalRefundedRooms = 0;
|
||||
$bookingAutoAddedServices = array();
|
||||
if ($order_detail_data = $objBookingDetail->getOrderFormatedBookinInfoByIdOrder($order->id)) {
|
||||
$objBookingDemand = new HotelBookingDemands();
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
@@ -2765,7 +2779,11 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$value['id_product'],
|
||||
$value['id_room'],
|
||||
$value['date_from'],
|
||||
$value['date_to']
|
||||
$value['date_to'],
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
$value['id']
|
||||
);
|
||||
$order_detail_data[$key]['total_room_price_ti'] += $order_detail_data[$key]['extra_demands_price_ti'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order->id,
|
||||
@@ -2775,7 +2793,8 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$value['date_to'],
|
||||
0,
|
||||
1,
|
||||
1
|
||||
1,
|
||||
$value['id']
|
||||
);
|
||||
$totalDemandsPriceTI += $order_detail_data[$key]['extra_demands_price_ti'];
|
||||
$order_detail_data[$key]['total_room_price_te'] += $order_detail_data[$key]['extra_demands_price_te'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
@@ -2786,69 +2805,38 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$value['date_to'],
|
||||
0,
|
||||
1,
|
||||
0
|
||||
0,
|
||||
$value['id']
|
||||
);
|
||||
$totalDemandsPriceTE += $order_detail_data[$key]['extra_demands_price_te'];
|
||||
|
||||
$order_detail_data[$key]['additional_services'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
$value['id_product'],
|
||||
$value['date_from'],
|
||||
$value['date_to'],
|
||||
$value['id_room'],
|
||||
0,
|
||||
null,
|
||||
null
|
||||
$order_detail_data[$key]['additional_services'] = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
|
||||
$value['id']
|
||||
);
|
||||
$order_detail_data[$key]['total_room_price_ti'] += $order_detail_data[$key]['additional_services_price_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
$value['id_product'],
|
||||
$value['date_from'],
|
||||
$value['date_to'],
|
||||
$value['id_room'],
|
||||
$order_detail_data[$key]['total_room_price_ti'] += $order_detail_data[$key]['additional_services_price_ti'] = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
|
||||
$value['id'],
|
||||
1,
|
||||
1
|
||||
);
|
||||
$order_detail_data[$key]['total_room_price_te'] += $order_detail_data[$key]['additional_services_price_te'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
$value['id_product'],
|
||||
$value['date_from'],
|
||||
$value['date_to'],
|
||||
$value['id_room'],
|
||||
1,
|
||||
0
|
||||
);
|
||||
$order_detail_data[$key]['total_room_price_te'] += $order_detail_data[$key]['additional_services_price_te'] = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
|
||||
$value['id'],
|
||||
1,
|
||||
0,
|
||||
0
|
||||
);
|
||||
|
||||
$order_detail_data[$key]['convenience_fee_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
$value['id_product'],
|
||||
$value['date_from'],
|
||||
$value['date_to'],
|
||||
$value['id_room'],
|
||||
$order_detail_data[$key]['convenience_fee_ti'] = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
|
||||
$value['id'],
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
Product::PRICE_ADDITION_TYPE_INDEPENDENT
|
||||
);
|
||||
$order_detail_data[$key]['total_room_price_ti'] += $order_detail_data[$key]['convenience_fee_ti'];
|
||||
$totalConvenienceFeeTI += $order_detail_data[$key]['convenience_fee_ti'];
|
||||
|
||||
$order_detail_data[$key]['convenience_fee_te'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
$value['id_product'],
|
||||
$value['date_from'],
|
||||
$value['date_to'],
|
||||
$value['id_room'],
|
||||
$order_detail_data[$key]['convenience_fee_te'] = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
|
||||
$value['id'],
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
@@ -2856,16 +2844,9 @@ class AdminOrdersControllerCore extends AdminController
|
||||
);
|
||||
|
||||
$order_detail_data[$key]['total_room_price_te'] += $order_detail_data[$key]['convenience_fee_te'];
|
||||
$totalConvenienceFeeTE += $order_detail_data[$key]['convenience_fee_te'];
|
||||
|
||||
$order_detail_data[$key]['additional_services_price_auto_add_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
$value['id_product'],
|
||||
$value['date_from'],
|
||||
$value['date_to'],
|
||||
$value['id_room'],
|
||||
$order_detail_data[$key]['additional_services_price_auto_add_ti'] = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
|
||||
$value['id'],
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
@@ -2873,14 +2854,8 @@ class AdminOrdersControllerCore extends AdminController
|
||||
);
|
||||
$order_detail_data[$key]['total_room_price_ti'] += $order_detail_data[$key]['additional_services_price_auto_add_ti'];
|
||||
|
||||
$order_detail_data[$key]['additional_services_price_auto_add_te'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
$value['id_product'],
|
||||
$value['date_from'],
|
||||
$value['date_to'],
|
||||
$value['id_room'],
|
||||
$order_detail_data[$key]['additional_services_price_auto_add_te'] = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
|
||||
$value['id'],
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
@@ -2927,6 +2902,34 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$order_detail_data = array();
|
||||
}
|
||||
|
||||
if ($orderedRooms = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
null,
|
||||
1,
|
||||
Product::PRICE_ADDITION_TYPE_INDEPENDENT
|
||||
)) {
|
||||
foreach($orderedRooms as $orderedRoom) {
|
||||
if (isset($orderedRoom['additional_services']) && $orderedRoom['additional_services']) {
|
||||
foreach ($orderedRoom['additional_services'] as $service) {
|
||||
if (isset($bookingAutoAddedServices[$service['id_product']])) {
|
||||
$bookingAutoAddedServices[$service['id_product']]['total_price_tax_excl'] += $service['total_price_tax_excl'];
|
||||
} else {
|
||||
$bookingAutoAddedServices[$service['id_product']]['name'] = $service['name'];
|
||||
$bookingAutoAddedServices[$service['id_product']]['total_price_tax_excl'] = $service['total_price_tax_excl'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$objOrderReturn = new OrderReturn();
|
||||
$refundedAmount = 0;
|
||||
if ($refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($order->id, 0, 1, 0, 1)) {
|
||||
@@ -2997,8 +3000,6 @@ class AdminOrdersControllerCore extends AdminController
|
||||
'refundedAmount' => $refundedAmount,
|
||||
'totalDemandsPriceTI' => $totalDemandsPriceTI,
|
||||
'totalDemandsPriceTE' => $totalDemandsPriceTE,
|
||||
'totalConvenienceFeeTI' => $totalConvenienceFeeTI,
|
||||
'totalConvenienceFeeTE' => $totalConvenienceFeeTE,
|
||||
'totalRoomsCostTE' => $totalRoomsCostTE,
|
||||
'total_room_tax' => $total_room_tax,
|
||||
'htl_booking_order_data' => $bookingOrderInfo,
|
||||
@@ -3084,6 +3085,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
'ROOM_STATUS_CHECKED_IN' => HotelBookingDetail::STATUS_CHECKED_IN,
|
||||
'ROOM_STATUS_CHECKED_OUT' => HotelBookingDetail::STATUS_CHECKED_OUT,
|
||||
'ALLOTMENT_MANUAL' => HotelBookingDetail::ALLOTMENT_MANUAL,
|
||||
'booking_auto_added_services' => $bookingAutoAddedServices,
|
||||
);
|
||||
|
||||
return parent::renderView();
|
||||
@@ -4660,8 +4662,6 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$res = true;
|
||||
$id_order = (int) Tools::getValue('id_order');
|
||||
$order = new Order($id_order);
|
||||
$cart = new Cart($order->id_cart);
|
||||
$customer = new Cart($order->id_customer);
|
||||
//$order_detail = new OrderDetail((int)Tools::getValue('product_id_order_detail'));
|
||||
$order_detail = new OrderDetail((int) Tools::getValue('id_order_detail'));//by webkul id_order_detail from our table
|
||||
$this->doEditRoomValidation($order_detail, $order, isset($order_invoice) ? $order_invoice : null);
|
||||
@@ -4670,6 +4670,9 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$order_invoice = new OrderInvoice((int) Tools::getValue('product_invoice'));
|
||||
}
|
||||
/*By webkul To edit Order and cart entries when edit rooms from the orderLine when editing the order*/
|
||||
$obj_booking_detail = new HotelBookingDetail((int) Tools::getValue('id_booking_detail'));
|
||||
$cart = new Cart($obj_booking_detail->id_cart);
|
||||
|
||||
$product_informations = $_POST['edit_product'];
|
||||
$new_date_from = trim(date('Y-m-d', strtotime($product_informations['date_from'])));
|
||||
$new_date_to = trim(date('Y-m-d', strtotime($product_informations['date_to'])));
|
||||
@@ -4679,7 +4682,6 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$id_room = trim(Tools::getValue('id_room'));
|
||||
$id_product = trim(Tools::getValue('id_product'));
|
||||
$room_unit_price = trim(Tools::getValue('room_unit_price'));
|
||||
$obj_booking_detail = new HotelBookingDetail();
|
||||
$product_quantity = (int) $obj_booking_detail->getNumberOfDays($new_date_from, $new_date_to);
|
||||
$old_product_quantity = (int) $obj_booking_detail->getNumberOfDays($old_date_from, $old_date_to);
|
||||
$qty_diff = $product_quantity - $old_product_quantity;
|
||||
@@ -4861,6 +4863,17 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$res &= $order_invoice->update();
|
||||
}
|
||||
|
||||
if ($qty_diff != 0) {
|
||||
$cartQty = $qty_diff;
|
||||
$op = 'up';
|
||||
if ($qty_diff < 0) {
|
||||
$op = 'down';
|
||||
$cartQty = -$cartQty;
|
||||
}
|
||||
|
||||
$cart->updateQty($cartQty, $obj_booking_detail->id_product, null, false, $op, 0, null, true);
|
||||
}
|
||||
|
||||
// Update product available quantity
|
||||
StockAvailable::updateQuantity($order_detail->product_id, $order_detail->product_attribute_id, ($old_quantity - $order_detail->product_quantity), $order->id_shop);
|
||||
|
||||
@@ -4930,7 +4943,10 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$id_room,
|
||||
0,
|
||||
null,
|
||||
null
|
||||
null,
|
||||
null,
|
||||
0,
|
||||
$obj_booking_detail->id
|
||||
);
|
||||
|
||||
$extraDemands = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
@@ -4938,7 +4954,11 @@ class AdminOrdersControllerCore extends AdminController
|
||||
0,
|
||||
$id_room,
|
||||
$old_date_from,
|
||||
$old_date_to
|
||||
$old_date_to,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
$obj_booking_detail->id
|
||||
);
|
||||
|
||||
// set occupancy details
|
||||
@@ -4954,7 +4974,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
'tax_incl' => $totalRoomPriceAfterTI,
|
||||
);
|
||||
|
||||
if ($update_htl_tables = $obj_booking_detail->UpdateHotelCartHotelOrderOnOrderEdit(
|
||||
if ($obj_booking_detail->updateHotelCartHotelOrderOnOrderEdit(
|
||||
$id_order,
|
||||
$id_room,
|
||||
$old_date_from,
|
||||
@@ -4962,7 +4982,8 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$new_date_from,
|
||||
$new_date_to,
|
||||
$occupancy,
|
||||
$new_total_price
|
||||
$new_total_price,
|
||||
$obj_booking_detail->id
|
||||
)) {
|
||||
// update extra demands total prices if dates are changes (price calc method for each day)
|
||||
if ($extraDemands) {
|
||||
@@ -5287,41 +5308,20 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$id_order = (int) Tools::getValue('id_order');
|
||||
$order = new Order($id_order);
|
||||
/*By webkul To delete Order and cart entries when deleting rooms from the orderLine when editing the order*/
|
||||
|
||||
$date_from = Tools::getValue('date_from');
|
||||
$date_to = Tools::getValue('date_to');
|
||||
$id_hotel = Tools::getValue('id_hotel');
|
||||
$id_room = Tools::getValue('id_room');
|
||||
$id_product = Tools::getValue('id_product');
|
||||
$obj_booking_detail = new HotelBookingDetail();
|
||||
$product_quantity = (int) $obj_booking_detail->getNumberOfDays($date_from, $date_to);
|
||||
/*By webkul to validate fields before deleting the cart and order data form the tables*/
|
||||
if ($id_hotel == '') {
|
||||
/*By webkul to validate booking before deleting the cart and order data form the tables*/
|
||||
if (($idHotelBooking = Tools::getValue('id_htl_booking')) == '') {
|
||||
die(json_encode(array(
|
||||
'result' => false,
|
||||
'error' => Tools::displayError('Hotel Id is mising.'),
|
||||
'error' => Tools::displayError('Booking id not found.'),
|
||||
)));
|
||||
} elseif ($id_room == '') {
|
||||
} elseif (!Validate::isLoadedObject($objBookingDetail = new HotelBookingDetail($idHotelBooking))) {
|
||||
die(json_encode(array(
|
||||
'result' => false,
|
||||
'error' => Tools::displayError('Room Id is missing.'),
|
||||
'error' => Tools::displayError('Booking Detail not found.'),
|
||||
)));
|
||||
} elseif ($date_from == '') {
|
||||
die(json_encode(array(
|
||||
'result' => false,
|
||||
'error' => Tools::displayError('Check In Date is missing.'),
|
||||
)));
|
||||
} elseif ($date_to == '') {
|
||||
die(json_encode(array(
|
||||
'result' => false,
|
||||
'error' => Tools::displayError('Check Out Date is missing.'),
|
||||
)));
|
||||
} elseif ($date_to == '') {
|
||||
die(json_encode(array(
|
||||
'result' => false,
|
||||
'error' => Tools::displayError('Check Out Date is missing.'),
|
||||
)));
|
||||
} elseif (!Validate::isUnsignedInt($product_quantity)) {
|
||||
}
|
||||
$product_quantity = (int) $objBookingDetail->getNumberOfDays($objBookingDetail->date_from, $objBookingDetail->date_to);
|
||||
if (!Validate::isUnsignedInt($product_quantity)) {
|
||||
die(json_encode(array(
|
||||
'result' => false,
|
||||
'error' => Tools::displayError('Invalid quantity.'),
|
||||
@@ -5331,32 +5331,31 @@ class AdminOrdersControllerCore extends AdminController
|
||||
/*END*/
|
||||
$this->doDeleteProductLineValidation($order_detail, $order);
|
||||
Hook::exec('actionOrderProductLineDeleteBefore', array('order' => $order));
|
||||
$bookingInfo = $obj_booking_detail->getRowByIdOrderIdProductInDateRange($id_order, $id_product, $date_from, $date_to, $id_room);
|
||||
$idHotelBooking = $bookingInfo['id'];
|
||||
|
||||
$bookingPriceTaxIncl = $bookingInfo['total_price_tax_incl'];
|
||||
$bookingPriceTaxExcl = $bookingInfo['total_price_tax_excl'];
|
||||
|
||||
$bookingPriceTaxIncl = $objBookingDetail->total_price_tax_incl;
|
||||
$bookingPriceTaxExcl = $objBookingDetail->total_price_tax_excl;
|
||||
$objBookingDemand = new HotelBookingDemands();
|
||||
$roomExtraDemandTI = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$id_order,
|
||||
$id_product,
|
||||
$id_room,
|
||||
$date_from,
|
||||
$date_to,
|
||||
$objBookingDetail->id_product,
|
||||
$objBookingDetail->id_room,
|
||||
$objBookingDetail->date_from,
|
||||
$objBookingDetail->date_to,
|
||||
0,
|
||||
1,
|
||||
1
|
||||
1,
|
||||
$objBookingDetail->id
|
||||
);
|
||||
$roomExtraDemandTE = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$id_order,
|
||||
$id_product,
|
||||
$id_room,
|
||||
$date_from,
|
||||
$date_to,
|
||||
$objBookingDetail->id_product,
|
||||
$objBookingDetail->id_room,
|
||||
$objBookingDetail->date_from,
|
||||
$objBookingDetail->date_to,
|
||||
0,
|
||||
1,
|
||||
0
|
||||
0,
|
||||
$objBookingDetail->id
|
||||
);
|
||||
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
@@ -5508,10 +5507,22 @@ class AdminOrdersControllerCore extends AdminController
|
||||
|
||||
/*By webkul to delete cart and order entries from cart and order tables of hotelreservationsystem when delete booking form the order line in order detaoil page*/
|
||||
$obj_htl_cart_booking = new HotelCartBookingData();
|
||||
$delete_room_order = $obj_htl_cart_booking->deleteOrderedRoomFromCart($id_order, $id_hotel, $id_room, $date_from, $date_to);
|
||||
$delete_room_order = $obj_htl_cart_booking->deleteCartBookingData(
|
||||
$objBookingDetail->id_cart,
|
||||
$objBookingDetail->id_product,
|
||||
$objBookingDetail->id_room,
|
||||
$objBookingDetail->date_from,
|
||||
$objBookingDetail->date_to
|
||||
);
|
||||
|
||||
$obj_htl_booking = new HotelBookingDetail();
|
||||
$delete_room_order = $obj_htl_booking->deleteOrderedRoomFromOrder($id_order, $id_hotel, $id_room, $date_from, $date_to);
|
||||
$objBookingDetail->delete();
|
||||
|
||||
// delete refund request of the room if exists.
|
||||
OrderReturnDetail::deleteReturnDetailByIdBookingDetail($id_order, $idHotelBooking);
|
||||
|
||||
// Reducing the quantity from the cart after removing the room from the order
|
||||
$objCart = new Cart($objBookingDetail->id_cart);
|
||||
$objCart->updateQty($product_quantity, $objBookingDetail->id_product, null, false, 'down', 0, null, true);
|
||||
|
||||
// Assign to smarty informations in order to show the new product line
|
||||
$this->context->smarty->assign(array(
|
||||
@@ -6021,6 +6032,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$obj_hotel_cart_detail = new HotelCartBookingData();
|
||||
$deleted = $obj_hotel_cart_detail->deleteRowById($del_id);
|
||||
if ($deleted) {
|
||||
HotelRoomTypeFeaturePricing::deleteByIdCart($cart_id, $id_product, $room_id, $dt_frm, $dt_to );
|
||||
$obj_product_process = new HotelCartBookingData();
|
||||
$date_from = date_create($dt_frm);
|
||||
$date_to = date_create($dt_to);
|
||||
@@ -6068,6 +6080,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
&& ($idRoom = Tools::getValue('id_room'))
|
||||
&& ($dateFrom = Tools::getValue('date_from'))
|
||||
&& ($dateTo = Tools::getValue('date_to'))
|
||||
&& ($idHtlBooking = Tools::getValue('id_htl_booking'))
|
||||
) {
|
||||
$smartyVars = array();
|
||||
$objOrder = new Order($idOrder);
|
||||
@@ -6076,16 +6089,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$smartyVars['currencySign'] = $objCurrency->sign;
|
||||
$smartyVars['link'] = $this->context->link;
|
||||
|
||||
$objBookingDemand = new HotelBookingDetail();
|
||||
$htlBookingDetail = $objBookingDemand->getRowByIdOrderIdProductInDateRange(
|
||||
$idOrder,
|
||||
$idProduct,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
$idRoom
|
||||
);
|
||||
|
||||
$smartyVars['id_booking_detail'] = $htlBookingDetail['id'];
|
||||
$smartyVars['id_booking_detail'] = $idHtlBooking;
|
||||
|
||||
$objBookingDemand = new HotelBookingDemands();
|
||||
|
||||
@@ -6097,14 +6101,18 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$idProduct,
|
||||
$idRoom,
|
||||
$dateFrom,
|
||||
$dateTo
|
||||
$dateTo,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
$idHtlBooking
|
||||
)) {
|
||||
$smartyVars['extraDemands'] = $extraDemands;
|
||||
}
|
||||
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
|
||||
$htlBookingDetail['id']
|
||||
$idHtlBooking
|
||||
)) {
|
||||
$smartyVars['additionalServices'] = $additionalServices;
|
||||
}
|
||||
@@ -6132,7 +6140,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
die($response);
|
||||
}
|
||||
|
||||
public function processRenderServicesPanel($idOrder, $idProduct, $dateFrom, $dateTo, $idRoom, $orderEdit)
|
||||
public function processRenderServicesPanel($idOrder, $idProduct, $dateFrom, $dateTo, $idRoom, $idHtlBookingDetail, $orderEdit)
|
||||
{
|
||||
$smartyVars = array();
|
||||
$objOrder = new Order($idOrder);
|
||||
@@ -6141,19 +6149,10 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$smartyVars['currencySign'] = $objCurrency->sign;
|
||||
$smartyVars['link'] = $this->context->link;
|
||||
|
||||
$objBookingDemand = new HotelBookingDetail();
|
||||
$htlBookingDetail = $objBookingDemand->getRowByIdOrderIdProductInDateRange(
|
||||
$idOrder,
|
||||
$idProduct,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
$idRoom
|
||||
);
|
||||
|
||||
$smartyVars['id_booking_detail'] = $htlBookingDetail['id'];
|
||||
$smartyVars['id_booking_detail'] = $idHtlBookingDetail;
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
|
||||
$htlBookingDetail['id']
|
||||
$idHtlBookingDetail
|
||||
)) {
|
||||
$smartyVars['additionalServices'] = $additionalServices;
|
||||
}
|
||||
@@ -6184,7 +6183,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
return $servicesTpl;
|
||||
}
|
||||
|
||||
public function processRenderFacilitiesBlock($idOrder, $idProduct, $dateFrom, $dateTo, $idRoom, $orderEdit)
|
||||
public function processRenderFacilitiesBlock($idOrder, $idProduct, $dateFrom, $dateTo, $idRoom, $idHtlBookingDetail, $orderEdit)
|
||||
{
|
||||
$smartyVars = array();
|
||||
$objOrder = new Order($idOrder);
|
||||
@@ -6192,17 +6191,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$smartyVars['orderCurrency'] = $objOrder->id_currency;
|
||||
$smartyVars['currencySign'] = $objCurrency->sign;
|
||||
$smartyVars['link'] = $this->context->link;
|
||||
|
||||
$objBookingDemand = new HotelBookingDetail();
|
||||
$htlBookingDetail = $objBookingDemand->getRowByIdOrderIdProductInDateRange(
|
||||
$idOrder,
|
||||
$idProduct,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
$idRoom
|
||||
);
|
||||
|
||||
$smartyVars['id_booking_detail'] = $htlBookingDetail['id'];
|
||||
$smartyVars['id_booking_detail'] = $idHtlBookingDetail;
|
||||
|
||||
// set context currency So that we can get prices in the order currency
|
||||
$this->context->currency = new Currency($objOrder->id_currency);
|
||||
@@ -6214,7 +6203,11 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$idProduct,
|
||||
$idRoom,
|
||||
$dateFrom,
|
||||
$dateTo
|
||||
$dateTo,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
$idHtlBookingDetail
|
||||
)) {
|
||||
$smartyVars['extraDemands'] = $extraDemands;
|
||||
}
|
||||
@@ -6269,11 +6262,13 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$objHotelBookingDetail = new HotelBookingDetail($objRoomTypeServiceProductOrderDetail->id_htl_booking_detail);
|
||||
$res = true;
|
||||
if (!$response['hasError']) {
|
||||
$oldPriceTaxExcl = $objRoomTypeServiceProductOrderDetail->unit_price_tax_excl;
|
||||
$oldPriceTaxIncl = $objRoomTypeServiceProductOrderDetail->unit_price_tax_incl;
|
||||
$oldUnitPriceTaxExcl = $objRoomTypeServiceProductOrderDetail->unit_price_tax_excl;
|
||||
$oldUnitPriceTaxIncl = $objRoomTypeServiceProductOrderDetail->unit_price_tax_incl;
|
||||
$oldTotalPriceTaxExcl = $objRoomTypeServiceProductOrderDetail->total_price_tax_excl;
|
||||
$oldTotalPriceTaxIncl = $objRoomTypeServiceProductOrderDetail->total_price_tax_incl;
|
||||
$oldQuantity = $objRoomTypeServiceProductOrderDetail->quantity;
|
||||
if ($oldPriceTaxExcl > 0) {
|
||||
$oldTaxMultiplier = $oldPriceTaxIncl / $oldPriceTaxExcl;
|
||||
if ($oldUnitPriceTaxExcl > 0) {
|
||||
$oldTaxMultiplier = $oldUnitPriceTaxIncl / $oldUnitPriceTaxExcl;
|
||||
} else {
|
||||
$oldTaxMultiplier = 1;
|
||||
}
|
||||
@@ -6293,8 +6288,8 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$objRoomTypeServiceProductOrderDetail->total_price_tax_incl = Tools::ps_round($objRoomTypeServiceProductOrderDetail->unit_price_tax_incl * $quantity, 6);
|
||||
if ($res &= $objRoomTypeServiceProductOrderDetail->save()) {
|
||||
$order = new Order($objRoomTypeServiceProductOrderDetail->id_order);
|
||||
$priceDiffTaxExcl = $objRoomTypeServiceProductOrderDetail->total_price_tax_excl - $oldPriceTaxExcl;
|
||||
$priceDiffTaxIncl = $objRoomTypeServiceProductOrderDetail->total_price_tax_incl - $oldPriceTaxIncl;
|
||||
$priceDiffTaxExcl = $objRoomTypeServiceProductOrderDetail->total_price_tax_excl - $oldTotalPriceTaxExcl;
|
||||
$priceDiffTaxIncl = $objRoomTypeServiceProductOrderDetail->total_price_tax_incl - $oldTotalPriceTaxIncl;
|
||||
$quantityDiff = $objRoomTypeServiceProductOrderDetail->quantity - $oldQuantity;
|
||||
|
||||
$objOrderDetail->product_quantity += $quantityDiff;
|
||||
@@ -6332,6 +6327,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$objHotelBookingDetail->date_from,
|
||||
$objHotelBookingDetail->date_to,
|
||||
$objHotelBookingDetail->id_room,
|
||||
$objHotelBookingDetail->id,
|
||||
true
|
||||
);
|
||||
} else {
|
||||
@@ -6391,6 +6387,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$objHotelBookingDetail->date_from,
|
||||
$objHotelBookingDetail->date_to,
|
||||
$objHotelBookingDetail->id_room,
|
||||
$objHotelBookingDetail->id,
|
||||
true
|
||||
);
|
||||
}
|
||||
@@ -6456,10 +6453,10 @@ class AdminOrdersControllerCore extends AdminController
|
||||
);
|
||||
|
||||
// add services in room
|
||||
$order = new Order($objHotelBookingDetail->id_order);
|
||||
if (!$response['hasError']) {
|
||||
$this->context->currency = new Currency($order->id_currency);
|
||||
foreach ($selectedServices as $service) {
|
||||
$order = new Order($objHotelBookingDetail->id_order);
|
||||
|
||||
// Create new cart
|
||||
$cart = new Cart();
|
||||
$cart->id_shop_group = $order->id_shop_group;
|
||||
@@ -6531,49 +6528,33 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$roomHtlCartInfo['id'])
|
||||
) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail((int) $id_room_type_service_product_cart_detail);
|
||||
$totalPriceChangeTaxExcl += $totalPriceTaxExcl = $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
0,
|
||||
$objRoomTypeServiceProductCartDetail->quantity,
|
||||
$objHotelBookingDetail->date_from,
|
||||
$objHotelBookingDetail->date_to,
|
||||
false,
|
||||
$cart->id
|
||||
);
|
||||
$totalPriceChangeTaxIncl += $totalPriceTaxIncl = $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
0,
|
||||
$objRoomTypeServiceProductCartDetail->quantity,
|
||||
$objHotelBookingDetail->date_from,
|
||||
$objHotelBookingDetail->date_to,
|
||||
true,
|
||||
$cart->id
|
||||
);
|
||||
|
||||
$numDays = 1;
|
||||
if (Product::getProductPriceCalculation($product['id_product']) == Product::PRICE_CALCULATION_METHOD_PER_DAY) {
|
||||
$numDays = HotelHelper::getNumberOfDays($objHotelBookingDetail->date_from, $objHotelBookingDetail->date_to);
|
||||
}
|
||||
$product['cart_quantity'] = $objRoomTypeServiceProductCartDetail->quantity * $numDays;
|
||||
|
||||
$product['cart_quantity'] = $objRoomTypeServiceProductCartDetail->quantity * $numDays;
|
||||
$unitPriceTaxExcl = $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
0,
|
||||
$roomHtlCartInfo['id_product'],
|
||||
1,
|
||||
$objHotelBookingDetail->date_from,
|
||||
$objHotelBookingDetail->date_to,
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$cart->id
|
||||
)/ $numDays;
|
||||
);
|
||||
$unitPriceTaxIncl = $objRoomTypeServiceProductPrice->getServicePrice(
|
||||
(int)$product['id_product'],
|
||||
0,
|
||||
$roomHtlCartInfo['id_product'],
|
||||
1,
|
||||
$objHotelBookingDetail->date_from,
|
||||
$objHotelBookingDetail->date_to,
|
||||
null,
|
||||
null,
|
||||
true,
|
||||
$cart->id
|
||||
)/ $numDays;
|
||||
);
|
||||
|
||||
$totalPriceChangeTaxExcl += $totalPriceTaxExcl = ($unitPriceTaxExcl * $product['cart_quantity']);
|
||||
$totalPriceChangeTaxIncl += $totalPriceTaxIncl = ($unitPriceTaxIncl * $product['cart_quantity']);
|
||||
switch (Configuration::get('PS_ROUND_TYPE')) {
|
||||
case Order::ROUND_TOTAL:
|
||||
$product['total'] = $totalPriceTaxExcl;
|
||||
@@ -6644,6 +6625,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$objHotelBookingDetail->date_from,
|
||||
$objHotelBookingDetail->date_to,
|
||||
$objHotelBookingDetail->id_room,
|
||||
$objHotelBookingDetail->id,
|
||||
true
|
||||
);
|
||||
} else {
|
||||
@@ -6772,6 +6754,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$objBookingDetail->date_from,
|
||||
$objBookingDetail->date_to,
|
||||
$objBookingDetail->id_room,
|
||||
$objBookingDetail->id,
|
||||
true
|
||||
);
|
||||
$response['success'] = true;
|
||||
@@ -6842,6 +6825,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$objBookingDetail->date_from,
|
||||
$objBookingDetail->date_to,
|
||||
$objBookingDetail->id_room,
|
||||
$objBookingDetail->id,
|
||||
true
|
||||
);
|
||||
$response['success'] = true;
|
||||
@@ -6886,6 +6870,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$objBookingDetail->date_from,
|
||||
$objBookingDetail->date_to,
|
||||
$objBookingDetail->id_room,
|
||||
$objBookingDetail->id,
|
||||
true
|
||||
);
|
||||
$response['success'] = true;
|
||||
|
||||
@@ -375,7 +375,7 @@ class AdminPatternsControllerCore extends AdminController
|
||||
'root_category' => 1,
|
||||
'id' => 'id_category',
|
||||
'name' => 'name_category',
|
||||
'selected_categories' => array(3),
|
||||
'selected_categories' => array(3, 8),
|
||||
)
|
||||
),
|
||||
array(
|
||||
|
||||
@@ -246,7 +246,7 @@ class AdminSearchControllerCore extends AdminController
|
||||
}
|
||||
} else if ($associatedData = $objRoomTypeServiceProduct->getAssociatedHotelsAndRoomType($product['id_product'])) {
|
||||
$count = 0;
|
||||
foreach ($associatedData['room_types'] as $id_room_type) {
|
||||
foreach ($associatedData['room_type'] as $id_room_type) {
|
||||
$objRoomType = new HotelRoomType($id_room_type);
|
||||
if (in_array($objRoomType->id_hotel, $accessibleHotels)) {
|
||||
$count += 1;
|
||||
|
||||
@@ -296,9 +296,51 @@ class AdminSlipControllerCore extends AdminController
|
||||
return '--';
|
||||
}
|
||||
|
||||
public function ajaxProcessInitSlipStatusModal()
|
||||
{
|
||||
$response = array('success' => false);
|
||||
if ($idOrderSlip = Tools::getValue('id_order_slip')) {
|
||||
if (Validate::isLoadedObject($objOrderSlip = new OrderSlip($idOrderSlip, $this->context->language->id))) {
|
||||
$objOrder = new Order($objOrderSlip->id_order);
|
||||
$objCustomer = new Customer($objOrder->id_customer);
|
||||
|
||||
$modalConfirmDelete = $this->createTemplate('modal_confirm_update.tpl');
|
||||
$modalConfirmDelete->assign(array(
|
||||
'customer' => $objCustomer,
|
||||
'order' => $objOrder,
|
||||
'orderSlip' => $objOrderSlip,
|
||||
'link' => $this->context->link
|
||||
));
|
||||
$tpl = $this->createTemplate('modal.tpl');
|
||||
$tpl->assign(array(
|
||||
'modal_id' => 'moduleConfirmUpdate',
|
||||
'modal_class' => 'modal-md',
|
||||
'modal_content' => $modalConfirmDelete->fetch(),
|
||||
'modal_actions' => array(
|
||||
array(
|
||||
'type' => 'button',
|
||||
'class' => 'process_update btn-primary',
|
||||
'label' => $this->l('Change status'),
|
||||
),
|
||||
),
|
||||
|
||||
));
|
||||
$response['modalHtml'] = $tpl->fetch();
|
||||
}
|
||||
}
|
||||
$response['success'] = true;
|
||||
|
||||
die(Tools::jsonEncode($response));
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Media::addJsDef(
|
||||
array(
|
||||
'admin_order_slip_tab_link' => $this->context->link->getAdminLink('AdminSlip'),
|
||||
)
|
||||
);
|
||||
$this->addJS(_PS_JS_DIR_.'admin/slips.js');
|
||||
}
|
||||
|
||||
|
||||
@@ -516,6 +516,46 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
||||
}
|
||||
}
|
||||
|
||||
public static function getRefunds($date_from, $date_to, $granularity = false, $id_hotel = 0)
|
||||
{
|
||||
if ($granularity == 'day') {
|
||||
$refunds = array();
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
|
||||
SELECT
|
||||
LEFT(`invoice_date`, 10) as date,
|
||||
SUM(orr.`refunded_amount`) as total_refund_amount,
|
||||
(
|
||||
SELECT hbd.`id_hotel`
|
||||
FROM`'._DB_PREFIX_.'htl_booking_detail` hbd
|
||||
WHERE hbd.`id_order` = o.`id_order` LIMIT 1
|
||||
) AS id_hotel
|
||||
FROM `'._DB_PREFIX_.'orders` o
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_return` orr ON (o.id_order = orr.id_order)
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (o.current_state = os.id_order_state)
|
||||
WHERE orr.`payment_mode` != "" AND `invoice_date` BETWEEN "'.pSQL($date_from).' 00:00:00" AND "'.pSQL($date_to).' 23:59:59" AND os.logable = 1'.'
|
||||
GROUP BY LEFT(`invoice_date`, 10) HAVING 1 '.HotelBranchInformation::addHotelRestriction($id_hotel));
|
||||
|
||||
foreach ($result as $row) {
|
||||
$refunds[strtotime($row['date'])] = $row['total_refund_amount'];
|
||||
}
|
||||
|
||||
return $refunds;
|
||||
} else {
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(
|
||||
'SELECT SUM(orr.`refunded_amount`),
|
||||
(
|
||||
SELECT hbd.`id_hotel`
|
||||
FROM`'._DB_PREFIX_.'htl_booking_detail` hbd
|
||||
WHERE hbd.`id_order` = o.`id_order` LIMIT 1
|
||||
) AS id_hotel
|
||||
FROM `'._DB_PREFIX_.'orders` o
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_return` orr ON (o.id_order = orr.id_order)
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (o.current_state = os.id_order_state)
|
||||
WHERE orr.`payment_mode` != "" AND orr.`id_transaction` != "" AND `invoice_date` BETWEEN "'.pSQL($date_from).' 00:00:00" AND "'.pSQL($date_to).' 23:59:59" AND os.logable = 1 HAVING 1 '.HotelBranchInformation::addHotelRestriction($id_hotel)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public static function getExpenses($date_from, $date_to, $granularity = false, $id_hotel = 0)
|
||||
{
|
||||
$expenses = ($granularity == 'day' ? array() : 0);
|
||||
@@ -1165,7 +1205,7 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
||||
ON (p.`id_product` = hri.`id_product`)
|
||||
WHERE p.`active` = 1
|
||||
AND hbd.`is_refunded` = 0
|
||||
AND hbd.`date_from` < "'.pSQL($dateTo).' 00:00:00" AND hbd.`date_to` > "'.pSQL($dateFrom).' 00:00:00"'.
|
||||
AND IF(hbd.`id_status` = '. HotelBookingDetail::STATUS_CHECKED_OUT .', hbd.`date_from` < DATE_FORMAT(hbd.`check_out`, "%Y-%m-%d") AND hbd.`date_from` < \''.pSQL($dateTo).'\' AND DATE_FORMAT(hbd.`check_out`, "%Y-%m-%d") > \''.pSQL($dateFrom).'\', hbd.`date_from` < \''.pSQL($dateTo).'\' AND hbd.`date_to` > \''.pSQL($dateFrom).'\')'.
|
||||
HotelBranchInformation::addHotelRestriction($idsHotel, 'hbd')
|
||||
);
|
||||
|
||||
@@ -1257,7 +1297,7 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
||||
return $averageDailyRates;
|
||||
}
|
||||
|
||||
// Average Daily Rate is the average income per paid occupied room in a given time period
|
||||
// Average Daily Rate is the average income per occupied room in a given time period
|
||||
public static function getAverageDailyRate($dateFrom, $dateTo, $idHotel = null)
|
||||
{
|
||||
$roomsRevenueByDates = self::getRoomsRevenueForDiscreteDates($dateFrom, $dateTo, $idHotel);
|
||||
@@ -1552,7 +1592,8 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function getTotalRevenueForDiscreteDates($dateFrom, $dateTo = null, $idHotel = null, $useCache = true)
|
||||
// Calculate total services revenue (services and demands)
|
||||
public static function getServicesRevenueForDiscreteDates($dateFrom, $dateTo = null, $idHotel = null, $useCache = true)
|
||||
{
|
||||
$dateTo = !$dateTo ? date('Y-m-d', strtotime('+1 day', strtotime($dateFrom))) : $dateTo;
|
||||
|
||||
@@ -1570,41 +1611,55 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
||||
|
||||
$result = array();
|
||||
foreach ($discreteDates as $discreteDate) {
|
||||
$cacheKey = 'AdminStats::getTotalRevenueForDiscreteDates'.'_'.(int) $discreteDate['timestamp_from'].'_'.
|
||||
(!is_array($idHotel) ? (int) $idHotel : implode('_', $idHotel));
|
||||
if (!Cache::isStored($cacheKey) || !$useCache) {
|
||||
$sql = 'SELECT SUM((current_parts / total_parts) * total_paid_tax_excl) AS total_revenue
|
||||
FROM (
|
||||
SELECT o.`id_order`,
|
||||
o.`total_paid_tax_excl` / o.`conversion_rate` AS total_paid_tax_excl,
|
||||
(
|
||||
SELECT SUM(DATEDIFF(hbd.`date_to`, hbd.`date_from`))
|
||||
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
|
||||
INNER JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = hbd.`id_product`)
|
||||
WHERE hbd.`id_order` = o.`id_order`
|
||||
AND p.`active` = 1 AND hbd.`is_refunded` = 0 AND o.`valid` = 1'.
|
||||
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '').'
|
||||
) AS total_parts,
|
||||
(
|
||||
SELECT COUNT(*)
|
||||
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
|
||||
INNER JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = hbd.`id_product`)
|
||||
WHERE hbd.`id_order` = o.`id_order`
|
||||
AND hbd.`date_from` <= "'.pSQL($discreteDate['date_from']).' 00:00:00" AND hbd.`date_to` >= "'.pSQL($discreteDate['date_to']).' 00:00:00"
|
||||
AND p.`active` = 1 AND hbd.`is_refunded` = 0 AND o.`valid` = 1'.
|
||||
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '').'
|
||||
) AS current_parts
|
||||
FROM `'._DB_PREFIX_.'orders` o
|
||||
HAVING total_parts IS NOT NULL AND current_parts > 0
|
||||
ORDER BY o.`id_order`
|
||||
) AS t';
|
||||
$totalServicesRevenue = 0;
|
||||
// Calculate services revenue
|
||||
$servicesRevenueSql = 'SELECT SUM((rtspod.`total_price_tax_excl` / o.`conversion_rate`) / DATEDIFF(hbd.`date_to`, hbd.`date_from`))
|
||||
FROM `'._DB_PREFIX_.'htl_room_type_service_product_order_detail` rtspod
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd
|
||||
ON (rtspod.`id_htl_booking_detail` = hbd.`id`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = hbd.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order`)
|
||||
WHERE p.`active` = 1
|
||||
AND o.`valid` = 1
|
||||
AND hbd.`is_refunded` = 0
|
||||
AND hbd.`date_from` < "'.pSQL($discreteDate['date_to']).' 00:00:00" AND hbd.`date_to` > "'.pSQL($discreteDate['date_from']).' 00:00:00"'.
|
||||
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '');
|
||||
|
||||
$value = Db::getInstance()->getValue($sql);
|
||||
$value = !$value ? 0: (float) $value;
|
||||
Cache::store($cacheKey, $value);
|
||||
if ($servicesRevenue = Db::getInstance()->getValue($servicesRevenueSql)) {
|
||||
$totalServicesRevenue += $servicesRevenue;
|
||||
}
|
||||
|
||||
$result[$discreteDate['timestamp_from']] = Cache::retrieve($cacheKey);
|
||||
// Calculate demands revenue
|
||||
$demandsRevenueSql = 'SELECT SUM((hdmd.`total_price_tax_excl` / o.`conversion_rate`) / DATEDIFF(hbd.`date_to`, hbd.`date_from`))
|
||||
FROM `'._DB_PREFIX_.'htl_booking_demands` hdmd
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd
|
||||
ON (hdmd.`id_htl_booking` = hbd.`id`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = hbd.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order`)
|
||||
WHERE p.`active` = 1
|
||||
AND o.`valid` = 1
|
||||
AND hbd.`is_refunded` = 0
|
||||
AND hbd.`date_from` < "'.pSQL($discreteDate['date_to']).' 00:00:00" AND hbd.`date_to` > "'.pSQL($discreteDate['date_from']).' 00:00:00"'.
|
||||
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '');
|
||||
|
||||
if ($demandsRevenue = Db::getInstance()->getValue($demandsRevenueSql)) {
|
||||
$totalServicesRevenue += $demandsRevenue;
|
||||
}
|
||||
|
||||
$result[$discreteDate['timestamp_from']] = $totalServicesRevenue;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function getTotalRevenueForDiscreteDates($dateFrom, $dateTo = null, $idHotel = null, $useCache = true)
|
||||
{
|
||||
$result = array();
|
||||
$servicesRevenueByDates = self::getServicesRevenueForDiscreteDates($dateFrom, $dateTo, $idHotel);
|
||||
if ($roomsRevenueByDates = self::getRoomsRevenueForDiscreteDates($dateFrom, $dateTo, $idHotel)) {
|
||||
foreach ($roomsRevenueByDates as $key => $value) {
|
||||
$result[$key] = (isset($servicesRevenueByDates[$key]) ? $servicesRevenueByDates[$key] : 0) + $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
@@ -2020,18 +2075,18 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
||||
$roomsSql = 'SELECT
|
||||
IFNULL(SUM(
|
||||
CASE
|
||||
WHEN od.`original_wholesale_price` <> "0.000000"
|
||||
THEN od.`original_wholesale_price`
|
||||
WHEN p.`wholesale_price` <> "0.000000"
|
||||
THEN p.`wholesale_price`
|
||||
WHEN od.`purchase_supplier_price` <> "0.000000"
|
||||
THEN od.`purchase_supplier_price`
|
||||
WHEN od.`purchase_supplier_price` = "0.000000"
|
||||
THEN (od.`original_product_price` / o.`conversion_rate`) * '.(int)Configuration::get('CONF_AVERAGE_PRODUCT_MARGIN').' / 100
|
||||
END
|
||||
), 0)
|
||||
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p
|
||||
ON (p.`id_product` = hbd.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_detail` od
|
||||
ON (od.`id_order_detail` = hbd.`id_order_detail`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = hbd.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order_detail` = hbd.`id_order_detail`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'orders` o ON (od.`id_order` = o.`id_order`)
|
||||
WHERE p.`active` = 1
|
||||
AND o.`valid` = 1
|
||||
AND hbd.`is_refunded` = 0
|
||||
AND hbd.`date_from` < "'.pSQL($discreteDate['date_to']).' 00:00:00" AND hbd.`date_to` > "'.pSQL($discreteDate['date_from']).' 00:00:00"'.
|
||||
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '');
|
||||
@@ -2044,20 +2099,20 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
||||
$servicesSql = 'SELECT
|
||||
IFNULL(SUM(
|
||||
CASE
|
||||
WHEN od.`original_wholesale_price` <> "0.000000"
|
||||
THEN od.`original_wholesale_price`
|
||||
WHEN p.`wholesale_price` <> "0.000000"
|
||||
THEN p.`wholesale_price`
|
||||
WHEN od.`purchase_supplier_price` <> "0.000000"
|
||||
THEN (od.`purchase_supplier_price` / (IF (od.`product_price_calculation_method` = '.Product::PRICE_CALCULATION_METHOD_PER_BOOKING.', DATEDIFF(hbd.`date_to`, hbd.`date_from`), 1)))
|
||||
WHEN od.`purchase_supplier_price` = "0.000000"
|
||||
THEN ((od.`original_product_price` / o.`conversion_rate`) * '.(int)Configuration::get('CONF_AVERAGE_PRODUCT_MARGIN').' / 100) / (IF (od.`product_price_calculation_method` = '.Product::PRICE_CALCULATION_METHOD_PER_BOOKING.', DATEDIFF(hbd.`date_to`, hbd.`date_from`), 1))
|
||||
END
|
||||
), 0)
|
||||
FROM `'._DB_PREFIX_.'htl_room_type_service_product_order_detail` rtspod
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd
|
||||
ON (rtspod.`id_htl_booking_detail` = hbd.`id`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p
|
||||
ON (p.`id_product` = hbd.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_detail` od
|
||||
ON (od.`id_order_detail` = rtspod.`id_order_detail`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = rtspod.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order_detail` = rtspod.`id_order_detail`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'orders` o ON (od.`id_order` = o.`id_order`)
|
||||
WHERE p.`active` = 1
|
||||
AND o.`valid` = 1
|
||||
AND hbd.`is_refunded` = 0
|
||||
AND hbd.`date_from` < "'.pSQL($discreteDate['date_to']).' 00:00:00" AND hbd.`date_to` > "'.pSQL($discreteDate['date_from']).' 00:00:00"'.
|
||||
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '');
|
||||
|
||||
@@ -76,6 +76,7 @@ class AddressControllerCore extends FrontController
|
||||
$_POST['firstname'] = $this->context->customer->firstname;
|
||||
$_POST['lastname'] = $this->context->customer->lastname;
|
||||
$_POST['company'] = $this->context->customer->company;
|
||||
$_POST['phone'] = $this->context->customer->phone;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -409,8 +409,10 @@ class AuthControllerCore extends FrontController
|
||||
$customer = new Customer();
|
||||
$lastnameAddress = Tools::getValue('lastname');
|
||||
$firstnameAddress = Tools::getValue('firstname');
|
||||
$phoneAddress = Tools::getValue('phone');
|
||||
$_POST['lastname'] = Tools::getValue('customer_lastname', $lastnameAddress);
|
||||
$_POST['firstname'] = Tools::getValue('customer_firstname', $firstnameAddress);
|
||||
$_POST['phone'] = Tools::getValue('customer_phone', $phoneAddress);
|
||||
$addresses_types = [];
|
||||
if (Configuration::get('PS_REGISTRATION_PROCESS_TYPE')) {
|
||||
$addresses_types[] = 'address';
|
||||
@@ -420,24 +422,18 @@ class AuthControllerCore extends FrontController
|
||||
$addresses_types[] = 'address_invoice';
|
||||
}
|
||||
|
||||
$error_phone = false;
|
||||
if (Configuration::get('PS_ONE_PHONE_AT_LEAST')) {
|
||||
if (Tools::isSubmit('submitGuestAccount') || !Tools::getValue('is_new_customer')) {
|
||||
if (!Tools::getValue('phone') && !Tools::getValue('phone_mobile')) {
|
||||
$error_phone = true;
|
||||
}
|
||||
} elseif (((Configuration::get('PS_REGISTRATION_PROCESS_TYPE') && Configuration::get('PS_ORDER_PROCESS_TYPE'))
|
||||
|| (Configuration::get('PS_ORDER_PROCESS_TYPE') && !Tools::getValue('email_create'))
|
||||
|| (Configuration::get('PS_REGISTRATION_PROCESS_TYPE') && Tools::getValue('email_create')))
|
||||
&& (!Tools::getValue('phone') && !Tools::getValue('phone_mobile'))) {
|
||||
$error_phone = true;
|
||||
$className = 'CartCustomerGuestDetail';
|
||||
$rules = call_user_func(array($className, 'getValidationRules'), $className);
|
||||
if (Configuration::get('PS_ONE_PHONE_AT_LEAST') && !Tools::getValue('phone')) {
|
||||
$this->errors[] = Tools::displayError('Phone number is required.');
|
||||
} else {
|
||||
if (Tools::getValue('phone') && !Validate::isPhoneNumber(Tools::getValue('phone'))) {
|
||||
$this->errors[] = Tools::displayError('Invald phone number.');
|
||||
} elseif (Tools::getValue('phone') && Tools::strlen(Tools::getValue('phone')) > $rules['size']['phone']) {
|
||||
$this->errors[] = sprintf(Tools::displayError('Phone number is too long. (%s chars max).'), $rules['size']['phone']);
|
||||
}
|
||||
}
|
||||
|
||||
if ($error_phone) {
|
||||
$this->errors[] = Tools::displayError('You must register at least one phone number.');
|
||||
}
|
||||
|
||||
if (!Tools::getValue('is_new_customer', 1)) {
|
||||
if ($idCustomer = Customer::customerExists(Tools::getValue('email'), true, false)) {
|
||||
$customer = new Customer($idCustomer);
|
||||
@@ -468,6 +464,8 @@ class AuthControllerCore extends FrontController
|
||||
|
||||
if (!count($this->errors)) {
|
||||
if ($customer->add()) {
|
||||
$phone = Tools::getValue('phone');
|
||||
CartCustomerGuestDetail::updateCustomerPhoneNumber($customer->email, $phone);
|
||||
if (!$customer->is_guest) {
|
||||
if (!$this->sendConfirmationMail($customer)) {
|
||||
$this->errors[] = Tools::displayError('The email cannot be sent.');
|
||||
@@ -614,6 +612,11 @@ class AuthControllerCore extends FrontController
|
||||
if (!$customer->save()) {
|
||||
$this->errors[] = Tools::displayError('An error occurred while creating your account.');
|
||||
} else {
|
||||
// save customer phone number in cart_customer_guest_detail
|
||||
$phone = Tools::getValue('phone');
|
||||
CartCustomerGuestDetail::updateCustomerPhoneNumber($customer->email, $phone);
|
||||
$_POST['phone'] = $phoneAddress;
|
||||
|
||||
foreach ($addresses_types as $addresses_type) {
|
||||
$$addresses_type->id_customer = (int)$customer->id;
|
||||
if ($addresses_type == 'address_invoice') {
|
||||
@@ -648,7 +651,6 @@ class AuthControllerCore extends FrontController
|
||||
$customer->addGroups(array((int)Configuration::get('PS_GUEST_GROUP')));
|
||||
}
|
||||
|
||||
$this->context->cart->id_address_delivery = (int)Address::getFirstCustomerAddressId((int)$customer->id);
|
||||
$this->context->cart->id_address_invoice = (int)Address::getFirstCustomerAddressId((int)$customer->id);
|
||||
if (isset($address_invoice) && Validate::isLoadedObject($address_invoice)) {
|
||||
$this->context->cart->id_address_invoice = (int)$address_invoice->id;
|
||||
|
||||
@@ -82,6 +82,20 @@ class IdentityControllerCore extends FrontController
|
||||
$this->errors = array_merge($this->errors, $this->customer->validateController());
|
||||
}
|
||||
|
||||
$phone = Tools::getValue('phone');
|
||||
if (Configuration::get('PS_ONE_PHONE_AT_LEAST')) {
|
||||
if ($phone == '') {
|
||||
$this->errors[] = Tools::displayError('Phone number is required.');
|
||||
}
|
||||
}
|
||||
$className = 'CartCustomerGuestDetail';
|
||||
$rules = call_user_func(array($className, 'getValidationRules'), $className);
|
||||
if ($phone && !Validate::isPhoneNumber($phone)) {
|
||||
$this->errors[] = Tools::displayError('Invaid phone number.');
|
||||
} elseif ($phone && Tools::strlen($phone) > $rules['size']['phone']) {
|
||||
$this->errors[] = sprintf(Tools::displayError('Phone number is too long. (%s chars max).'), $rules['size']['phone']);;
|
||||
}
|
||||
|
||||
if (!count($this->errors)) {
|
||||
$this->customer->id_default_group = (int)$prev_id_default_group;
|
||||
$this->customer->firstname = Tools::ucwords($this->customer->firstname);
|
||||
@@ -109,6 +123,7 @@ class IdentityControllerCore extends FrontController
|
||||
$this->context->cookie->passwd = $this->customer->passwd;
|
||||
}
|
||||
if ($this->customer->update()) {
|
||||
CartCustomerGuestDetail::updateCustomerPhoneNumber($this->customer->email, $phone);
|
||||
$this->context->cookie->customer_lastname = $this->customer->lastname;
|
||||
$this->context->cookie->customer_firstname = $this->customer->firstname;
|
||||
$this->context->smarty->assign('confirmation', 1);
|
||||
@@ -118,6 +133,7 @@ class IdentityControllerCore extends FrontController
|
||||
}
|
||||
} else {
|
||||
$_POST = array_map('stripslashes', $this->customer->getFields());
|
||||
$_POST['phone'] = $this->customer->phone;
|
||||
}
|
||||
|
||||
return $this->customer;
|
||||
|
||||
@@ -469,8 +469,6 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
{
|
||||
if (Tools::getValue('ajax') != 'true') {
|
||||
parent::setMedia();
|
||||
$this->addCSS(_THEME_CSS_DIR_.'history.css');
|
||||
$this->addJS(_THEME_JS_DIR_.'history.js');
|
||||
$this->addJS(_THEME_JS_DIR_.'order-confirmation.js');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'order-confirmation.css');
|
||||
$this->addJqueryPlugin(array('fancybox')); //fancybox not found for some client theme
|
||||
|
||||
@@ -115,6 +115,18 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
$this->context->customer->birthday = (int)Tools::getValue('years').'-'.(int)Tools::getValue('months').'-'.(int)Tools::getValue('days');
|
||||
}
|
||||
|
||||
$phone = Tools::getValue('phone');
|
||||
if (Configuration::get('PS_ONE_PHONE_AT_LEAST') && !$phone) {
|
||||
$this->errors[] = Tools::displayError('Phone number is a required field.', false);
|
||||
}
|
||||
$className = 'CartCustomerGuestDetail';
|
||||
$rules = call_user_func(array($className, 'getValidationRules'), $className);
|
||||
if (!Validate::isPhoneNumber($phone)) {
|
||||
$this->errors[] = Tools::displayError('Please enter a valid Mobile phone number.', false);
|
||||
} elseif (Tools::strlen($phone) > $rules['size']['phone']) {
|
||||
$this->errors[] = sprintf(Tools::displayError('Mobile phone number is too long. (%s chars max).'), $rules['size']['phone']);
|
||||
}
|
||||
|
||||
$_POST['lastname'] = $_POST['customer_lastname'];
|
||||
$_POST['firstname'] = $_POST['customer_firstname'];
|
||||
$this->errors = array_merge($this->errors, $this->context->customer->validateController());
|
||||
@@ -125,18 +137,9 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
if ($idAddressDelivery = Tools::getValue('opc_id_address_delivery')) {
|
||||
$objAddress = new Address($idAddressDelivery);
|
||||
if (Validate::isLoadedObject($objAddress)) {
|
||||
$phoneMobile = Tools::getValue('phone_mobile');
|
||||
|
||||
if (Configuration::get('PS_ONE_PHONE_AT_LEAST') && !$phoneMobile) {
|
||||
$this->errors[] = Tools::displayError('Mobile phone number is a required field.', false);
|
||||
}
|
||||
|
||||
if (!Validate::isPhoneNumber($phoneMobile)) {
|
||||
$this->errors[] = Tools::displayError('Please enter a valid Mobile phone number.', false);
|
||||
}
|
||||
|
||||
if (!count($this->errors)) {
|
||||
$objAddress->phone_mobile = $phoneMobile;
|
||||
$objAddress->phone_mobile = $phone;
|
||||
$objAddress->firstname = $this->context->customer->firstname;
|
||||
$objAddress->lastname = $this->context->customer->lastname;
|
||||
if (!$objAddress->save()) {
|
||||
@@ -154,6 +157,8 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
);
|
||||
if (!count($this->errors)) {
|
||||
$return['isSaved'] = (bool)$this->context->customer->update();
|
||||
CartCustomerGuestDetail::updateCustomerPhoneNumber($this->context->customer->email, $phone);
|
||||
|
||||
} else {
|
||||
$return['isSaved'] = false;
|
||||
}
|
||||
@@ -686,6 +691,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
'id_country' => (int)$address_delivery->id_country,
|
||||
'id_state' => (int)$address_delivery->id_state,
|
||||
'id_gender' => (int)$customer->id_gender,
|
||||
'phone' => (int)$customer->phone,
|
||||
'sl_year' => $birthday[0],
|
||||
'sl_month' => $birthday[1],
|
||||
'sl_day' => $birthday[2],
|
||||
|
||||
@@ -423,25 +423,6 @@ class ParentOrderControllerCore extends FrontController
|
||||
|
||||
$customerAddresses = array_values($customerAddresses);
|
||||
|
||||
if (!count($customerAddresses) && !Tools::isSubmit('ajax')) {
|
||||
$bad_delivery = false;
|
||||
if (($bad_delivery = (bool)!Address::isCountryActiveById((int)$this->context->cart->id_address_delivery)) || !Address::isCountryActiveById((int)$this->context->cart->id_address_invoice)) {
|
||||
$params = array();
|
||||
if ($this->step) {
|
||||
$params['step'] = (int)$this->step;
|
||||
}
|
||||
if ($multi = (int)Tools::getValue('multi-shipping')) {
|
||||
$params['multi-shipping'] = $multi;
|
||||
}
|
||||
$back_url = $this->context->link->getPageLink('order', true, (int)$this->context->language->id, $params);
|
||||
|
||||
$params = array('back' => $back_url, 'id_address' => ($bad_delivery ? (int)$this->context->cart->id_address_delivery : (int)$this->context->cart->id_address_invoice));
|
||||
if ($multi) {
|
||||
$params['multi-shipping'] = $multi;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$this->context->smarty->assign(array(
|
||||
'addresses' => $customerAddresses,
|
||||
'formatedAddressFieldsValuesList' => $formatedAddressFieldsValuesList)
|
||||
@@ -450,10 +431,6 @@ class ParentOrderControllerCore extends FrontController
|
||||
|
||||
/* Setting default addresses for cart */
|
||||
if (count($customerAddresses)) {
|
||||
if ((!isset($this->context->cart->id_address_delivery) || empty($this->context->cart->id_address_delivery)) || !Address::isCountryActiveById((int)$this->context->cart->id_address_delivery)) {
|
||||
$this->context->cart->id_address_delivery = (int)$customerAddresses[0]['id_address'];
|
||||
$update = 1;
|
||||
}
|
||||
if ((!isset($this->context->cart->id_address_invoice) || empty($this->context->cart->id_address_invoice)) || !Address::isCountryActiveById((int)$this->context->cart->id_address_invoice)) {
|
||||
$this->context->cart->id_address_invoice = (int)$customerAddresses[0]['id_address'];
|
||||
$update = 1;
|
||||
|
||||
@@ -653,7 +653,18 @@ class ProductControllerCore extends FrontController
|
||||
// calculate room type price first
|
||||
$useTax = HotelBookingDetail::useTax();
|
||||
$totalPrice = 0;
|
||||
$productPriceWithoutReduction = $objProduct->getPriceWithoutReduct(!$useTax);
|
||||
$priceWithoutDiscount = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
|
||||
$idProduct,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0
|
||||
);
|
||||
$roomTypeDateRangePrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
|
||||
$idProduct,
|
||||
$dateFrom,
|
||||
@@ -669,6 +680,8 @@ class ProductControllerCore extends FrontController
|
||||
true
|
||||
);
|
||||
$roomTypeDateRangePrice = $roomTypeDateRangePrice['total_price_tax_incl'];
|
||||
$totalPriceWithoutDiscount = $priceWithoutDiscount['total_price_tax_incl'];
|
||||
|
||||
} else {
|
||||
$featurePrice = HotelRoomTypeFeaturePricing::getRoomTypeFeaturePricesPerDay(
|
||||
$idProduct,
|
||||
@@ -677,9 +690,10 @@ class ProductControllerCore extends FrontController
|
||||
false
|
||||
);
|
||||
$roomTypeDateRangePrice = $roomTypeDateRangePrice['total_price_tax_excl'];
|
||||
$totalPriceWithoutDiscount = $priceWithoutDiscount['total_price_tax_excl'];
|
||||
}
|
||||
$featurePriceDiff = (float) ($productPriceWithoutReduction - $featurePrice);
|
||||
|
||||
$totalPriceWithoutDiscount *= $quantity;
|
||||
$totalRoomPrice = $roomTypeDateRangePrice * $quantity;
|
||||
// calculate demand price now
|
||||
$demandsPricePerRoom = 0;
|
||||
@@ -788,6 +802,7 @@ class ProductControllerCore extends FrontController
|
||||
$smartyVars['has_room_type_demands'] = $roomTypeDemands ? true : false; // whether to show price breakup
|
||||
$smartyVars['rooms_price'] = $totalRoomPrice;
|
||||
$smartyVars['demands_price_per_room'] = $demandsPricePerRoom;
|
||||
$smartyVars['total_price_without_discount'] = $totalPriceWithoutDiscount + $demandsPrice;
|
||||
$smartyVars['demands_price'] = $demandsPrice;
|
||||
$smartyVars['total_price'] = $totalPrice;
|
||||
$this->context->smarty->assign($smartyVars);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Alias ID;Alias *;Search *;Active (0/1)
|
||||
1;ano, anno, nona;nano;1
|
||||
2;ipdo, idop, podi;ipod;1
|
||||
3;McBook, Mbcook;MacBook;1
|
||||
4;Blekin;Belkin;1
|
||||
1;htl, hotle;Hotel;1
|
||||
2;rom, roms;Room;1
|
||||
2;romblk, romblk;Room Block;1
|
||||
3;ordre;Order;1
|
||||
|
||||
|
4
docs/csv_import/bookings_import.csv
Normal file
4
docs/csv_import/bookings_import.csv
Normal file
@@ -0,0 +1,4 @@
|
||||
Order Reference ID;Customer ID;Room Type ID;Duration(yyyy-mm-dd);Number Of Rooms;Order Price;Due Amount;Currency ID;Order Status ID;Service Product IDs (x:n, y:n, z:n,..);Additional Facilities IDs (x:a, y:b, z:c,...)
|
||||
1;1;1;2025-03-09,2025-03-10;1;1250;;1;2;20:2;2:1
|
||||
1;1;2;2025-03-09,2025-03-10;2;2000;;;2;20;1
|
||||
2;2;1;2024-03-09,2024-03-10;2;1250;250;;8;20;
|
||||
|
@@ -1,4 +1,3 @@
|
||||
Category ID;Active (0/1);Name *;Parent category;Root category (0/1);Description;Meta title;Meta keywords;Meta description;URL rewritten;Image URL
|
||||
10;1;iPods;Home;0;Now that you can buy movies from the iTunes Store and sync them to your iPod, the whole world is your theater.;Meta title-iPods;Meta keywords-iPods;Meta description-iPods;music-ipods;http://yourlinktotheimage.com/img1000.jpg
|
||||
11;1;Accessories;Home;0;Wonderful accessories for your iPod;Meta title-Accessories;Meta keywords-Accessories;Meta description-Accessories;accessories-ipod;http://yourlinktotheimage.com/img1001.jpg
|
||||
12;1;Laptops;Home;0;The latest Intel processor, a bigger hard drive, plenty of memory, and even more new features all fit inside just one liberating inch. The new Mac laptops have the performance, power, and connectivity of a desktop computer. Without the desk part.;Meta title-Laptops;Meta keywords-Laptops;Meta description-Laptops;laptops;http://yourlinktotheimage.com/img1002.jpg
|
||||
Category ID;Active (0/1);Name *;Parent Category
|
||||
100;1;Travel;Services
|
||||
101;1;Food;Services
|
||||
|
||||
|
@@ -1,10 +1,10 @@
|
||||
Customer ID;Active (0/1);Titles ID (Mr = 1, Ms = 2, else 0);Email *;Password *;Birthday (yyyy-mm-dd);Last Name *;First Name *;Newsletter (0/1);Opt-in (0/1);Groups (x,y,z...);Default group ID
|
||||
1;1;1;Peter.Pan@prestashop.com;123456789;1987-04-02;Pan;Peter;1;0;Customer;3
|
||||
2;1;2;Wendy.Moira.Darling@prestashop.com;123456789;1989-11-12;Darling;Wendy Moira;1;0;Customer;3
|
||||
3;1;2;Tiger.Lily@prestashop.com;123456789;1982-02-28;Lily;Tiger;1;0;Customer;3
|
||||
4;1;1;James.Hook@prestashop.com;123456789;1952-12-04;Hook;James;0;1;Customer, Carribean;4
|
||||
5;1;2;Tinker.Bell@prestashop.com;123456789;1900-01-01;Bell;Tinker;1;1;Customer;3
|
||||
6;1;1;Bob.Smee@prestashop.com;123456789;1971-10-21;Smee;Bob;1;1;Customer;3
|
||||
7;1;1;Tictac.Crocodile@prestashop.com;123456789;1991-09-27;Crocodile;Tictac;0;0;Customer, Carribean;4
|
||||
8;1;1;Jack.Banning@prestashop.com;123456789;2003-07-05;Banning;Jack;0;0;Kids;5
|
||||
9;0;2;Maggie.Banning@prestashop.com;123456789;2006-02-27;Banning;Maggie;0;0;Kids;5
|
||||
Customer ID;Active (0/1);Titles ID (Mr = 1, Mrs = 2, else 0);Email *;Password *;Birthday (yyyy-mm-dd);Last Name *;First Name *;Newsletter (0/1);Opt-in (0/1);Groups (x,y,z...);Default Group ID
|
||||
1;1;1;peterpan@qloapps.com;123456789;1987-04-02;Pan;Peter;1;0;Customer;3
|
||||
2;1;2;monkeydluffy@qloapps.com;123456789;1989-11-12;Luffy;Monkey D;1;0;Customer;3
|
||||
3;1;2;tigerlily@qloapps.com;123456789;1982-02-28;Lily;Tiger;1;0;Customer;3
|
||||
4;1;1;jameshook@qloapps.com;123456789;1952-12-04;Hook;James;0;1;Guest;2
|
||||
5;1;2;tinkerbell@qloapps.com;123456789;1900-01-01;Bell;Tinker;1;1;Customer;3
|
||||
6;1;1;bobsmee@qloapps.com;123456789;1971-10-21;Smee;Bob;1;1;Customer;3
|
||||
7;1;1;tictaccrocodile@qloapps.com;123456789;1991-09-27;Crocodile;Tictac;0;0;Guest;2
|
||||
8;1;1;jackbanning@qloapps.com;123456789;2003-07-05;Banning;Jack;0;0;Visitor;1
|
||||
9;0;2;maggiedoe@qloapps.com;123456789;2006-02-27;Doe;Maggie;0;0;Visitor;1
|
||||
|
||||
|
3
docs/csv_import/hotels_import.csv
Normal file
3
docs/csv_import/hotels_import.csv
Normal file
@@ -0,0 +1,3 @@
|
||||
Hotel ID;Active(0/1);Hotel Name;Short Description;Description;Mobile Phone;Email;Address;Rating;Check-In;Check-Out;Country ID;State ID;City;Zip Code;Hotel Policies;Allow Refund(0/1);Refund IDs (x,y,z...);Max Order Date;Prepration Time;Image URLs (x,y,z...);Delete Existing Images (0 = No, 1 = Yes)
|
||||
2;1;The Kings Hotel;The Kings Hotel with king size rooms. visit for a wonderful experience.;The Kings Hotel with king-size rooms. visit for a wonderful experience.;0900000009;kingshotel@demo.com;Greene St, New York, NY 10003, USA;3;12:00;11:00;21;32;New York;10003;1. intelligentsia tattooed pop-up salvia asymmetrical mixtape meggings tousled ramps VHS cred.2. intelligentsia tattooed pop-up salvia asymmetrical mixtape meggings tousled ramps VHS cred.;1;1;2024-01-01;0;http://localhost/hotelcommerce/modules/hotelreservationsystem/views/img/hotel_img/1/1.jpg;0
|
||||
3;1;The Sunshine Palace Inn;The Sunshine Palace Inn is a beautiful hotel in japan.;The Sunshine Palace Inn is a beautiful hotel in japan.;0900000009;sunshine@demo.com;Shingashi, Itabashi, Tokyo;4;09:00;08:00;11;306;Tokyo;611-0043;1.loremipsertmkjbg ag mixtape meggings tousled ramps VHS cred.;0;0;;3;http://localhost/hotelcommerce/modules/hotelreservationsystem/views/img/hotel_img/1/2.jpg,http://localhost/hotelcommerce/modules/hotelreservationsystem/views/img/hotel_img/1/3.jpg;0
|
||||
|
3
docs/csv_import/room_types_import.csv
Normal file
3
docs/csv_import/room_types_import.csv
Normal file
@@ -0,0 +1,3 @@
|
||||
Product ID;Active(0/1);Name;Hotel ID;Pre-Tax Retail Price;Pre-Tax Operating Cost;Tax Rule ID;Allow Advance Payment;Room Type Advance Payement (0/1/2);Advance Payment Value;Include Tax With Advance Payment;Minimum Lenght Of Stay;Maximum Lenght Of Stay;Base Adults;Base Children;Maximum Adults;Maximum Children;Maximmum Guest;Show At Front;Additional Facilities IDs;Service Products IDs (x, y, z...);Feature IDs (x, y, z...);Short Description;Description;Meta Title;Meta Keywords;Meta Description;URL Rewritten;Image URLs (x,y,z...);Delete Existing Images (0 = No, 1 = Yes)
|
||||
6;1;The Sunshine Luxury;1;2200;0;1;1;1;10;0;1;0;2;0;2;2;4;1;1;12;1,2,3,4;The Sunshine Luxury;The Sunshine Luxury;;;;the-sunshine-luxury;http://localhost/hotelcommerce/img/p/4/4.jpg;0
|
||||
10;1;King Premium Rooms;1;3200;0;1;;0;;;2;7;2;0;2;2;4;1;;;1,2,3,4;King Premium Rooms;King Premium Rooms;;;;king-premium-rooms;http://localhost/hotelcommerce/img/p/3/3.jpg;0
|
||||
|
3
docs/csv_import/rooms_import.csv
Normal file
3
docs/csv_import/rooms_import.csv
Normal file
@@ -0,0 +1,3 @@
|
||||
Room No;Floor;Product ID;Room Status (1 = Active, 2 = Inactive, 3 = Temporarily Inactive);Extra Information;Disabled Dates And Reason Incase Of Temporary Inactive
|
||||
GR-109;First;1;3;Newly added room;2024-01-01:2024-01-02:Reason1, 2023-02-03:2023-02-02:Reason2
|
||||
DR-107;First;2;1;;
|
||||
|
4
docs/csv_import/service_products_import.csv
Normal file
4
docs/csv_import/service_products_import.csv
Normal file
@@ -0,0 +1,4 @@
|
||||
ID;Active(0/1);Name;Categories (x,y,z...);Associated Room Types IDs (x,y,z...);Pre-Tax Retail Price;Pre-tax Operating Cost;Tax Rule ID;Auto add to cart (0 = No,1 = Yes);Price display preference (If auto add to cart);Show at front office (0 = No,1 = Yes);Price calculation method(1 = Once per booking,2 = Each day);Short description;Image URLs (x,y,z...);Delete existing images (0 = No,1 = Yes)
|
||||
30;1;Room Maintenance Fee;;1,2;250;0;1;1;1;;;;http://localhost/hotelcommerce/img/p/1/0/10.jpg;0
|
||||
;1;Breakfast;;1,2;350;0;1;0;;1;2;;http://localhost/hotelcommerce/img/p/9/9.jpg;0
|
||||
;1;Cab on demand;;1,3;200;0;1;0;;1;1;;http://localhost/hotelcommerce/img/p/9/9.jpg;0
|
||||
|
@@ -94,6 +94,7 @@ class InstallControllerHttpSystem extends InstallControllerHttp
|
||||
'pdo_mysql' => $this->l('PDO MySQL extension is not loaded'),
|
||||
'curl' => $this->l('Curl extension is not loaded'),
|
||||
'soap' => $this->l('SOAP extension is not loaded'),
|
||||
'openssl' => $this->l('OpenSSL extension is not loaded.'),
|
||||
'simplexml' => $this->l('SimpleXml extension is not loaded'),
|
||||
'memory_limit' => $this->l('In the PHP configuration set memory_limit to minimum 128M'),
|
||||
'max_execution_time' => $this->l('In the PHP configuration set max_execution_time to minimum 500'),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -777,7 +777,7 @@
|
||||
<value>localhost</value>
|
||||
</configuration>
|
||||
<configuration id="PS_SHOP_NAME" name="PS_SHOP_NAME">
|
||||
<value>PrestaShop</value>
|
||||
<value>QloApps</value>
|
||||
</configuration>
|
||||
<configuration id="PS_SHOP_EMAIL" name="PS_SHOP_EMAIL">
|
||||
<value>pub@qloapps.com</value>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
$localizationPacksRoot = realpath(dirname(__FILE__) . '/../../localization');
|
||||
|
||||
if (!$localizationPacksRoot) {
|
||||
die("Could not find the folder containing the localization files (should be 'localization' at the root of the PrestaShop folder).\n");
|
||||
die("Could not find the folder containing the localization files (should be 'localization' at the root of the QloApps folder).\n");
|
||||
}
|
||||
|
||||
$euLocalizationFiles = array();
|
||||
|
||||
14
install/fixtures/fashion/data/cart_customer_guest_detail.xml
Normal file
14
install/fixtures/fashion/data/cart_customer_guest_detail.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<entity_cart_customer_guest_detail>
|
||||
<fields id="email" class="CartCustomerGuestDetail">
|
||||
<field name="id_cart" />
|
||||
<field name="id_gender" />
|
||||
<field name="firstname" />
|
||||
<field name="lastname" />
|
||||
<field name="email"/>
|
||||
<field name="phone" />
|
||||
</fields>
|
||||
<entities>
|
||||
<cart_customer_guest_detail id="customer_guest_1" id_cart="0" id_gender="1" firstname="John" lastname="Doe" email="pub@qloapps.com" phone="1234567890" />
|
||||
</entities>
|
||||
</entity_cart_customer_guest_detail>
|
||||
@@ -19,8 +19,8 @@
|
||||
<url_rewrite>contact-us</url_rewrite>
|
||||
</meta>
|
||||
<meta id="index" id_shop="1">
|
||||
<title/>
|
||||
<description>Website powered by Webkul</description>
|
||||
<title>Hotel Prime</title>
|
||||
<description>A place where comfort and luxury are blended with nature!</description>
|
||||
<keywords/>
|
||||
<url_rewrite/>
|
||||
</meta>
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
<url_rewrite>contact-us</url_rewrite>
|
||||
</meta>
|
||||
<meta id='index' id_shop='1'>
|
||||
<title/>
|
||||
<description>PrestaShop দ্বারা চালিত</description>
|
||||
<title>হোটেল প্রাইম</title>
|
||||
<description>এটি এমন একটি স্থান যেখানে আরাম এবং বিলাসিতা প্রকৃতির সাথে মিলিত হয়েছে!</description>
|
||||
<keywords/>
|
||||
<url_rewrite/>
|
||||
</meta>
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
<url_rewrite>entrar-em-contato-conosco</url_rewrite>
|
||||
</meta>
|
||||
<meta id='index' id_shop='1'>
|
||||
<title/>
|
||||
<description>Loja desenvolvida pela PrestaShop</description>
|
||||
<keywords>shop, prestashop</keywords>
|
||||
<title>Hotel Prime</title>
|
||||
<description>Um lugar onde o conforto e o luxo se misturam com a natureza!</description>
|
||||
<keywords/>
|
||||
<url_rewrite/>
|
||||
</meta>
|
||||
<meta id='manufacturer' id_shop='1'>
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
<url_rewrite>napiste-nam</url_rewrite>
|
||||
</meta>
|
||||
<meta id="index" id_shop="1">
|
||||
<title/>
|
||||
<description>Website powered by Webkul™</description>
|
||||
<title>Hotel Prime</title>
|
||||
<description>Místo, kde se komfort a luxus mísí s přírodou!</description>
|
||||
<keywords/>
|
||||
<url_rewrite/>
|
||||
</meta>
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
<url_rewrite>kontaktieren-sie-uns</url_rewrite>
|
||||
</meta>
|
||||
<meta id="index" id_shop="1">
|
||||
<title/>
|
||||
<description>Website powered by Webkul</description>
|
||||
<keywords>Shop, prestashop</keywords>
|
||||
<title>Hotel Prime</title>
|
||||
<description>Ein Ort, an dem Komfort und Luxus mit der Natur verschmelzen!</description>
|
||||
<keywords/>
|
||||
<url_rewrite/>
|
||||
</meta>
|
||||
<meta id="manufacturer" id_shop="1">
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<template>payment_error</template>
|
||||
</order_state>
|
||||
<order_state id="Payment_remotely_accepted">
|
||||
<name>Zahlung ausserhalb von PrestaShop eingegangen</name>
|
||||
<name>Fernzahlung akzeptiert</name>
|
||||
<template>payment_accepted</template>
|
||||
</order_state>
|
||||
<order_state id="Awaiting_remote_payment">
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user