V1.5.0 released: API, Refund procress improvement, Order data management
@@ -1,3 +1,87 @@
|
||||
####################################
|
||||
# V1.5.0
|
||||
####################################
|
||||
|
||||
## Added Features:
|
||||
|
||||
[+] CO : QloApps APIs are created (Prestashop APIs are modified as per hotel QloApps changes)
|
||||
[+] CO : `is_advance_payment` column is added in the 'cart' table.
|
||||
[+] CO : `is_advance_payment`, `advance_paid_amount` columns are added in the 'orders' table.
|
||||
[+] CO : `id_transaction`, `payment_mode`, `refunded_amount`, `by_admin` columns are added in the 'order_return' table.
|
||||
[+] CO : `id_order_return_detail`, `id_htl_booking`, `refunded_amount` columns are added in the 'order_return_detail' table.
|
||||
[+] CO : `send_email_to_customer`, `send_email_to_superadmin`, `send_email_to_employee`, `send_email_to_hotelier`, denied`, `refunded`, `module_name` columns are added in the 'order_return_state' table.
|
||||
[+] CO : `customer_template`, `admin_template` columns are added in the 'order_return_state_lang' table.
|
||||
[+] CO : `id_htl_booking` column is added in the 'order_slip_detail' table.
|
||||
[+] CO : Refund emails will be sent to the customer as per return state setting
|
||||
[+] CO : All images link are now generated dynamically
|
||||
|
||||
[+] FO : Room type refund policies in the policies tab is shown in the room type details page.
|
||||
[+] FO : A controller will be there for the customer which will show his refund requests info
|
||||
|
||||
[+] BO : Admin can enable/disable refund for the hotel
|
||||
[+] BO : Refund Process:: Order return statuses improved for order refund statuses.
|
||||
[+] BO : Admin can select rules for the hotel [checkboxes]
|
||||
[+] BO : Admin can initiate refund if refund is enable for the system
|
||||
[+] BO : Admin can select which state is considered as refunded complete in the return state.
|
||||
[+] BO : Admin can select which state is considered as refunded denied in the return state.
|
||||
[+] BO : Admin can select whcih email will be sent to customer and admin for the return state.
|
||||
|
||||
[+] BO : Feature Price Rule: Groups wise Condition in feature price rules is added.
|
||||
[+] BO : Global refund policies cms page can be selected from refund rules controller.
|
||||
[+] BO : Refund can be enabled/disabled globally from refund rules controller.
|
||||
[+] BO : Payment mode and transaction id can be saved for the refund.
|
||||
[+] BO : Voucher slip can be generated for refund.
|
||||
[+] BO : Credit slip can be generated for refund.
|
||||
[+] BO : Additional facilities can be edited at the time of order editing.
|
||||
[+] BO : Room type features images are used as jpg images in place of png images.
|
||||
|
||||
|
||||
## Improved/changed features:
|
||||
|
||||
[*] BO : Refund Process:: Order return statuses improved for order refund statuses.
|
||||
[*] BO : In Additional Facilities list no price will be shown if facility have advance options.
|
||||
[*] BO : Admin will be able to select a checkout date while changing status of the room from order details page.
|
||||
[*] BO : Hotel category will be selected Default room type category.
|
||||
[*] BO : In Room type renderlist hotel(instead of category), city, number rooms, adults, Childs columns added.
|
||||
[*] BO : Merchandise Return tab is removed.
|
||||
[*] BO : Room type ids now start room type id from 1 in room type render list.
|
||||
[*] BO : Prestashop warning pop up will nt be shown during module installation for Webkul modules.
|
||||
[*] BO : Updated addons link from store to addon's page
|
||||
[*] BO : Added recomended image size for room type images for appropriate view on front end.
|
||||
|
||||
[*] FO : Calendar Design is improved of date from and date to in QloApps.
|
||||
[*] FO : 'Proceed' button during checkout will be disabled in case of errors while checkout.
|
||||
[*] FO : Search panel is improved on all pages.
|
||||
[*] FO : Cart warning text changed
|
||||
[*] FO : Refund request proocess is improved for the customer. Designed is also improved.
|
||||
|
||||
[*] CO : paypal adaptive module (by webkul) Removed completely from qloapps
|
||||
[*] CO : All the irrelevant data creation from the installation process is removed Which is not related to Qloapps but Prestashop. e.g carriers, stores, suppliers, manufacturers...... etc. Order data will not be populated now.
|
||||
|
||||
[*] CO : For refund request "order_return" and "order_return_detail" tables are used.
|
||||
[*] CO : For order refund states "order_return_states" table is used.
|
||||
|
||||
|
||||
## Bug/Issues Resolved:
|
||||
|
||||
[-] BO : FIXED : Room does not free even after room status set to checkout.
|
||||
[-] BO : FIXED : Room does not free while order status is changed to Refunded, Cancelled or Payment Error.
|
||||
[-] BO : FIXED : Additional facilities price id not managed while deleting a booking from admin order details page.
|
||||
|
||||
[-] FO : FIXED: when using advance payment option, discount voucher (amount) get applied to advance payment amount along with total order cost
|
||||
[-] FO : FIXED : If all rows are disabled then also blocks (Interior, Rooms, Features, Testimonials) are visible on home page.
|
||||
[-] FO : FIXED : Zip code error while making the guest check.
|
||||
[-] FO : FIXED : Issue while creating a customer/guest from checkout page on firefox browser.
|
||||
[-] FO : FIXED : Check-out date same as check-in date when current data is more than max order date for hotel
|
||||
[-] FO : FIXED : customer able to process booking for inactive rooms
|
||||
[-] FO : FIXED : Image strech issue on product page.
|
||||
[-] FO : FIXED : Cart page not update when delete from from cart dropdown
|
||||
[-] FO : FIXED : While making the guest check out the system shows zip code error in some countries.
|
||||
|
||||
[-] CO : FIXED : Fatal error: Uncaught exception 'ImagickException' while creating invoice.
|
||||
[-] CO : FIXED : warning while creating invoice (total demands variable issue)
|
||||
|
||||
|
||||
####################################
|
||||
# V1.4.1
|
||||
####################################
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
<dd>{l s="Connect with the Qloapps community"}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><a href="https://store.webkul.com/Qloapps.html" class="_blank">{l s="Qloapps Addons"}</a></dt>
|
||||
<dt><a href="https://qloapps.com/addons/" class="_blank">{l s="Qloapps Addons"}</a></dt>
|
||||
<dd>{l s="Enhance your store Qloapps modules"}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
*}
|
||||
<div class="alert bg-info">
|
||||
<div class="row modules-addons-info">
|
||||
<h4>{l s='Explore all addon of Qloapps '}<a class="btn btn-default _blank" href="https://store.webkul.com/Qloapps.html"> @{l s='Qloapps addons'}</a></h4>
|
||||
<h4>{l s='Explore all addon of Qloapps '}<a class="btn btn-default _blank" href="https://qloapps.com/addons/"> @{l s='Qloapps addons'}</a></h4>
|
||||
</div>
|
||||
</div>
|
||||
{$kpis}
|
||||
|
||||
@@ -24,6 +24,11 @@
|
||||
*}
|
||||
|
||||
<tr class="product-line-row" data-id_room="{$data.id_room}" data-id_product="{$data.id_product}" data-id_hotel="{$data.id_hotel}" data-date_from="{$data.date_from}" data-date_to="{$data.date_to}" data-product_price="{$data.unit_amt_tax_incl}" data-order_detail_id="{$data.id_order_detail}">
|
||||
{if $refund_allowed}
|
||||
<td class="standard_refund_fields" style="display:none">
|
||||
<input type="checkbox" name="id_htl_booking[]" value="{$data.id|escape:'html':'UTF-8'}" {if isset($refundReqBookings) && ($data.id|in_array:$refundReqBookings)}disabled{/if}/>
|
||||
</td>
|
||||
{/if}
|
||||
<td class="text-center">
|
||||
{$data.room_num}
|
||||
</td>
|
||||
@@ -32,12 +37,12 @@
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<p>{$data.room_type}</p>
|
||||
<p class="room_extra_demands {if !isset($data['extra_demands']) || !$data['extra_demands']}edit_product_fields{/if}" {if !isset($data['extra_demands']) || !$data['extra_demands']}style="display: none;"{/if}>
|
||||
<a href="#" data-toggle="modal" data-target="#rooms_type_extra_demands" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" class="open_room_extra_demands" id_htl_booking="{$data['id']}" edit_orde_line="0">
|
||||
{l s='Additional Features'}
|
||||
</a>
|
||||
</p>
|
||||
{if isset($data['extra_demands']) && $data['extra_demands']}
|
||||
<p class="room_extra_demands">
|
||||
<a href="#" data-toggle="modal" data-target="#rooms_type_extra_demands" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" class="open_room_extra_demands">
|
||||
{l s='Additional Features'}
|
||||
</a>
|
||||
</p>
|
||||
<p>
|
||||
{convertPriceWithCurrency price=$data['extra_demands_price_ti'] currency=$currency->id}
|
||||
</p>
|
||||
@@ -106,38 +111,29 @@
|
||||
</div>
|
||||
{/if}
|
||||
</td>
|
||||
|
||||
<td class="text-center stage_name">
|
||||
<p>
|
||||
{if isset($data['stage_name']) && $data['stage_name']}
|
||||
{$data['stage_name']}
|
||||
{else}
|
||||
--
|
||||
{if isset($refundReqBookings) && $refundReqBookings}
|
||||
<td class="text-center">
|
||||
{if isset($data.refund_info) && $data.refund_info}
|
||||
<span class="badge" style="background-color:{$data.refund_info.color|escape:'html':'UTF-8'}">{$data.refund_info.name|escape:'html':'UTF-8'}</span>
|
||||
{/if}
|
||||
</p>
|
||||
</td>
|
||||
<td class="text-center status_name">
|
||||
<p>
|
||||
{if $data['stage_name'] == 'Refunded' || $data['stage_name'] == 'Rejected'}
|
||||
{l s="Done!"}
|
||||
{else if $data['stage_name'] == 'Waiting' || $data['stage_name'] == 'Accepted'}
|
||||
{l s="Pending..."}
|
||||
{else}
|
||||
--
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{if isset($data.refund_info) && $data.refund_info}
|
||||
{convertPriceWithCurrency price=$data.refund_info.refunded_amount currency=$currency->id}
|
||||
{/if}
|
||||
</p>
|
||||
</td>
|
||||
</td>
|
||||
{/if}
|
||||
|
||||
{if $data.booking_type == 1}
|
||||
<td class="text-center">
|
||||
{if $data['stage_name'] == 'Refunded' || $data['stage_name'] == 'Rejected'}
|
||||
<p class="text-center">----</p>
|
||||
{else}
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#mySwappigModal" data-id_order="{$order->id}" data-room_num='{$data.room_num}' data-date_from='{$data.date_from}' data-date_to='{$data.date_to}' data-id_room='{$data.id_room}' data-cust_name='{$data.alloted_cust_name}' data-cust_email='{$data.alloted_cust_email}' data-avail_rm_swap='{$data.avail_rooms_to_swap|@json_encode}' data-avail_rm_realloc='{$data.avail_rooms_to_realloc|@json_encode}'>
|
||||
{l s='Reallocate Room' mod='hotelreservationsystem'}
|
||||
</button>
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{if isset($data.refund_info) && ($data.refund_info.refunded || $data.refund_info.denied)}
|
||||
<p class="text-center">--</p>
|
||||
{else}
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#mySwappigModal" data-id_order="{$order->id}" data-room_num='{$data.room_num}' data-date_from='{$data.date_from}' data-date_to='{$data.date_to}' data-id_room='{$data.id_room}' data-cust_name='{$data.alloted_cust_name}' data-cust_email='{$data.alloted_cust_email}' data-avail_rm_swap='{$data.avail_rooms_to_swap|@json_encode}' data-avail_rm_realloc='{$data.avail_rooms_to_realloc|@json_encode}'>
|
||||
{l s='Reallocate Room' mod='hotelreservationsystem'}
|
||||
</button>
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
{if ($can_edit && !$order->hasBeenDelivered())}
|
||||
<td class="product_invoice" style="display: none;">
|
||||
|
||||
@@ -1,19 +1,123 @@
|
||||
{if isset($extraDemands) && $extraDemands}
|
||||
{foreach $extraDemands as $roomDemand}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 demand_header">
|
||||
<i class="icon icon-tasks"></i> {l s='Room\'s Extra Demands'}
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title"><i class="icon-tasks"></i> {l s='Additional Facilities'} {if isset($orderEdit) && $orderEdit}<span class="badge badge-success demand_edit_badge">{l s='edit'}</span>{/if} <button type="button" class="close pull-right" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="modal-body" id="rooms_extra_demands">
|
||||
<div id="room_type_demands_desc" class="row">
|
||||
<input type="hidden" value="0" id="id_htl_booking">
|
||||
{if isset($orderEdit) && $orderEdit}
|
||||
<p class="col-sm-12 facility_nav_btn">
|
||||
<button id="btn_new_room_facility" class="btn btn-success"><i class="icon-plus"></i> {l s='Add new facility'}</button>
|
||||
<button id="back_to_facilities_btn" class="btn btn-default"><i class="icon-arrow-left"></i> {l s='Back'}</button>
|
||||
</p>
|
||||
|
||||
{* Already selected room demands *}
|
||||
<div class="col-sm-12 room_ordered_demands table-responsive">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
{if isset($extraDemands) && $extraDemands}
|
||||
{foreach $extraDemands as $roomDemand}
|
||||
{foreach $roomDemand['extra_demands'] as $demand}
|
||||
<tr>
|
||||
<td>{$demand['name']}</td>
|
||||
<td>{displayPrice price=$demand['total_price_tax_incl'] currency=$orderCurrency}</td>
|
||||
<td><a class="btn btn-danger pull-right del-order-room-demand" href="#" id_booking_demand="{$demand['id_booking_demand']}"><i class="icon-trash"></i></a></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<i class="icon-warning"></i> {l s='No additional facilities added yet.'}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<div class="col-sm-12 demand_detail">
|
||||
{foreach $roomDemand['extra_demands'] as $demand}
|
||||
<p>
|
||||
<span>{$demand['name']}</span>
|
||||
<span class="pull-right">{displayPrice price=$demand['total_price_tax_incl'] currency=$orderCurrency}</span>
|
||||
</p>
|
||||
{/foreach}
|
||||
|
||||
{* Room demands available for the current editing room*}
|
||||
<div class="col-sm-12 room_demands_container">
|
||||
<div class="room_demand_detail">
|
||||
{if isset($roomTypeDemands) && $roomTypeDemands}
|
||||
{foreach $roomTypeDemands as $idGlobalDemand => $demand}
|
||||
<div class="row room_demand_block">
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="col-xs-2">
|
||||
<input id_cart_booking="{$roomDemand['id']}" value="{$idGlobalDemand|escape:'html':'UTF-8'}" type="checkbox" class="id_room_type_demand" {if isset($roomDemand['selected_global_demands']) && $roomDemand['selected_global_demands'] && ($idGlobalDemand|in_array:$roomDemand['selected_global_demands'])}checked{/if} />
|
||||
</div>
|
||||
<div class="col-xs-10 demand_adv_option_block">
|
||||
<p>{$demand['name']|escape:'html':'UTF-8'}</p>
|
||||
{if isset($demand['adv_option']) && $demand['adv_option']}
|
||||
<select class="id_option">
|
||||
{foreach $demand['adv_option'] as $idOption => $option}
|
||||
{assign var=demand_key value="`$idGlobalDemand`-`$idOption`"}
|
||||
<option optionPrice="{$option['price']|escape:'html':'UTF-8'}" value="{$idOption|escape:'html':'UTF-8'}" {if isset($roomDemand['extra_demands'][$demand_key])}selected{/if} key="{$demand_key}">{$option['name']}</option>
|
||||
{if isset($roomDemand['extra_demands'][$demand_key])}
|
||||
{assign var=selected_adv_option value="$idOption"}
|
||||
{/if}
|
||||
{/foreach}
|
||||
</select>
|
||||
{else}
|
||||
<input type="hidden" class="id_option" value="0" />
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<p><span class="pull-right extra_demand_option_price">{if isset($selected_adv_option) && isset($demand['adv_option'][$selected_adv_option]['price'])}{convertPrice price = $demand['adv_option'][$selected_adv_option]['price']|escape:'html':'UTF-8'}{else}{convertPrice price = $demand['price']|escape:'html':'UTF-8'}{/if}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
{elseif isset($extraDemands) && $extraDemands}
|
||||
{foreach $extraDemands as $roomDemand}
|
||||
<div class="col-sm-12">
|
||||
<div class="col-sm-12 room_demand_detail">
|
||||
{foreach $roomDemand['extra_demands'] as $demand}
|
||||
<p>
|
||||
<span>{$demand['name']}</span>
|
||||
<span class="pull-right">{displayPrice price=$demand['total_price_tax_incl'] currency=$orderCurrency}</span>
|
||||
</p>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary pull-left" data-dismiss="modal">{l s='Close'}</button>
|
||||
<button type="button" id="save_room_facilities" class="btn btn-success pull-right"><i class="icon-save"></i> {l s='Save'}</button>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{* Css for handling extra demands changes *}
|
||||
<style type="text/css">
|
||||
/*Extra demands CSS*/
|
||||
#rooms_type_extra_demands .modal-title {
|
||||
margin: 0px;}
|
||||
#rooms_type_extra_demands .demand_edit_badge {
|
||||
font-size: 14px;}
|
||||
#rooms_extra_demands .room_ordered_demands td, #rooms_extra_demands .room_demand_detail {
|
||||
font-size: 14px;}
|
||||
#rooms_extra_demands .demand_header {
|
||||
padding: 10px;
|
||||
color: #333;
|
||||
border-bottom: 1px solid #ddd;}
|
||||
#rooms_extra_demands .room_demand_block {
|
||||
margin-bottom: 15px;
|
||||
color: #333;
|
||||
font-size: 14px;}
|
||||
#rooms_extra_demands .facility_nav_btn {
|
||||
margin-bottom: 20px;}
|
||||
#rooms_extra_demands .room_demands_container {
|
||||
display: none;}
|
||||
#room_extra_demand_content #save_room_facilities, #room_extra_demand_content #back_to_facilities_btn {
|
||||
display: none;}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -157,25 +157,17 @@
|
||||
{/if} -->
|
||||
<!-- End -->
|
||||
|
||||
{if Configuration::get('PS_ORDER_RETURN')}
|
||||
{if $refund_allowed && !$hasCompletelyRefunded}
|
||||
<a id="desc-order-standard_refund" class="btn btn-default" href="#refundForm">
|
||||
<i class="icon-exchange"></i>
|
||||
{if $order->hasBeenShipped()}
|
||||
{l s='Return products'}
|
||||
{elseif $order->hasBeenPaid()}
|
||||
{l s='Standard refund'}
|
||||
{if $order->hasBeenPaid()}
|
||||
{l s='Initiate refund'}
|
||||
{else}
|
||||
{l s='Cancel products'}
|
||||
{l s='Cancel bookings'}
|
||||
{/if}
|
||||
</a>
|
||||
|
||||
{/if}
|
||||
{if $order->hasInvoice()}
|
||||
<a id="desc-order-partial_refund" class="btn btn-default hidden" href="#refundForm">
|
||||
<i class="icon-exchange"></i>
|
||||
{l s='Partial refund'}
|
||||
</a>
|
||||
{/if}
|
||||
</div>
|
||||
<!-- Tab nav -->
|
||||
<ul class="nav nav-tabs" id="tabOrder">
|
||||
@@ -206,7 +198,7 @@
|
||||
{foreach from=$history item=row key=key}
|
||||
{if ($key == 0)}
|
||||
<tr>
|
||||
<td style="background-color:{$row['color']}"><img src="../img/os/{$row['id_order_state']|intval}.gif" width="16" height="16" alt="{$row['ostate_name']|stripslashes}" /></td>
|
||||
<td style="background-color:{$row['color']}"><img src="{$link->getMediaLink("`$img_dir`os/`$row['id_order_state']|intval`.gif")}" width="16" height="16" alt="{$row['ostate_name']|stripslashes}" /></td> {* by webkul to get media link *}
|
||||
<td style="background-color:{$row['color']};color:{$row['text-color']}">{$row['ostate_name']|stripslashes}</td>
|
||||
<td style="background-color:{$row['color']};color:{$row['text-color']}">{if $row['employee_lastname']}{$row['employee_firstname']|stripslashes} {$row['employee_lastname']|stripslashes}{/if}</td>
|
||||
<td style="background-color:{$row['color']};color:{$row['text-color']}">{dateFormat date=$row['date_add'] full=true}</td>
|
||||
@@ -221,7 +213,7 @@
|
||||
</tr>
|
||||
{else}
|
||||
<tr>
|
||||
<td><img src="../img/os/{$row['id_order_state']|intval}.gif" width="16" height="16" /></td>
|
||||
<td><img src="{$link->getMediaLink("`$img_dir`os/`$row['id_order_state']|intval`.gif")}" width="16" height="16" /></td>
|
||||
<td>{$row['ostate_name']|stripslashes}</td>
|
||||
<td>{if $row['employee_lastname']}{$row['employee_firstname']|stripslashes} {$row['employee_lastname']|stripslashes}{else} {/if}</td>
|
||||
<td>{dateFormat date=$row['date_add'] full=true}</td>
|
||||
@@ -244,12 +236,9 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-9">
|
||||
<select id="id_order_state" class="chosen form-control" name="id_order_state">
|
||||
{foreach from=$states item=state}
|
||||
<!-- By webkul to hide unnecessary order statues from statuses dropdown -->
|
||||
{if $state['id_order_state']!=4 && $state['id_order_state']!=5 && $state['id_order_state']!=14}
|
||||
{foreach from=$states item=state}
|
||||
<option value="{$state['id_order_state']|intval}"{if isset($currentState) && $state['id_order_state'] == $currentState->id} selected="selected" disabled="disabled"{/if}>{$state['name']|escape}</option>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
</select>
|
||||
<input type="hidden" name="id_order" value="{$order->id}" />
|
||||
</div>
|
||||
@@ -268,6 +257,11 @@
|
||||
{include file='controllers/orders/_documents.tpl'}
|
||||
</div>
|
||||
</div>
|
||||
{if $returns}
|
||||
<div class="alert alert-warning">
|
||||
{l s='Booking cancellation requests has raised from this order. To see booking cancelation requests'} <a target="_blank" href="{$link->getAdminLink('AdminOrderRefundRequests')}&id_order={$order->id}&vieworder_return">{l s='Click here'}</a>.
|
||||
</div>
|
||||
{/if}
|
||||
<div class="row">
|
||||
<div class="panel">
|
||||
<div class="panel-heading order_status_heading">
|
||||
@@ -276,7 +270,7 @@
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="col-lg-12" id="room_status_info_wrapper">
|
||||
<table class="table table-responsive">
|
||||
<tr>
|
||||
<th>{l s='Room No.'}</th>
|
||||
@@ -286,44 +280,54 @@
|
||||
<th>{l s='Order Status'}</th>
|
||||
</tr>
|
||||
{if isset($htl_booking_order_data) && $htl_booking_order_data}
|
||||
{foreach from=$htl_booking_order_data item=data}
|
||||
<tr>
|
||||
<td>
|
||||
{$data['room_num']}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{$link->getAdminLink('AdminAddHotel')}&id={$data['id_hotel']}&updatehtl_branch_info" target="_blank">
|
||||
<span>{$data['hotel_name']}</span>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{$data['date_from']|date_format:"%d-%m-%Y"}
|
||||
</td>
|
||||
<td>
|
||||
{$data['date_to']|date_format:"%d-%m-%Y"}
|
||||
</td>
|
||||
<td>
|
||||
<form action="" method="post" class="form-horizontal">
|
||||
<select style="margin-right:20px;margin-bottom:5px;display:inline;width:40%;" name="booking_order_status">
|
||||
{foreach from=$hotel_order_status item=state}
|
||||
<option value="{$state['id']|intval}" {if isset($data.id_status) && $state.id == $data.id_status} selected="selected" disabled="disabled"{/if}>{$state.status|escape}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<input type="hidden" name="date_from" value="{$data['date_from']}" />
|
||||
<input type="hidden" name="date_to" value="{$data['date_to']}" />
|
||||
<input type="hidden" name="id_room" value="{$data['id_room']}" />
|
||||
<input type="hidden" name="id_order" value="{$order->id}" />
|
||||
<button type="submit" name="submitbookingOrderStatus" class="btn btn-primary">
|
||||
{l s='Update Status'}
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{foreach from=$htl_booking_order_data item=data}
|
||||
<tr>
|
||||
<td>
|
||||
{$data['room_num']}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{$link->getAdminLink('AdminAddHotel')}&id={$data['id_hotel']}&updatehtl_branch_info" target="_blank">
|
||||
<span>{$data['hotel_name']}</span>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{$data['date_from']|date_format:"%d-%m-%Y"}
|
||||
</td>
|
||||
<td>
|
||||
{$data['date_to']|date_format:"%d-%m-%Y"}
|
||||
</td>
|
||||
<td>
|
||||
<form action="" method="post" class="form-horizontal row room_status_info_form">
|
||||
<div class="col-sm-7">
|
||||
<select name="booking_order_status" class="form-control booking_order_status margin-bottom-5">
|
||||
{foreach from=$hotel_order_status item=state}
|
||||
<option value="{$state['id']|intval}" {if isset($data.id_status) && $state.id == $data.id_status} selected="selected" disabled="disabled"{/if}>{$state.status|escape}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
{if $data['id_status'] == 2}<span class="badge badge-success margin-bottom-5">{l s='checked in on'} {$data['check_in']|date_format:"%d-%m-%Y"}</span>{elseif $data['id_status'] == 3}<span class="badge badge-success margin-bottom-5">{l s='checked out on'} {$data['check_out']|date_format:"%d-%m-%Y"}</span>{/if}
|
||||
|
||||
{* field for the current date *}
|
||||
<input class="room_status_date wk-input-date" type="text" name="status_date" value="{$data['date_from']|date_format:"%d-%m-%Y"}" readonly/>
|
||||
|
||||
<input type="hidden" name="date_from" value="{$data['date_from']|date_format:"%Y-%m-%d"}" />
|
||||
<input type="hidden" name="date_to" value="{$data['date_to']|date_format:"%Y-%m-%d"}" />
|
||||
<input type="hidden" name="id_room" value="{$data['id_room']}" />
|
||||
<input type="hidden" name="id_order" value="{$order->id}" />
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<button type="submit" name="submitbookingOrderStatus" class="btn btn-primary">
|
||||
{l s='Update Status'}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td>{l s='No data found.'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{l s='No data found.'}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</table>
|
||||
</div>
|
||||
@@ -971,6 +975,9 @@
|
||||
<table class="table" id="customer_cart_details">
|
||||
<thead>
|
||||
<tr>
|
||||
{if $refund_allowed}
|
||||
<th class="standard_refund_fields" style="display:none"></th>
|
||||
{/if}
|
||||
<th class="text-center"><span class="title_box">{l s='Room No.'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Room Image'}</th>
|
||||
<th class="text-center"><span class="title_box">{l s='Room Type'}</span></th>
|
||||
@@ -978,8 +985,10 @@
|
||||
<th class="text-center"><span class="title_box">{l s='Duration'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Unit Price (Tax incl.)'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Total Price (Tax incl.)'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Refund Stage'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Refund Status'}</span></th>
|
||||
{if isset($refundReqBookings) && $refundReqBookings}
|
||||
<th class="text-center"><span class="title_box">{l s='Refund State'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Refunded amount'}</span></th>
|
||||
{/if}
|
||||
<th class="text-center"><span class="title_box">{l s='Reallocate Room'}</span></th>
|
||||
{if ($can_edit && !$order->hasBeenDelivered())}
|
||||
<th class="text-center"><span class="title_box">{l s='Edit Order'}</th>
|
||||
@@ -1003,13 +1012,6 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{*
|
||||
<div id="refundForm">
|
||||
<a href="#" class="standard_refund"><img src="../img/admin/add.gif" alt="{l s='Process a standard refund'}" /> {l s='Process a standard refund'}</a>
|
||||
<a href="#" class="partial_refund"><img src="../img/admin/add.gif" alt="{l s='Process a partial refund'}" /> {l s='Process a partial refund'}</a>
|
||||
<!-- by webkul to hide unnessary things in the page -->
|
||||
</div>
|
||||
*}
|
||||
|
||||
{capture "TaxMethod"}
|
||||
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
|
||||
@@ -1024,82 +1026,38 @@
|
||||
<input type="hidden" name="TaxMethod" value="1">
|
||||
{/if}
|
||||
{if $can_edit}
|
||||
<div class="row-margin-bottom row-margin-top order_action">
|
||||
{if !$order->hasBeenDelivered()}
|
||||
<button type="button" id="add_product" class="btn btn-default">
|
||||
<i class="icon-plus-sign"></i>
|
||||
{l s='Add Rooms In Order'}
|
||||
</button>
|
||||
{/if}
|
||||
<button id="add_voucher" class="btn btn-default" type="button" >
|
||||
<i class="icon-ticket"></i>
|
||||
{l s='Add a new discount'}
|
||||
</button>
|
||||
</div>
|
||||
<div class="row-margin-bottom row-margin-top order_action standard_refund_fields" style="display: none;">
|
||||
<textarea class="cancellation_reason" name="cancellation_reason" placeholder="{l s='Enter reason to cancel bookings'}"></textarea>
|
||||
</div>
|
||||
<div class="row-margin-bottom row-margin-top order_action">
|
||||
{if !$order->hasBeenDelivered()}
|
||||
<button type="button" id="add_product" class="btn btn-default">
|
||||
<i class="icon-plus-sign"></i>
|
||||
{l s='Add Rooms In Order'}
|
||||
</button>
|
||||
{/if}
|
||||
<button id="add_voucher" class="btn btn-default" type="button" >
|
||||
<i class="icon-ticket"></i>
|
||||
{l s='Add a new discount'}
|
||||
</button>
|
||||
|
||||
{if $refund_allowed && !$hasCompletelyRefunded}
|
||||
<button style="display: none;" type="submit" name="initiateRefund" class="btn btn-success standard_refund_fields pull-right" id="initiateRefund">
|
||||
{if $order->hasBeenPaid()}<i class="icon-undo"></i> {l s='Initiate Refund'}{else}{l s='Cancel bookings'}{/if}
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
<div class="clear"> </div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
{*
|
||||
<div class="col-xs-6">
|
||||
<div class="alert alert-warning">
|
||||
{l s='For this customer group, prices are displayed as: [1]%s[/1]' sprintf=[$smarty.capture.TaxMethod] tags=['<strong>']}
|
||||
{if !Configuration::get('PS_ORDER_RETURN')}
|
||||
<br/><strong>{l s='Merchandise returns are disabled'}</strong>
|
||||
{if !$refund_allowed}
|
||||
<br/><strong>{l s='Refunds are disabled'}</strong>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!-- by webkul to hide unnessary things in the page-->
|
||||
*}
|
||||
|
||||
{* For Due amount submit panel (by webkul) *}
|
||||
{if isset($order_adv_dtl)}
|
||||
<div class="col-xs-6">
|
||||
<div class="panel panel-advanced-payment">
|
||||
<form class="clearfix" method="POST" action="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&vieworder&id_order={$order_adv_dtl['id_order']|intval}">
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td>
|
||||
<strong>{l s='Paid Amount'}</strong>
|
||||
</td>
|
||||
<td>
|
||||
<strong>
|
||||
{displayPrice price=$order_adv_dtl['total_paid_amount'] currency=$currency->id}
|
||||
</strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<strong>{l s='Due Amount'}</strong>
|
||||
</td>
|
||||
<td>
|
||||
<strong>{displayPrice price=($order_adv_dtl['total_order_amount'] - $order_adv_dtl['total_paid_amount']) currency=$currency->id}</strong>
|
||||
</td>
|
||||
</tr>
|
||||
{if ($order_adv_dtl['total_order_amount'] - $order_adv_dtl['total_paid_amount']) > 0}
|
||||
<tr>
|
||||
<td>
|
||||
<strong>{l s='submitted Amount'}</strong>
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="htl_order_currenct">{$currency->sign}</span>
|
||||
<input type="text" class="form-control" placeholder="Amount" aria-describedby="htl_order_currenct" name="submitted_amount">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</table>
|
||||
</div>
|
||||
{if ($order_adv_dtl['total_order_amount'] - $order_adv_dtl['total_paid_amount'])|round:2 > 0}
|
||||
<button type="submit" class="btn btn-primary" name="payDueAmount" style="margin-top:10px;">{l s="Submit Amount"}</button>
|
||||
{/if}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="col-xs-6 pull-right">
|
||||
<div class="panel panel-vouchers" style="{if !sizeof($discounts)}display:none;{/if}">
|
||||
{if (sizeof($discounts) || $can_edit)}
|
||||
@@ -1211,174 +1169,46 @@
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{*
|
||||
<tr id="total_shipping">
|
||||
<td class="text-right">{l s='Shipping'}</td>
|
||||
<td class="amount text-right nowrap" >
|
||||
{displayPrice price=$order_shipping_price currency=$currency->id}
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">
|
||||
{$currency->prefix}
|
||||
{$currency->suffix}
|
||||
</div>
|
||||
<input type="text" name="partialRefundShippingCost" value="0" />
|
||||
</div>
|
||||
<p class="help-block"><i class="icon-warning-sign"></i> {l s='(%s)' sprintf=$smarty.capture.TaxMethod}</p>
|
||||
</td>
|
||||
</tr>*}
|
||||
|
||||
{if isset($order_adv_dtl)}
|
||||
<tr>
|
||||
<td class="text-right"><strong>{l s='Paid Amount'}</strong></td>
|
||||
<td class="amount text-right nowrap">
|
||||
<strong>
|
||||
{displayPrice price=$order_adv_dtl['total_paid_amount'] currency=$currency->id}
|
||||
</strong>
|
||||
</td>
|
||||
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
|
||||
<tr id="total_taxes">
|
||||
<td class="text-right"><strong>{l s='Total Taxes'}</strong></td>
|
||||
<td class="amount text-right nowrap" ><strong>{displayPrice price=($order->total_paid_tax_incl - $order->total_paid_tax_excl) currency=$currency->id}</strong></td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr id="total_order">
|
||||
<td class="text-right"><strong>{l s='Final Booking Total'}</strong></td>
|
||||
<td class="amount text-right nowrap">
|
||||
<strong>{displayPrice price=$order->total_paid_tax_incl currency=$currency->id}</strong>
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
|
||||
{if isset($refundReqBookings) && $refundReqBookings}
|
||||
<tr id="total_order">
|
||||
<td class="text-right"><strong>* {l s='Refunded Amount'}</strong></td>
|
||||
<td class="amount text-right nowrap">
|
||||
<strong>{displayPrice price=$refundedAmount currency=$currency->id}</strong>
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{if $order->total_paid_tax_incl > $order->total_paid_real}
|
||||
<tr>
|
||||
<td class="text-right"><strong>{l s='Due Amount'}</strong></td>
|
||||
<td class="amount text-right nowrap">
|
||||
<strong>
|
||||
{displayPrice price=($order_adv_dtl['total_order_amount'] - $order_adv_dtl['total_paid_amount']) currency=$currency->id}
|
||||
{displayPrice currency=$order->id_currency price=($order->total_paid_tax_incl - $order->total_paid_real)}
|
||||
</strong>
|
||||
</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>
|
||||
<td class="amount text-right nowrap" ><strong>{displayPrice price=($order->total_paid_tax_incl-$order->total_paid_tax_excl) currency=$currency->id}</strong></td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{assign var=order_total_price value=$order->total_paid_tax_incl}
|
||||
|
||||
<tr id="total_order">
|
||||
<td class="text-right"><strong>{l s='Final Order Total'}</strong></td>
|
||||
<td class="amount text-right nowrap">
|
||||
<strong>{displayPrice price=$order_total_price currency=$currency->id}</strong>
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: none;" class="standard_refund_fields form-horizontal panel">
|
||||
<div class="form-group">
|
||||
{if ($order->hasBeenDelivered() && Configuration::get('PS_ORDER_RETURN'))}
|
||||
<p class="checkbox">
|
||||
<label for="reinjectQuantities">
|
||||
<input type="checkbox" id="reinjectQuantities" name="reinjectQuantities" />
|
||||
{l s='Re-stock products'}
|
||||
</label>
|
||||
</p>
|
||||
{/if}
|
||||
{if ((!$order->hasBeenDelivered() && $order->hasBeenPaid()) || ($order->hasBeenDelivered() && Configuration::get('PS_ORDER_RETURN')))}
|
||||
<p class="checkbox">
|
||||
<label for="generateCreditSlip">
|
||||
<input type="checkbox" id="generateCreditSlip" name="generateCreditSlip" onclick="toggleShippingCost()" />
|
||||
{l s='Generate a credit slip'}
|
||||
</label>
|
||||
</p>
|
||||
<p class="checkbox">
|
||||
<label for="generateDiscount">
|
||||
<input type="checkbox" id="generateDiscount" name="generateDiscount" onclick="toggleShippingCost()" />
|
||||
{l s='Generate a voucher'}
|
||||
</label>
|
||||
</p>
|
||||
<p class="checkbox" id="spanShippingBack" style="display:none;">
|
||||
<label for="shippingBack">
|
||||
<input type="checkbox" id="shippingBack" name="shippingBack" />
|
||||
{l s='Repay shipping costs'}
|
||||
</label>
|
||||
</p>
|
||||
{if $order->total_discounts_tax_excl > 0 || $order->total_discounts_tax_incl > 0}
|
||||
<br/><p>{l s='This order has been partially paid by voucher. Choose the amount you want to refund:'}</p>
|
||||
<p class="radio">
|
||||
<label id="lab_refund_total_1" for="refund_total_1">
|
||||
<input type="radio" value="0" name="refund_total_voucher_off" id="refund_total_1" checked="checked" />
|
||||
{l s='Include amount of initial voucher: '}
|
||||
</label>
|
||||
</p>
|
||||
<p class="radio">
|
||||
<label id="lab_refund_total_2" for="refund_total_2">
|
||||
<input type="radio" value="1" name="refund_total_voucher_off" id="refund_total_2"/>
|
||||
{l s='Exclude amount of initial voucher: '}
|
||||
</label>
|
||||
</p>
|
||||
<div class="nowrap radio-inline">
|
||||
<label id="lab_refund_total_3" class="pull-left" for="refund_total_3">
|
||||
{l s='Amount of your choice: '}
|
||||
<input type="radio" value="2" name="refund_total_voucher_off" id="refund_total_3"/>
|
||||
</label>
|
||||
<div class="input-group col-lg-1 pull-left">
|
||||
<div class="input-group-addon">
|
||||
{$currency->prefix}
|
||||
{$currency->suffix}
|
||||
</div>
|
||||
<input type="text" class="input fixed-width-md" name="refund_total_voucher_choose" value="0"/>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
{if (!$order->hasBeenDelivered() || ($order->hasBeenDelivered() && Configuration::get('PS_ORDER_RETURN')))}
|
||||
<div class="row">
|
||||
<input type="submit" name="cancelProduct" value="{if $order->hasBeenDelivered()}{l s='Return products'}{elseif $order->hasBeenPaid()}{l s='Refund products'}{else}{l s='Cancel products'}{/if}" class="btn btn-default" />
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div style="display:none;" class="partial_refund_fields">
|
||||
<p class="checkbox">
|
||||
<label for="reinjectQuantitiesRefund">
|
||||
<input type="checkbox" id="reinjectQuantitiesRefund" name="reinjectQuantities" />
|
||||
{l s='Re-stock products'}
|
||||
</label>
|
||||
</p>
|
||||
<p class="checkbox">
|
||||
<label for="generateDiscountRefund">
|
||||
<input type="checkbox" id="generateDiscountRefund" name="generateDiscountRefund" onclick="toggleShippingCost()" />
|
||||
{l s='Generate a voucher'}
|
||||
</label>
|
||||
</p>
|
||||
{if $order->total_discounts_tax_excl > 0 || $order->total_discounts_tax_incl > 0}
|
||||
<p>{l s='This order has been partially paid by voucher. Choose the amount you want to refund:'}</p>
|
||||
<p class="radio">
|
||||
<label id="lab_refund_1" for="refund_1">
|
||||
<input type="radio" value="0" name="refund_voucher_off" id="refund_1" checked="checked" />
|
||||
{l s='Product(s) price: '}
|
||||
</label>
|
||||
</p>
|
||||
<p class="radio">
|
||||
<label id="lab_refund_2" for="refund_2">
|
||||
<input type="radio" value="1" name="refund_voucher_off" id="refund_2"/>
|
||||
{l s='Product(s) price, excluding amount of initial voucher: '}
|
||||
</label>
|
||||
</p>
|
||||
<div class="nowrap radio-inline">
|
||||
<label id="lab_refund_3" class="pull-left" for="refund_3">
|
||||
{l s='Amount of your choice: '}
|
||||
<input type="radio" value="2" name="refund_voucher_off" id="refund_3"/>
|
||||
</label>
|
||||
<div class="input-group col-lg-1 pull-left">
|
||||
<div class="input-group-addon">
|
||||
{$currency->prefix}
|
||||
{$currency->suffix}
|
||||
</div>
|
||||
<input type="text" class="input fixed-width-md" name="refund_voucher_choose" value="0"/>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<br/>
|
||||
<button type="submit" name="partialRefund" class="btn btn-default">
|
||||
<i class="icon-check"></i> {l s='Partial refund'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -1462,8 +1292,8 @@
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active"><a href="#reallocate_room_tab" aria-controls="reallocate" role="tab" data-toggle="tab">{l s='Room Reallocation' mod='hotelreservationsystem'}</a></li>
|
||||
<li role="presentation"><a href="#swap_room_tab" aria-controls="swap" role="tab" data-toggle="tab">{l s='Swap Room' mod='hotelreservationsystem'}</a></li>
|
||||
<li role="presentation" class="active"><a href="#reallocate_room_tab" aria-controls="reallocate" role="tab" data-toggle="tab">{l s='Room Reallocation'}</a></li>
|
||||
<li role="presentation"><a href="#swap_room_tab" aria-controls="swap" role="tab" data-toggle="tab">{l s='Swap Room'}</a></li>
|
||||
</ul>
|
||||
<div class="tab-content panel active">
|
||||
<div role="tabpanel" class="tab-pane active" id="reallocate_room_tab">
|
||||
@@ -1474,23 +1304,23 @@
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="curr_room_num" class="control-label model-label">{l s='Current Room Number:' mod='hotelreservationsystem'}</label>
|
||||
<label for="curr_room_num" class="control-label model-label">{l s='Current Room Number:'}</label>
|
||||
<input type="text" class="form-control modal_curr_room_num" name="modal_curr_room_num" readonly="true">
|
||||
<input type="hidden" class="form-control modal_date_from" name="modal_date_from">
|
||||
<input type="hidden" class="form-control modal_date_to" name="modal_date_to">
|
||||
<input type="hidden" class="form-control modal_id_room" name="modal_id_room">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="realloc_avail_rooms" class="control-label model-label">{l s='Available Rooms To Reallocate:' mod='hotelreservationsystem'}</label>
|
||||
<label for="realloc_avail_rooms" class="control-label model-label">{l s='Available Rooms To Reallocate:'}</label>
|
||||
<div class="realloc_avail_rooms_container" style="width: 195px;">
|
||||
<select class="form-control" name="realloc_avail_rooms" id="realloc_avail_rooms">
|
||||
<option value="0" selected="selected">{l s='Select Rooms' mod='hotelreservationsystem'}</option>
|
||||
<option value="0" selected="selected">{l s='Select Rooms'}</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="error_text" id="realloc_sel_rm_err_p"></p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label style="text-decoration:underline;margin-top:5px;" for="message-text" class="col-sm-12 control-label model-label"><i class="icon-info-circle"></i> {l s='Currently Alloted Customer Information:' mod='hotelreservationsystem'}</label>
|
||||
<label style="text-decoration:underline;margin-top:5px;" for="message-text" class="col-sm-12 control-label model-label"><i class="icon-info-circle"></i> {l s='Currently Alloted Customer Information:'}</label>
|
||||
<dl class="well list-detail">
|
||||
<dt>{l s='Name'}</dt>
|
||||
<dd class="cust_name"></dd><br>
|
||||
@@ -1513,7 +1343,7 @@
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="swap_curr_room_num" class="control-label model-label">{l s='Current Room Number:' mod='hotelreservationsystem'}</label>
|
||||
<label for="swap_curr_room_num" class="control-label model-label">{l s='Current Room Number:'}</label>
|
||||
<input type="text" class="form-control modal_curr_room_num" name="modal_curr_room_num" readonly="true">
|
||||
<input type="hidden" class="form-control modal_date_from" name="modal_date_from">
|
||||
<input type="hidden" class="form-control modal_date_to" name="modal_date_to">
|
||||
@@ -1521,12 +1351,12 @@
|
||||
<input type="hidden" class="form-control modal_id_order" name="modal_id_order">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="swap_avail_rooms" class="control-label model-label">{l s='Available Rooms To Swap:' mod='hotelreservationsystem'}</label>
|
||||
<label for="swap_avail_rooms" class="control-label model-label">{l s='Available Rooms To Swap:'}</label>
|
||||
<div class="swap_avail_rooms_container"></div>
|
||||
<p class="error_text" id="swap_sel_rm_err_p"></p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label style="text-decoration:underline;margin-top:5px;" for="message-text" class="col-sm-12 control-label model-label"><i class="icon-info-circle"></i> {l s='Currently Alloted Customer Information:' mod='hotelreservationsystem'}</label>
|
||||
<label style="text-decoration:underline;margin-top:5px;" for="message-text" class="col-sm-12 control-label model-label"><i class="icon-info-circle"></i> {l s='Currently Alloted Customer Information:'}</label>
|
||||
<dl class="well list-detail">
|
||||
<dt>{l s='Name'}</dt>
|
||||
<dd class="cust_name"></dd><br>
|
||||
@@ -1546,48 +1376,89 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{* MOdal for extra demands *}
|
||||
<div class="modal fade" id="rooms_type_extra_demands" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content" id="room_type_demands_desc">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal" tabindex="-1" role="dialog" id="rooms_type_extra_demands">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content" id="room_extra_demand_content">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{strip}
|
||||
{addJsDefL name=no_rm_avail_txt}{l s='No rooms available.' js=1 mod='hotelreservationsystem'}{/addJsDefL}
|
||||
{addJsDefL name=slct_rm_err}{l s='Please select a room first.' js=1 mod='hotelreservationsystem'}{/addJsDefL}
|
||||
{/strip}
|
||||
|
||||
{* Apply css for the page *}
|
||||
<style>
|
||||
.error_text {
|
||||
color:red;
|
||||
}
|
||||
color:red;}
|
||||
.model-label {
|
||||
font-weight:bold!important;
|
||||
}
|
||||
font-weight:bold!important;}
|
||||
.room_type_old_price {
|
||||
text-decoration: line-through;
|
||||
color:#979797;
|
||||
font-size:12px;
|
||||
}
|
||||
#rooms_type_extra_demands .demand_header {
|
||||
font-size:16px;
|
||||
padding-bottom: 15px;
|
||||
border-bottom: 1px solid rgb(0, 0, 0, 0.1);
|
||||
margin-bottom: 15px;}
|
||||
#rooms_type_extra_demands .demand_detail p {
|
||||
font-size:14px;
|
||||
margin-bottom: 15px;}
|
||||
#rooms_type_extra_demands .rooms_extra_demands_head {
|
||||
margin-bottom: 18px;}
|
||||
#rooms_type_extra_demands #room_type_demands_desc {
|
||||
padding: 15px;}
|
||||
font-size:12px;}
|
||||
.wk-input-date {
|
||||
cursor: text!important;
|
||||
background-color: #F5F8F9!important;}
|
||||
#room_status_info_wrapper .margin-bottom-5 {
|
||||
margin-bottom: 5px!important;}
|
||||
#room_status_info_wrapper .room_status_date {
|
||||
display: none;}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
{strip}
|
||||
{addJsDefL name=no_rm_avail_txt}{l s='No rooms available.' js=1}{/addJsDefL}
|
||||
{addJsDefL name=slct_rm_err}{l s='Please select a room first.' js=1}{/addJsDefL}
|
||||
{addJsDefL name=txtExtraDemandSucc}{l s='Updated Successfully' js=1}{/addJsDefL}
|
||||
{addJsDefL name=atleastSelectTxt}{l s='Select at least one facility to update.' js=1}{/addJsDefL}
|
||||
|
||||
{addJsDefL name=txtSomeErr}{l s='Some error occurred. Please try again.' js=1}{/addJsDefL}
|
||||
{addJsDefL name=txtDeleteSucc}{l s='Deleted successfully' js=1}{/addJsDefL}
|
||||
{addJsDefL name=txtInvalidDemandVal}{l s='Invalid demand value found' js=1}{/addJsDefL}
|
||||
{/strip}
|
||||
|
||||
{* Apply javascript for the page *}
|
||||
<script>
|
||||
var geocoder = new google.maps.Geocoder();
|
||||
var delivery_map, invoice_map;
|
||||
|
||||
$(document).ready(function() {
|
||||
{* check id reason is inserted before submitting the refund *}
|
||||
$('#initiateRefund').on('click', function(e) {
|
||||
if ($.trim($('.cancellation_reason').val()) == '') {
|
||||
$('.cancellation_reason').focus().css('border', '1px solid red');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
{* toggle date input of check-in checkout dates as per status selected *}
|
||||
$('.booking_order_status').on('change', function() {
|
||||
var status = $(this).val();
|
||||
if (status == '2' || status == '3') {
|
||||
$(this).closest('.room_status_info_form').find('.room_status_date').show();
|
||||
} else {
|
||||
$(this).closest('.room_status_info_form').find('.room_status_date').hide();
|
||||
}
|
||||
});
|
||||
|
||||
{* open date picker for the date input of check-in checkout dates *}
|
||||
$(document).on('focus', '.room_status_date', function() {
|
||||
var dateFrom = $(this).closest('.room_status_info_form').find('[name="date_from"]').val();
|
||||
dateFrom = dateFrom.split("-");
|
||||
minDate = new Date($.datepicker.formatDate('yy-mm-dd', new Date(dateFrom[0], dateFrom[1] - 1, dateFrom[2])));
|
||||
|
||||
var dateTo = $(this).closest('.room_status_info_form').find('[name="date_to"]').val();
|
||||
dateTo = dateTo.split("-");
|
||||
maxDate = new Date($.datepicker.formatDate('yy-mm-dd', new Date(dateTo[0], dateTo[1] - 1, dateTo[2])));
|
||||
|
||||
$(this).datepicker({
|
||||
dateFormat: 'dd-mm-yy',
|
||||
minDate: minDate,
|
||||
maxDate: maxDate,
|
||||
dayNamesMin: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
|
||||
});
|
||||
});
|
||||
|
||||
{* open fancybox for extra demands *}
|
||||
$('.open_room_extra_demands').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
var idProduct = $(this).attr('id_product');
|
||||
@@ -1595,6 +1466,12 @@
|
||||
var idRoom = $(this).attr('id_room');
|
||||
var dateFrom = $(this).attr('date_from');
|
||||
var dateTo = $(this).attr('date_to');
|
||||
var idHtlBooking = $(this).attr('id_htl_booking');
|
||||
var orderEdit = 0;
|
||||
if( $(this).closest('.product-line-row').find(".submitProductChange").is(":visible") == true ) {
|
||||
orderEdit = 1;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
headers: {
|
||||
@@ -1609,17 +1486,126 @@
|
||||
id_order: idOrder,
|
||||
date_from: dateFrom,
|
||||
date_to: dateTo,
|
||||
orderEdit: orderEdit,
|
||||
action: 'getRoomTypeBookingDemands',
|
||||
ajax: true
|
||||
},
|
||||
success: function(result) {
|
||||
$('#room_type_demands_desc').html('');
|
||||
$('#room_type_demands_desc').append(result);
|
||||
$('#room_extra_demand_content').html('');
|
||||
$('#room_extra_demand_content').append(result);
|
||||
|
||||
$('#room_extra_demand_content #id_htl_booking').val(idHtlBooking);
|
||||
|
||||
$('#rooms_type_extra_demands').modal('show');
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
{* when choose to add new facilities while additional facilities edit *}
|
||||
$(document).on('click', '#room_extra_demand_content #btn_new_room_facility', function() {
|
||||
$('#rooms_extra_demands .room_demands_container').show();
|
||||
$('#room_extra_demand_content #save_room_facilities').show();
|
||||
$('#room_extra_demand_content #back_to_facilities_btn').show();
|
||||
$('#rooms_extra_demands .room_ordered_demands').hide();
|
||||
$('#room_extra_demand_content #btn_new_room_facility').hide();
|
||||
});
|
||||
{* click on back button on created facilities while additional facilities edit *}
|
||||
$(document).on('click', '#room_extra_demand_content #back_to_facilities_btn', function() {
|
||||
$('#rooms_extra_demands .room_ordered_demands').show();
|
||||
$('#room_extra_demand_content #btn_new_room_facility').show();
|
||||
$('#rooms_extra_demands .room_demands_container').hide();
|
||||
$('#room_extra_demand_content #save_room_facilities').hide();
|
||||
$('#room_extra_demand_content #back_to_facilities_btn').hide();
|
||||
});
|
||||
|
||||
{* // save room extra demand to the order *}
|
||||
$(document).on('click', '#save_room_facilities', function(e) {
|
||||
e.preventDefault();
|
||||
var idHtlBooking = $(this).closest('#room_extra_demand_content').find('#id_htl_booking').val();
|
||||
if (idHtlBooking) {
|
||||
var roomDemands = [];
|
||||
// get the selected extra demands by customer
|
||||
$(this).closest('#room_extra_demand_content').find('input:checkbox.id_room_type_demand:checked').each(function () {
|
||||
roomDemands.push({
|
||||
'id_global_demand':$(this).val(),
|
||||
'id_option': $(this).closest('.room_demand_block').find('.id_option').val()
|
||||
});
|
||||
});
|
||||
|
||||
if (roomDemands.length) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
headers: {
|
||||
"cache-control": "no-cache"
|
||||
},
|
||||
url: "{$link->getAdminLink('AdminOrders')|addslashes}",
|
||||
dataType: 'JSON',
|
||||
cache: false,
|
||||
data: {
|
||||
id_htl_booking: idHtlBooking,
|
||||
room_demands: JSON.stringify(roomDemands),
|
||||
action: 'EditRoomExtraDemands',
|
||||
ajax: true
|
||||
},
|
||||
success: function(result) {
|
||||
if (result == 1) {
|
||||
showSuccessMessage(txtExtraDemandSucc);
|
||||
$('#rooms_type_extra_demands').modal('hide');
|
||||
} else {
|
||||
showErrorMessage(txtSomeErr);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
showErrorMessage(atleastSelectTxt);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
{* Delete ordered room booking demand *}
|
||||
$(document).on('click', '.del-order-room-demand', function(e) {
|
||||
e.preventDefault();
|
||||
if (confirm(txt_confirm)) {
|
||||
var idBookingDemand = $(this).attr('id_booking_demand');
|
||||
$currentItem = $(this);
|
||||
if (idBookingDemand) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
headers: {
|
||||
"cache-control": "no-cache"
|
||||
},
|
||||
url: "{$link->getAdminLink('AdminOrders')|addslashes}",
|
||||
dataType: 'JSON',
|
||||
cache: false,
|
||||
data: {
|
||||
id_booking_demand: idBookingDemand,
|
||||
action: 'DeleteRoomExtraDemand',
|
||||
ajax: true
|
||||
},
|
||||
success: function(result) {
|
||||
if (result == 1) {
|
||||
$currentItem.closest('tr').remove();
|
||||
showSuccessMessage(txtDeleteSucc);
|
||||
} else {
|
||||
showErrorMessage(txtSomeErr);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
showErrorMessage(txtInvalidDemandVal);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// change advance option of extra demand
|
||||
$(document).on('change', '.demand_adv_option_block .id_option', function(e) {
|
||||
var option_selected = $(this).find('option:selected');
|
||||
var extra_demand_price = option_selected.attr("optionPrice")
|
||||
extra_demand_price = parseFloat(extra_demand_price);
|
||||
extra_demand_price = formatCurrency(extra_demand_price, currency_format, currency_sign, currency_blank);
|
||||
$(this).closest('.room_demand_block').find('.extra_demand_option_price').text(extra_demand_price);
|
||||
});
|
||||
|
||||
$('#mySwappigModal').on('hidden.bs.modal', function (e)
|
||||
{
|
||||
$(".modal_id_order").val('');
|
||||
|
||||
@@ -30,24 +30,7 @@
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="num_adults">
|
||||
{l s='Adults'}
|
||||
</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="num_adults" type="text" name="num_adults" class="form-control" {if isset($htl_room_type)}value="{$htl_room_type['adult']}"{/if}>
|
||||
<input type="hidden" id="checkConfSubmit" value="0" name="checkConfSubmit">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="num_child">
|
||||
{l s='Children'}
|
||||
</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="num_child" type="text" name="num_child" class="form-control" {if isset($htl_room_type)}value="{$htl_room_type['children']}"{/if}>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="checkConfSubmit" value="0" name="checkConfSubmit">
|
||||
|
||||
<div class="from-group table-responsive-row clearfix">
|
||||
<table class="table hotel-room">
|
||||
|
||||
@@ -41,6 +41,10 @@
|
||||
<div class="col-lg-9">
|
||||
{$image_uploader}
|
||||
</div>
|
||||
<div class="col-lg-9 col-lg-offset-3">
|
||||
<div class="help-block">{l s='Please upload a square image (Recommended resolution 800 x 800px)'}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
@@ -111,9 +115,9 @@
|
||||
<table id="lineType" style="display:none;">
|
||||
<tr id="image_id">
|
||||
<td>
|
||||
<a href="{$smarty.const._THEME_PROD_DIR_}image_path.jpg" class="fancybox">
|
||||
<a href="{$link->getMediaLink("`$smarty.const._THEME_PROD_DIR_`image_path.jpg")}" class="fancybox"> {* by webkul to get media link *}
|
||||
<img
|
||||
src="{$smarty.const._THEME_PROD_DIR_}{$iso_lang}-default-{$imageType}.jpg"
|
||||
src="{$link->getMediaLink("`$smarty.const._THEME_PROD_DIR_`$iso_lang-default-`$imageType`.jpg")}"
|
||||
alt="legend"
|
||||
title="legend"
|
||||
class="img-thumbnail" />
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
{*
|
||||
* 2010-2018 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 2010-2018 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
{if isset($product->id)}
|
||||
<input type="hidden" name="occupancy_loaded" value="1">
|
||||
<div id="product-occupancy" class="panel product-tab">
|
||||
<input type="hidden" name="submitted_tabs[]" value="Occupancy" />
|
||||
<h3 class="tab"> <i class="icon-users"></i> {l s='Occupancy'}</h3>
|
||||
|
||||
<div class="alert alert-info">
|
||||
{l s='Set the occupancy of this room type. Enter how much adults and children this room type can accomodate.'}
|
||||
<br /><br />
|
||||
<b>{l s='Note'} : {l s='These occupancy settings will not affect "ROOM TYPE ADDITIONAL FACILITIES" any way. It will work separately.'}</b>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="base_adults">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s=''}">
|
||||
{l s='Adults'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="base_adults" type="text" name="base_adults" class="form-control" {if isset($roomTypeInfo)}value="{$roomTypeInfo['adult']|escape:'htmlall':'UTF-8'}"{/if}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="base_children">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s=''}">
|
||||
{l s='Children'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="base_children" type="text" name="base_children" class="form-control" {if isset($roomTypeInfo)}value="{$roomTypeInfo['children']|escape:'htmlall':'UTF-8'}"{/if}>
|
||||
</div>
|
||||
</div>
|
||||
<input id="is_occupancy_submit" type="hidden" name="is_occupancy_submit" class="form-control" value="0">
|
||||
|
||||
<div class="panel-footer">
|
||||
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}{if isset($smarty.request.page) && $smarty.request.page > 1}&submitFilterproduct={$smarty.request.page|intval}{/if}" class="btn btn-default">
|
||||
<i class="process-icon-cancel"></i>
|
||||
{l s='Cancel'}
|
||||
</a>
|
||||
<button type="submit" name="submitAddproduct" class="btn btn-default pull-right checkOccupancySubmit" disabled="disabled">
|
||||
<i class="process-icon-loading"></i>
|
||||
{l s='Save'}
|
||||
</button>
|
||||
<button type="submit" name="submitAddproductAndStay" class="btn btn-default pull-right checkOccupancySubmit" disabled="disabled">
|
||||
<i class="process-icon-loading"></i>
|
||||
{l s='Save and stay'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".checkOccupancySubmit").on("click", function() {
|
||||
$("#is_occupancy_submit").val(1);
|
||||
return true;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -338,10 +338,17 @@ $(document).ready(function () {
|
||||
|
||||
<div class="row" id="type_amount">
|
||||
<label class="control-label col-sm-2">{l s='Amount'}</label>
|
||||
<div class="col-sm-4 col-lg-3">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
|
||||
<input name="adv_pay_amount" type="text" value="{if isset($adv_pay_dtl) && ($adv_pay_dtl['payment_type'] == 2)}{{toolsConvertPrice price=$adv_pay_dtl['value']}|string_format:'%.6f'}{/if}"/>
|
||||
<div class="col-sm-9">
|
||||
<div class="row">
|
||||
<div class="col-sm-4 col-lg-3">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
|
||||
<input name="adv_pay_amount" type="text" value="{if isset($adv_pay_dtl) && ($adv_pay_dtl['payment_type'] == 2)}{{toolsConvertPrice price=$adv_pay_dtl['value']}|string_format:'%.6f'}{/if}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="help-block">
|
||||
{l s='If final price of the room type is less than advance payment amount for the customer then customer will pay the final(lesser) price of the room type.'}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
{block name="label"}
|
||||
{if $input.type == "select_template"}
|
||||
<div id="tpl" style="display:{if isset($fields_value.send_email) && $fields_value.send_email}block{else}none{/if}">
|
||||
<div id="tpl_{$input.template_attr}" style="display:{if $input.is_customer_template}{if isset($fields_value.show_customer_template) && $fields_value.show_customer_template}block{else}none{/if}{else}{if isset($fields_value.show_admin_template) && $fields_value.show_admin_template}block{else}none{/if}{/if}">
|
||||
{/if}
|
||||
{$smarty.block.parent}
|
||||
{/block}
|
||||
@@ -40,10 +40,10 @@
|
||||
<div class="translatable-field lang-{$language.id_lang}" {if $language.id_lang != $defaultFormLanguage}style="display:none"{/if}>
|
||||
<div class="col-lg-8">
|
||||
<select name="{$input.name}_{$language.id_lang}"
|
||||
id="{$input.name}_select_{$language.id_lang}"
|
||||
{if isset($input.multiple)}multiple="multiple" {/if}
|
||||
{if isset($input.size)}size="{$input.size}"{/if}
|
||||
{if isset($input.onchange)}onchange="{$input.onchange}"{/if}>
|
||||
id="{$input.name}_select_{$language.id_lang}"
|
||||
{if isset($input.multiple)}multiple="multiple" {/if}
|
||||
{if isset($input.size)}size="{$input.size}"{/if}
|
||||
{if isset($input.onchange)}onchange="{$input.onchange}"{/if}>
|
||||
{if isset($input.options.query[$language.iso_code]) && $input.options.query[$language.iso_code]}
|
||||
{foreach $input.options.query[$language.iso_code] AS $option}
|
||||
<option value="{$option[$input.options.id]}"
|
||||
@@ -72,7 +72,7 @@
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
<button type="button" class="btn btn-default" onclick="viewTemplates('#template_select_{$language.id_lang}', '{$language.iso_code}/', '.html');">
|
||||
<button type="button" class="btn btn-default" onclick="viewTemplates('#{$input.name}_select_{$language.id_lang}', '{$language.iso_code}/', '.html');">
|
||||
<i class="icon-eye-open"></i>
|
||||
{l s='Preview'}
|
||||
</button>
|
||||
@@ -110,8 +110,19 @@
|
||||
|
||||
{block name="script"}
|
||||
$(document).ready(function() {
|
||||
$('#send_email_on').click(function() {
|
||||
$('#tpl').slideToggle();
|
||||
$('#send_email_on, #send_email_to_customer_on').click(function() {
|
||||
$('#tpl_'+$(this).attr('class')).slideToggle();
|
||||
});
|
||||
|
||||
$('#send_email_to_superadmin_on, #send_email_to_employee_on, #send_email_to_hotelier_on').click(function() {
|
||||
if ($('#send_email_to_superadmin_on').is(":checked")
|
||||
|| $('#send_email_to_employee_on').is(":checked")
|
||||
|| $('#send_email_to_hotelier_on').is(":checked")
|
||||
) {
|
||||
$('#tpl_' + $(this).attr('class')).show(500);
|
||||
} else {
|
||||
$('#tpl_' + $(this).attr('class')).hide(500);
|
||||
}
|
||||
});
|
||||
});
|
||||
{/block}
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
{l s='Forum'}
|
||||
</a>
|
||||
/
|
||||
<a href="https://store.webkul.com/Qloapps.html" class="footer_link _blank">
|
||||
<a href="https://qloapps.com/addons/" class="footer_link _blank">
|
||||
<i class="icon-puzzle-piece"></i>
|
||||
{l s='Addons'}
|
||||
</a>
|
||||
|
||||
@@ -297,7 +297,7 @@
|
||||
{/if}
|
||||
<ul id="header_employee_box">
|
||||
<li class="hidden-sm hidden-xs">
|
||||
<a target="_blank" href="https://store.webkul.com/Qloapps.html" class="toolbar_btn" title="{l s='Explore Qloapps Addons'}">
|
||||
<a target="_blank" href="https://qloapps.com/addons/" class="toolbar_btn" title="{l s='Explore Qloapps Addons'}">
|
||||
<i class="icon-chain-broken"></i>
|
||||
{l s='Explore Qloapps Addons'}
|
||||
</a>
|
||||
|
||||
@@ -69,7 +69,7 @@ class AttachmentCore extends ObjectModel
|
||||
|
||||
public function delete()
|
||||
{
|
||||
@unlink(_PS_DOWNLOAD_DIR_.$this->file);
|
||||
Tools::deleteFile(_PS_DOWNLOAD_DIR_.$this->file);
|
||||
|
||||
$products = Db::getInstance()->executeS('
|
||||
SELECT id_product
|
||||
|
||||
360
classes/Cart.php
@@ -83,6 +83,11 @@ class CartCore extends ObjectModel
|
||||
/** @var bool Allow to seperate order in multiple package in order to recieve as soon as possible the available products */
|
||||
public $allow_seperated_package = false;
|
||||
|
||||
/**
|
||||
* @var int is_advance_payment used to determine if this cart is selected for advance payment or full payment
|
||||
*/
|
||||
public $is_advance_payment;
|
||||
|
||||
protected static $_nbProducts = array();
|
||||
protected static $_isVirtualCart = array();
|
||||
|
||||
@@ -118,28 +123,43 @@ class CartCore extends ObjectModel
|
||||
'mobile_theme' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'delivery_option' => array('type' => self::TYPE_STRING),
|
||||
'secure_key' => array('type' => self::TYPE_STRING, 'size' => 32),
|
||||
'allow_seperated_package' =>array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'allow_seperated_package' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'is_advance_payment' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'default' => 0),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
),
|
||||
);
|
||||
|
||||
protected $webserviceParameters = array(
|
||||
'objectMethods' => array(
|
||||
'add' => 'addWs',
|
||||
'update' => 'updateWs'
|
||||
),
|
||||
'fields' => array(
|
||||
'id_address_delivery' => array('xlink_resource' => 'addresses'),
|
||||
'id_address_invoice' => array('xlink_resource' => 'addresses'),
|
||||
'id_address' => array(
|
||||
'xlink_resource' => 'addresses',
|
||||
'getter' => 'getWsIdAddress',
|
||||
'setter' => 'setWsIdAddress',
|
||||
),
|
||||
'id_currency' => array('xlink_resource' => 'currencies'),
|
||||
'id_customer' => array('xlink_resource' => 'customers'),
|
||||
'id_guest' => array('xlink_resource' => 'guests'),
|
||||
'id_lang' => array('xlink_resource' => 'languages'),
|
||||
),
|
||||
|
||||
'associations' => array(
|
||||
'cart_rows' => array('resource' => 'cart_row', 'virtual_entity' => true, 'fields' => array(
|
||||
'id_product' => array('required' => true, 'xlink_resource' => 'products'),
|
||||
'id_product_attribute' => array('required' => true, 'xlink_resource' => 'combinations'),
|
||||
'id_address_delivery' => array('required' => true, 'xlink_resource' => 'addresses'),
|
||||
'quantity' => array('required' => true),
|
||||
)
|
||||
// 'cart_rows' => array('resource' => 'cart_row', 'virtual_entity' => true, 'fields' => array(
|
||||
// 'id_product' => array('required' => true, 'xlink_resource' => 'products'),
|
||||
// 'id_product_attribute' => array('required' => true, 'xlink_resource' => 'combinations'),
|
||||
// 'id_address_delivery' => array('required' => true, 'xlink_resource' => 'addresses'),
|
||||
// 'quantity' => array('required' => true),
|
||||
// )
|
||||
// ),
|
||||
|
||||
'cart_bookings' => array(
|
||||
'setter' => false,
|
||||
'resource' => 'booking',
|
||||
'fields' => array('id' => array('required' => true))
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -152,6 +172,8 @@ class CartCore extends ObjectModel
|
||||
const ONLY_WRAPPING = 6;
|
||||
const ONLY_PRODUCTS_WITHOUT_SHIPPING = 7;
|
||||
const ONLY_PHYSICAL_PRODUCTS_WITHOUT_SHIPPING = 8;
|
||||
const ADVANCE_PAYMENT = 9;
|
||||
const ADVANCE_PAYMENT_ONLY_PRODUCTS = 10;
|
||||
|
||||
public function __construct($id = null, $id_lang = null)
|
||||
{
|
||||
@@ -264,8 +286,8 @@ class CartCore extends ObjectModel
|
||||
);
|
||||
|
||||
foreach ($uploaded_files as $must_unlink) {
|
||||
unlink(_PS_UPLOAD_DIR_.$must_unlink['value'].'_small');
|
||||
unlink(_PS_UPLOAD_DIR_.$must_unlink['value']);
|
||||
Tools::deleteFile(_PS_UPLOAD_DIR_.$must_unlink['value'].'_small'); //by webkul use deleteFile insted of unlink
|
||||
Tools::deleteFile(_PS_UPLOAD_DIR_.$must_unlink['value']); //by webkul use deleteFile insted of unlink
|
||||
}
|
||||
|
||||
Db::getInstance()->execute('
|
||||
@@ -1209,8 +1231,8 @@ class CartCore extends ObjectModel
|
||||
AND type = '.(int)$customization['type'].'
|
||||
AND `index` = '.(int)$customization['index']);
|
||||
if ($type == Product::CUSTOMIZE_FILE) {
|
||||
@unlink(_PS_UPLOAD_DIR_.$customization['value']);
|
||||
@unlink(_PS_UPLOAD_DIR_.$customization['value'].'_small');
|
||||
Tools::deleteFile(_PS_UPLOAD_DIR_.$customization['value']); //by webkul use deleteFile insted of unlink
|
||||
Tools::deleteFile(_PS_UPLOAD_DIR_.$customization['value'].'_small'); //by webkul use deleteFile insted of unlink
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1390,7 +1412,10 @@ class CartCore extends ObjectModel
|
||||
|
||||
// Delete customization picture if necessary
|
||||
if (isset($cust_data['type']) && $cust_data['type'] == 0) {
|
||||
$result &= (@unlink(_PS_UPLOAD_DIR_.$cust_data['value']) && @unlink(_PS_UPLOAD_DIR_.$cust_data['value'].'_small'));
|
||||
$result &= (
|
||||
Tools::deleteFile(_PS_UPLOAD_DIR_.$cust_data['value']) && //by webkul use deleteFile insted of unlink
|
||||
Tools::deleteFile(_PS_UPLOAD_DIR_.$cust_data['value'].'_small') //by webkul use deleteFile insted of unlink
|
||||
);
|
||||
}
|
||||
|
||||
$result &= Db::getInstance()->execute(
|
||||
@@ -1484,6 +1509,8 @@ class CartCore extends ObjectModel
|
||||
Cart::ONLY_WRAPPING,
|
||||
Cart::ONLY_PRODUCTS_WITHOUT_SHIPPING,
|
||||
Cart::ONLY_PHYSICAL_PRODUCTS_WITHOUT_SHIPPING,
|
||||
Cart::ADVANCE_PAYMENT,
|
||||
Cart::ADVANCE_PAYMENT_ONLY_PRODUCTS,
|
||||
);
|
||||
|
||||
// Define virtual context to prevent case where the cart is not the in the global context
|
||||
@@ -1551,7 +1578,7 @@ class CartCore extends ObjectModel
|
||||
|
||||
$products_total = array();
|
||||
$ecotax_total = 0;
|
||||
|
||||
$totalDemandsPrice = 0;
|
||||
$objCartBookingData = new HotelCartBookingData();
|
||||
foreach ($products as $product) {
|
||||
// products refer to the cart details
|
||||
@@ -1616,40 +1643,58 @@ class CartCore extends ObjectModel
|
||||
$totalPriceByProduct = 0;
|
||||
$priceDisplay = Group::getPriceDisplayMethod(Group::getCurrent()->id);
|
||||
foreach ($roomTypesByIdProduct as $key => $cartRoomInfo) {
|
||||
$roomTotalPrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice($cartRoomInfo['id_product'], $cartRoomInfo['date_from'], $cartRoomInfo['date_to']);
|
||||
// get the real price of the room type
|
||||
$roomTotalPrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
|
||||
$cartRoomInfo['id_product'],
|
||||
$cartRoomInfo['date_from'],
|
||||
$cartRoomInfo['date_to']
|
||||
);
|
||||
if ($with_taxes) {
|
||||
$totalPriceByProduct += $roomTotalPrice['total_price_tax_incl'];
|
||||
} else {
|
||||
$totalPriceByProduct += $roomTotalPrice['total_price_tax_excl'];
|
||||
}
|
||||
|
||||
// If customer has selected advance payment of the cart
|
||||
if ($type == Cart::ADVANCE_PAYMENT || $type == Cart::ADVANCE_PAYMENT_ONLY_PRODUCTS) {
|
||||
$objAdvPayment = new HotelAdvancedPayment();
|
||||
$advProductPrice = $objAdvPayment->getProductMinAdvPaymentAmountByIdCart(
|
||||
$this->id,
|
||||
$cartRoomInfo['id_product'],
|
||||
0,
|
||||
0,
|
||||
$with_taxes
|
||||
);
|
||||
|
||||
// set advance payment price only if it is greater than real price
|
||||
if ($advProductPrice < $totalPriceByProduct) {
|
||||
$totalPriceByProduct = $advProductPrice;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch ($ps_round_type) {
|
||||
case Order::ROUND_TOTAL:
|
||||
// before
|
||||
//$products_total[$id_tax_rules_group.'_'.$id_address] += $price * (int)$product['cart_quantity'];
|
||||
//by webkul
|
||||
$products_total[$id_tax_rules_group.'_'.$id_address] += $totalPriceByProduct;
|
||||
break;
|
||||
|
||||
case Order::ROUND_LINE:
|
||||
//Before
|
||||
//$product_price = $price * $product['cart_quantity'];
|
||||
//By webkul
|
||||
$product_price = $totalPriceByProduct;
|
||||
$products_total[$id_tax_rules_group] += Tools::ps_round($product_price, $compute_precision);
|
||||
break;
|
||||
|
||||
case Order::ROUND_ITEM:
|
||||
default:
|
||||
//Before
|
||||
//$product_price = /*$with_taxes ? $tax_calculator->addTaxes($price) : */$price;
|
||||
//$products_total[$id_tax_rules_group] += Tools::ps_round($product_price, $compute_precision) * (int)$product['cart_quantity'];
|
||||
// By Webkul
|
||||
$product_price = $totalPriceByProduct;
|
||||
$products_total[$id_tax_rules_group] += Tools::ps_round($product_price, $compute_precision);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// price of extra demands on room type in the cart
|
||||
if ($type == Cart::BOTH || $type == Cart::BOTH_WITHOUT_SHIPPING || $type == Cart::ADVANCE_PAYMENT) {
|
||||
$totalDemandsPrice += $objCartBookingData->getCartExtraDemands($this->id, $product['id_product'], 0, 0, 0, 1, 0, (int)$with_taxes);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($products_total as $key => $price) {
|
||||
@@ -1675,9 +1720,14 @@ class CartCore extends ObjectModel
|
||||
return $wrapping_fees;
|
||||
}
|
||||
|
||||
// price of extra demands on room type in the cart
|
||||
if ($type == Cart::BOTH || $type == Cart::BOTH_WITHOUT_SHIPPING || $type == Cart::ADVANCE_PAYMENT) {
|
||||
$order_total += $totalDemandsPrice;
|
||||
}
|
||||
|
||||
$order_total_discount = 0;
|
||||
$order_shipping_discount = 0;
|
||||
if (!in_array($type, array(Cart::ONLY_SHIPPING, Cart::ONLY_PRODUCTS)) && CartRule::isFeatureActive()) {
|
||||
if (!in_array($type, array(Cart::ONLY_SHIPPING, Cart::ONLY_PRODUCTS, Cart::ADVANCE_PAYMENT_ONLY_PRODUCTS)) && CartRule::isFeatureActive()) {
|
||||
// First, retrieve the cart rules associated to this "getOrderTotal"
|
||||
if ($with_shipping || $type == Cart::ONLY_DISCOUNTS) {
|
||||
$cart_rules = $this->getCartRules(CartRule::FILTER_ACTION_ALL);
|
||||
@@ -1739,7 +1789,7 @@ class CartCore extends ObjectModel
|
||||
$order_total -= $order_total_discount;
|
||||
}
|
||||
|
||||
if ($type == Cart::BOTH) {
|
||||
if ($type == Cart::BOTH || $type == Cart::ADVANCE_PAYMENT) {
|
||||
$order_total += $shipping_fees + $wrapping_fees;
|
||||
}
|
||||
|
||||
@@ -1751,12 +1801,6 @@ class CartCore extends ObjectModel
|
||||
return $order_total_discount;
|
||||
}
|
||||
|
||||
// price of extra demands on room type in the cart
|
||||
if ($type == Cart::BOTH || $type == Cart::BOTH_WITHOUT_SHIPPING) {
|
||||
$totalDemandsPrice = $objCartBookingData->getCartExtraDemands($this->id, 0, 0, 0, 0, 1, 0, (int)$with_taxes);
|
||||
$order_total += $totalDemandsPrice;
|
||||
}
|
||||
|
||||
return Tools::ps_round((float)$order_total, $compute_precision);
|
||||
}
|
||||
|
||||
@@ -2419,8 +2463,8 @@ class CartCore extends ObjectModel
|
||||
}
|
||||
$delivery_option_list[$id_address][$key]['carrier_list'][$id_carrier]['instance'] = $carrier_collection[$id_carrier];
|
||||
|
||||
if (file_exists(_PS_SHIP_IMG_DIR_.$id_carrier.'.jpg')) {
|
||||
$delivery_option_list[$id_address][$key]['carrier_list'][$id_carrier]['logo'] = _THEME_SHIP_DIR_.$id_carrier.'.jpg';
|
||||
if (Tools::file_get_contents($context->link->getMediaLink(_THEME_SHIP_DIR_.$id_carrier.'.jpg'))) { // by webkul
|
||||
$delivery_option_list[$id_address][$key]['carrier_list'][$id_carrier]['logo'] = $context->link->getMediaLink(_THEME_SHIP_DIR_.$id_carrier.'.jpg'); // by webkul to get media link
|
||||
} else {
|
||||
$delivery_option_list[$id_address][$key]['carrier_list'][$id_carrier]['logo'] = false;
|
||||
}
|
||||
@@ -3574,7 +3618,10 @@ class CartCore extends ObjectModel
|
||||
|
||||
// Delete customization picture if necessary
|
||||
if ($cust_data['type'] == 0) {
|
||||
$result &= (@unlink(_PS_UPLOAD_DIR_.$cust_data['value']) && @unlink(_PS_UPLOAD_DIR_.$cust_data['value'].'_small'));
|
||||
$result &= (
|
||||
Tools::deleteFile(_PS_UPLOAD_DIR_.$cust_data['value']) && //by webkul use deleteFile insted of unlink
|
||||
Tools::deleteFile(_PS_UPLOAD_DIR_.$cust_data['value'].'_small') //by webkul use deleteFile insted of unlink
|
||||
);
|
||||
}
|
||||
|
||||
$result &= Db::getInstance()->execute('DELETE
|
||||
@@ -4217,7 +4264,6 @@ class CartCore extends ObjectModel
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function getProductQtyInCart($id_cart, $id_product)
|
||||
{
|
||||
$result = Db::getInstance()->getValue("SELECT `quantity` FROM `"._DB_PREFIX_."cart_product` WHERE `id_cart`= ".$id_cart." AND `id_product`=".$id_product);
|
||||
@@ -4228,4 +4274,242 @@ class CartCore extends ObjectModel
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Webservice:: Get id_address in the cart
|
||||
public function getWsIdAddress()
|
||||
{
|
||||
return Db::getInstance()->getValue(
|
||||
'SELECT id_address_delivery FROM `'._DB_PREFIX_.'cart`
|
||||
WHERE id_cart = '.(int)$this->id
|
||||
);
|
||||
}
|
||||
|
||||
// Webservice :: Set id_address in the cart
|
||||
public function setWsIdAddress($id_address)
|
||||
{
|
||||
if ($this->id) {
|
||||
return Db::getInstance()->execute(
|
||||
'UPDATE `'._DB_PREFIX_.'cart`
|
||||
SET `id_address_delivery` = '.(int)$id_address.', `id_address_invoice` = '.(int)$id_address.'
|
||||
WHERE `id_cart` = '.(int)$this->id
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Webservice:: Get booking rows
|
||||
public function getWsCartBookings()
|
||||
{
|
||||
return Db::getInstance()->executeS('
|
||||
SELECT `id`
|
||||
FROM `'._DB_PREFIX_.'htl_cart_booking_data`
|
||||
WHERE id_cart = '.(int)$this->id.' ORDER BY `id` ASC'
|
||||
);
|
||||
}
|
||||
|
||||
public function addWs($autodate = true, $null_values = false)
|
||||
{
|
||||
$this->id_shop = Configuration::get('PS_SHOP_DEFAULT');
|
||||
$objShop = new Shop($this->id_shop);
|
||||
$this->id_shop_group = $objShop->id_shop_group;
|
||||
|
||||
// get bookings xaml data
|
||||
$postData = trim(file_get_contents('php://input'));
|
||||
libxml_use_internal_errors(true);
|
||||
$xml = simplexml_load_string(utf8_decode($postData));
|
||||
$cartData = Tools::jsonDecode(Tools::jsonEncode($xml, true));
|
||||
|
||||
$this->id_address_delivery = $cartData->cart->id_address;
|
||||
$this->id_address_invoice = $cartData->cart->id_address;
|
||||
|
||||
if ($this->add($autodate, $null_values)) {
|
||||
// set bookings for the cart
|
||||
$bookingRows = $cartData->cart->associations->cart_bookings->booking;
|
||||
if (isset($bookingRows->id_hotel)) {
|
||||
$bookingRows = array($bookingRows);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function updateWs($autodate = true, $null_values = false)
|
||||
{
|
||||
$this->id_shop = Configuration::get('PS_SHOP_DEFAULT');
|
||||
$objShop = new Shop($this->id_shop);
|
||||
$this->id_shop_group = $objShop->id_shop_group;
|
||||
|
||||
// get bookings xml data
|
||||
$postData = trim(file_get_contents('php://input'));
|
||||
libxml_use_internal_errors(true);
|
||||
$xml = simplexml_load_string(utf8_decode($postData));
|
||||
$cartData = Tools::jsonDecode(Tools::jsonEncode($xml, true));
|
||||
|
||||
$this->id_address_delivery = $cartData->cart->id_address;
|
||||
$this->id_address_invoice = $cartData->cart->id_address;
|
||||
|
||||
if ($this->update($autodate, $null_values)) {
|
||||
// set bookings for the cart
|
||||
$bookingRows = $cartData->cart->associations->cart_bookings->booking;
|
||||
if (isset($bookingRows->id_hotel)) {
|
||||
$bookingRows = array($bookingRows);
|
||||
}
|
||||
$this->setWsCartRooms($bookingRows);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function setWsCartRooms($bookingRows)
|
||||
{
|
||||
$idCart = $this->id;
|
||||
$objCart = new Cart($idCart);
|
||||
$idGuest = $objCart->id_guest;
|
||||
|
||||
// delete cart bookings
|
||||
$objCartBooking = new HotelCartBookingData();
|
||||
$objCartBooking->deleteCartBookingData($idCart);
|
||||
$this->deleteAssociations();
|
||||
$hasErrors = 0;
|
||||
// lets validate the cart booking data first
|
||||
if (isset($bookingRows) && count($bookingRows)) {
|
||||
$objRoomType = new HotelRoomType();
|
||||
$objBookingDtl = new HotelBookingDetail();
|
||||
$errors = array();
|
||||
$idCustomer = $objCart->id_customer;
|
||||
$idCurrency = $objCart->id_currency;
|
||||
|
||||
$extraDemands = null;
|
||||
foreach ($bookingRows as $booking) {
|
||||
$booking = Tools::jsonDecode(Tools::jsonEncode($booking, true), true);
|
||||
if (isset($booking['extra_demands']['extra_demand'])) {
|
||||
$extraDemands = $booking['extra_demands']['extra_demand'];
|
||||
if (isset($extraDemands['id_global_demand'])) {
|
||||
$extraDemands = array($extraDemands);
|
||||
}
|
||||
// $extraDemands = Tools::jsonDecode($extraDemands, true);
|
||||
$extraDemands = Tools::jsonEncode($extraDemands);
|
||||
}
|
||||
|
||||
// get room booking info
|
||||
$idProduct = $booking['id_product'];
|
||||
$dateFrom = $booking['date_from'];
|
||||
$dateTo = $booking['date_to'];
|
||||
$prodQty = 1;
|
||||
// change format to the database format
|
||||
$dateFrom = date("Y-m-d", strtotime($dateFrom));
|
||||
$dateTo = date("Y-m-d", strtotime($dateTo));
|
||||
|
||||
if ($roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($idProduct)) {
|
||||
if ($idHotel = $roomTypeInfo['id_hotel']) {
|
||||
if (strtotime($dateFrom) >= strtotime($dateTo)) {
|
||||
$hasErrors = 1;
|
||||
WebserviceRequest::getInstance()->setError(500, Tools::displayError('Check-out date must be after check-in date.'), 134);
|
||||
} elseif ($maxOrdDate = HotelOrderRestrictDate::getMaxOrderDate($idHotel)) {
|
||||
// Check Order restrict condition before adding in to cart
|
||||
if (strtotime('-1 day', strtotime($maxOrdDate)) < strtotime($dateFrom)
|
||||
|| strtotime($maxOrdDate) < strtotime($dateTo)
|
||||
) {
|
||||
$maxOrdDate = date('d-m-Y', strtotime($maxOrdDate));
|
||||
$hasErrors = 1;
|
||||
WebserviceRequest::getInstance()->setError(500, Tools::displayError('You can\'t book room after date.'), 134);
|
||||
}
|
||||
}
|
||||
|
||||
if (!count($errors)) {
|
||||
$numDays = $objBookingDtl->getNumberOfDays($dateFrom, $dateTo);
|
||||
$prodQty = $prodQty * (int) $numDays;
|
||||
$reqRooms = 1;
|
||||
|
||||
if ($hotelRoomData = $objBookingDtl->DataForFrontSearch(
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
$idHotel,
|
||||
$idProduct,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
-1,
|
||||
0,
|
||||
0,
|
||||
$idCart,
|
||||
$idGuest
|
||||
)) {
|
||||
if (isset($hotelRoomData['stats']['num_avail'])) {
|
||||
$totalAvailRooms = $hotelRoomData['stats']['num_avail'];
|
||||
if ($totalAvailRooms < $reqRooms) {
|
||||
$hasErrors = 1;
|
||||
WebserviceRequest::getInstance()->setError(500, Tools::displayError('unavailable quantity'), 134);
|
||||
}
|
||||
} else {
|
||||
$hasErrors = 1;
|
||||
WebserviceRequest::getInstance()->setError(500, Tools::displayError('Rooms are unavailable. Please try with different dates'), 134);
|
||||
}
|
||||
} else {
|
||||
$hasErrors = 1;
|
||||
WebserviceRequest::getInstance()->setError(500, Tools::displayError('Rooms are unavailable. Please try with different dates'), 134);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$hasErrors = 1;
|
||||
WebserviceRequest::getInstance()->setError(500, Tools::displayError('Rooms are unavailable.'), 134);
|
||||
}
|
||||
} else {
|
||||
$hasErrors = 1;
|
||||
WebserviceRequest::getInstance()->setError(500, Tools::displayError('Rooms are unavailable.'), 134);
|
||||
}
|
||||
|
||||
if ($prodQty == 0) {
|
||||
$hasErrors = 1;
|
||||
WebserviceRequest::getInstance()->setError(500, Tools::displayError('Null quantity.'), 134);
|
||||
} elseif (!$idProduct) {
|
||||
$hasErrors = 1;
|
||||
WebserviceRequest::getInstance()->setError(500, Tools::displayError('Room type not found.'), 134);
|
||||
}
|
||||
$product = new Product($idProduct, true, $objCart->id_lang);
|
||||
if (!$product->id || !$product->active) {
|
||||
$hasErrors = 1;
|
||||
WebserviceRequest::getInstance()->setError(500, Tools::displayError('Room type not found.'), 134);
|
||||
}
|
||||
// If no errors, process product addition
|
||||
if (!$hasErrors) {
|
||||
$update_quantity = $objCart->updateQty($prodQty, $idProduct, 0, 0, Tools::getValue('op', 'up'), $this->id_address_delivery);
|
||||
$chkQty = 0;
|
||||
if ($hotelAvailRomms = $hotelRoomData['rm_data'][0]['data']['available']) {
|
||||
foreach ($hotelAvailRomms as $key_hotel_room_info => $val_hotel_room_info) {
|
||||
if ($chkQty < $reqRooms) {
|
||||
$objCartBooking = new HotelCartBookingData();
|
||||
$objCartBooking->id_cart = $objCart->id;
|
||||
$objCartBooking->id_guest = $objCart->id_guest;
|
||||
$objCartBooking->id_customer = $idCustomer;
|
||||
$objCartBooking->id_currency = $idCurrency;
|
||||
$objCartBooking->id_product = $val_hotel_room_info['id_product'];
|
||||
$objCartBooking->id_room = $val_hotel_room_info['id_room'];
|
||||
$objCartBooking->id_hotel = $val_hotel_room_info['id_hotel'];
|
||||
$objCartBooking->booking_type = 1;
|
||||
$objCartBooking->quantity = $numDays;
|
||||
$objCartBooking->extra_demands = $extraDemands;
|
||||
$objCartBooking->date_from = $dateFrom;
|
||||
$objCartBooking->date_to = $dateTo;
|
||||
$objCartBooking->save();
|
||||
++$chkQty;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// delete cart bookings
|
||||
$objCartBooking = new HotelCartBookingData();
|
||||
$objCartBooking->deleteCartBookingData($idCart);
|
||||
$this->deleteAssociations();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,10 @@ class CategoryCore extends ObjectModel
|
||||
public function __construct($id_category = null, $id_lang = null, $id_shop = null)
|
||||
{
|
||||
parent::__construct($id_category, $id_lang, $id_shop);
|
||||
$this->id_image = ($this->id && file_exists(_PS_CAT_IMG_DIR_.(int)$this->id.'.jpg')) ? (int)$this->id : false;
|
||||
|
||||
$link = new Link();
|
||||
$imgLink = $link->getMediaLink(_PS_CAT_IMG_DIR_.(int)$this->id.'.jpg'); // by webkul use media link for images
|
||||
$this->id_image = ($this->id && (bool)Tools::file_get_contents($imgLink)) ? (int)$this->id : false;
|
||||
$this->image_dir = _PS_CAT_IMG_DIR_;
|
||||
}
|
||||
|
||||
@@ -482,7 +485,8 @@ class CategoryCore extends ObjectModel
|
||||
if (!Validate::isBool($active)) {
|
||||
die(Tools::displayError());
|
||||
}
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(
|
||||
'
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
'.Shop::addSqlAssociation('category', 'c').'
|
||||
@@ -506,9 +510,16 @@ class CategoryCore extends ObjectModel
|
||||
return $categories;
|
||||
}
|
||||
|
||||
public static function getAllCategoriesName($root_category = null, $id_lang = false, $active = true, $groups = null,
|
||||
$use_shop_restriction = true, $sql_filter = '', $sql_sort = '', $sql_limit = '')
|
||||
{
|
||||
public static function getAllCategoriesName(
|
||||
$root_category = null,
|
||||
$id_lang = false,
|
||||
$active = true,
|
||||
$groups = null,
|
||||
$use_shop_restriction = true,
|
||||
$sql_filter = '',
|
||||
$sql_sort = '',
|
||||
$sql_limit = ''
|
||||
) {
|
||||
if (isset($root_category) && !Validate::isInt($root_category)) {
|
||||
die(Tools::displayError());
|
||||
}
|
||||
@@ -525,7 +536,8 @@ class CategoryCore extends ObjectModel
|
||||
.(isset($groups) && Group::isFeatureActive() ? implode('', $groups) : ''));
|
||||
|
||||
if (!Cache::isStored($cache_id)) {
|
||||
$result = Db::getInstance()->executeS('
|
||||
$result = Db::getInstance()->executeS(
|
||||
'
|
||||
SELECT c.id_category, cl.name
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
'.($use_shop_restriction ? Shop::addSqlAssociation('category', 'c') : '').'
|
||||
@@ -549,9 +561,16 @@ class CategoryCore extends ObjectModel
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function getNestedCategories($root_category = null, $id_lang = false, $active = true, $groups = null,
|
||||
$use_shop_restriction = true, $sql_filter = '', $sql_sort = '', $sql_limit = '')
|
||||
{
|
||||
public static function getNestedCategories(
|
||||
$root_category = null,
|
||||
$id_lang = false,
|
||||
$active = true,
|
||||
$groups = null,
|
||||
$use_shop_restriction = true,
|
||||
$sql_filter = '',
|
||||
$sql_sort = '',
|
||||
$sql_limit = ''
|
||||
) {
|
||||
if (isset($root_category) && !Validate::isInt($root_category)) {
|
||||
die(Tools::displayError());
|
||||
}
|
||||
@@ -568,7 +587,8 @@ class CategoryCore extends ObjectModel
|
||||
.(isset($groups) && Group::isFeatureActive() ? implode('', $groups) : ''));
|
||||
|
||||
if (!Cache::isStored($cache_id)) {
|
||||
$result = Db::getInstance()->executeS('
|
||||
$result = Db::getInstance()->executeS(
|
||||
'
|
||||
SELECT c.*, cl.*
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
'.($use_shop_restriction ? Shop::addSqlAssociation('category', 'c') : '').'
|
||||
@@ -997,7 +1017,8 @@ class CategoryCore extends ObjectModel
|
||||
}
|
||||
}
|
||||
|
||||
$flag = Db::getInstance()->execute('
|
||||
$flag = Db::getInstance()->execute(
|
||||
'
|
||||
INSERT IGNORE INTO `'._DB_PREFIX_.'category_product` (`id_product`, `id_category`, `position`)
|
||||
VALUES '.implode(',', $row)
|
||||
);
|
||||
@@ -1064,8 +1085,11 @@ class CategoryCore extends ObjectModel
|
||||
$id_lang = Context::getContext()->language->id;
|
||||
}
|
||||
|
||||
return $link->getCategoryLink($this,
|
||||
is_array($this->link_rewrite) ? $this->link_rewrite[$id_lang] : $this->link_rewrite, $id_lang);
|
||||
return $link->getCategoryLink(
|
||||
$this,
|
||||
is_array($this->link_rewrite) ? $this->link_rewrite[$id_lang] : $this->link_rewrite,
|
||||
$id_lang
|
||||
);
|
||||
}
|
||||
|
||||
public function getName($id_lang = null)
|
||||
@@ -1245,12 +1269,12 @@ class CategoryCore extends ObjectModel
|
||||
|
||||
public function cleanGroups()
|
||||
{
|
||||
return Db::getInstance()->delete('category_group', 'id_category = '.(int)$this->id);
|
||||
return Db::getInstance()->delete('category_group', 'id_category = '.(int)$this->id);
|
||||
}
|
||||
|
||||
public function cleanAssoProducts()
|
||||
{
|
||||
return Db::getInstance()->delete('category_product', 'id_category = '.(int)$this->id);
|
||||
return Db::getInstance()->delete('category_product', 'id_category = '.(int)$this->id);
|
||||
}
|
||||
|
||||
public function addGroups($groups)
|
||||
@@ -1783,7 +1807,7 @@ class CategoryCore extends ObjectModel
|
||||
*/
|
||||
public static function deleteCategoriesFromShop($id_shop)
|
||||
{
|
||||
return Db::getInstance()->delete('category_shop', 'id_shop = '.(int)$id_shop);
|
||||
return Db::getInstance()->delete('category_shop', 'id_shop = '.(int)$id_shop);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -270,15 +270,12 @@ class CustomerCore extends ObjectModel
|
||||
$carts = Db::getInstance()->executes('SELECT id_cart FROM '._DB_PREFIX_.'cart WHERE id_customer='.(int)$this->id);
|
||||
if ($carts) {
|
||||
$objHtlCartData = new HotelCartBookingData();
|
||||
$objCustomerAdv = new HotelCustomerAdvancedPayment();
|
||||
foreach ($carts as $cart) {
|
||||
$objCart = new Cart($cart['id_cart']);
|
||||
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'cart WHERE id_cart='.(int)$cart['id_cart']);
|
||||
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'cart_product WHERE id_cart='.(int)$cart['id_cart']);
|
||||
// delete rows from hotel booking cart table
|
||||
$objHtlCartData->deleteCartBookingData($cart['id_cart'], 0, 0, 0, 0, 0);
|
||||
// delete hotel advance payment of current cart of this customer
|
||||
$objCustomerAdv->deleteClientCartAdvPaymentDtl($cart['id_cart'], $objCart->id_guest);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ class CustomerMessageCore extends ObjectModel
|
||||
public function delete()
|
||||
{
|
||||
if (!empty($this->file_name)) {
|
||||
@unlink(_PS_UPLOAD_DIR_.$this->file_name);
|
||||
Tools::deleteFile(_PS_UPLOAD_DIR_.$this->file_name); // by webkul use deleteFile insted of unlink
|
||||
}
|
||||
return parent::delete();
|
||||
}
|
||||
|
||||
@@ -45,20 +45,27 @@ class FeatureCore extends ObjectModel
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
protected $webserviceParameters = array(
|
||||
'objectsNodeName' => 'product_features',
|
||||
'objectNodeName' => 'product_feature',
|
||||
'fields' => array(),
|
||||
'objectsNodeName' => 'room_type_features',
|
||||
'objectNodeName' => 'room_type_feature',
|
||||
'fields' => array(
|
||||
'id_default_image' => array(
|
||||
'getter' => 'getWsFeatureImage',
|
||||
'setter' => false,
|
||||
'xlink_resource' => array(
|
||||
'resourceName' => 'images',
|
||||
'subResourceName' => 'features'
|
||||
)
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* Get a feature data for a given id_feature and id_lang
|
||||
*
|
||||
* @param int $id_lang Language id
|
||||
* @param int $id_feature Feature id
|
||||
* @return array Array with feature's data
|
||||
*/
|
||||
*/
|
||||
public static function getFeature($id_lang, $id_feature)
|
||||
{
|
||||
return Db::getInstance()->getRow('
|
||||
@@ -348,4 +355,10 @@ class FeatureCore extends ObjectModel
|
||||
$position = DB::getInstance()->getValue($sql);
|
||||
return (is_numeric($position)) ? $position : - 1;
|
||||
}
|
||||
|
||||
// Webservice :: get image id of the feature
|
||||
public function getWsFeatureImage()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,9 +67,10 @@ class GenderCore extends ObjectModel
|
||||
|
||||
public function getImage($use_unknown = false)
|
||||
{
|
||||
if (!isset($this->id) || empty($this->id) || !file_exists(_PS_GENDERS_DIR_.$this->id.'.jpg')) {
|
||||
return _THEME_GENDERS_DIR_.'Unknown.jpg';
|
||||
$context = Context::getContext(); // by webkul get media link
|
||||
if (!isset($this->id) || empty($this->id) || !(bool)Tools::file_get_contents($context->link->getMediaLink(_THEME_GENDERS_DIR_.$this->id.'.jpg'))) {
|
||||
return $context->link->getMediaLink(_THEME_GENDERS_DIR_.'Unknown.jpg');
|
||||
}
|
||||
return _THEME_GENDERS_DIR_.$this->id.'.jpg';
|
||||
return $context->link->getMediaLink(_THEME_GENDERS_DIR_.$this->id.'.jpg');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -566,13 +566,14 @@ class LanguageCore extends ObjectModel
|
||||
'-default-'.ImageType::getFormatedName('small').'.jpg'
|
||||
);
|
||||
$images_directories = array(_PS_CAT_IMG_DIR_, _PS_MANU_IMG_DIR_, _PS_PROD_IMG_DIR_, _PS_SUPP_IMG_DIR_);
|
||||
$context = Context::getContext();
|
||||
foreach ($images_directories as $image_directory) {
|
||||
foreach ($images as $image) {
|
||||
if (file_exists($image_directory.$this->iso_code.$image)) {
|
||||
unlink($image_directory.$this->iso_code.$image);
|
||||
Tools::deleteFile($image_directory.$this->iso_code.$image); //by webkul use deleteFile insted of unlink
|
||||
}
|
||||
if (file_exists(_PS_ROOT_DIR_.'/img/l/'.$this->id.'.jpg')) {
|
||||
unlink(_PS_ROOT_DIR_.'/img/l/'.$this->id.'.jpg');
|
||||
Tools::deleteFile(_PS_ROOT_DIR_.'/img/l/'.$this->id.'.jpg'); //by webkul use deleteFile insted of unlink
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,18 +314,19 @@ class MailCore extends ObjectModel
|
||||
|
||||
$template_vars = array_map(array('Tools', 'htmlentitiesDecodeUTF8'), $template_vars);
|
||||
$template_vars = array_map(array('Tools', 'stripslashes'), $template_vars);
|
||||
|
||||
if (Configuration::get('PS_LOGO_MAIL') !== false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL', null, null, $id_shop))) {
|
||||
$logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL', null, null, $id_shop);
|
||||
// by webkul to get logo from media link.
|
||||
if (Configuration::get('PS_LOGO_MAIL') !== false && (bool)Tools::file_get_contents(Context::getContext()->link->getMediaLink(_PS_IMG_.Configuration::get('PS_LOGO_MAIL', null, null, $id_shop)))) {
|
||||
$logo = Context::getContext()->link->getMediaLink(_PS_IMG_.Configuration::get('PS_LOGO_MAIL', null, null, $id_shop));
|
||||
} else {
|
||||
if (file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO', null, null, $id_shop))) {
|
||||
$logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO', null, null, $id_shop);
|
||||
if ((bool)Tools::file_get_contents(Context::getContext()->link->getMediaLink(_PS_IMG_.Configuration::get('PS_LOGO', null, null, $id_shop)))) {
|
||||
$logo = Context::getContext()->link->getMediaLink(_PS_IMG_.Configuration::get('PS_LOGO', null, null, $id_shop));
|
||||
} else {
|
||||
$template_vars['{shop_logo}'] = '';
|
||||
}
|
||||
}
|
||||
ShopUrl::cacheMainDomainForShop((int)$id_shop);
|
||||
/* don't attach the logo as */
|
||||
|
||||
if (isset($logo)) {
|
||||
$template_vars['{shop_logo}'] = $message->embed(Swift_Image::fromPath($logo));
|
||||
}
|
||||
@@ -596,4 +597,28 @@ class MailCore extends ObjectModel
|
||||
|
||||
return $start.$string.$end;
|
||||
}
|
||||
|
||||
public function getEmailTemplateContent($templateName, $mailType, $list)
|
||||
{
|
||||
$emailConfiguration = Configuration::get('PS_MAIL_TYPE');
|
||||
if ($emailConfiguration != $mailType && $emailConfiguration != Mail::TYPE_BOTH) {
|
||||
return '';
|
||||
}
|
||||
$context = Context::getContext();
|
||||
$pathToFindEmail = array(
|
||||
_PS_THEME_DIR_.'mails'.DIRECTORY_SEPARATOR.$context->language->iso_code.DIRECTORY_SEPARATOR.$templateName.'.tpl',
|
||||
_PS_THEME_DIR_.'mails'.DIRECTORY_SEPARATOR.'en'.DIRECTORY_SEPARATOR.$templateName.'.tpl',
|
||||
_PS_MAIL_DIR_.$context->language->iso_code.DIRECTORY_SEPARATOR.$templateName.'.tpl',
|
||||
_PS_MAIL_DIR_.'en'.DIRECTORY_SEPARATOR.$templateName.'.tpl',
|
||||
);
|
||||
|
||||
foreach ($pathToFindEmail as $path) {
|
||||
if (Tools::file_exists_cache($path)) {
|
||||
$context->smarty->assign('list', $list);
|
||||
return $context->smarty->fetch($path);
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,6 +129,9 @@ abstract class ObjectModelCore implements Core_Foundation_Database_EntityInterfa
|
||||
/** @var string Path to image directory. Used for image deletion. */
|
||||
protected $image_dir = null;
|
||||
|
||||
/** @var string image name used for image deletion. */ //by webkul
|
||||
protected $image_name = null;
|
||||
|
||||
/** @var String file type of image files. */
|
||||
protected $image_format = 'jpg';
|
||||
|
||||
@@ -554,7 +557,7 @@ abstract class ObjectModelCore implements Core_Foundation_Database_EntityInterfa
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.bqSQL($definition['table']).'`
|
||||
WHERE `'.bqSQL($definition['primary']).'` = '.(int)$this->id
|
||||
);
|
||||
);
|
||||
if (!$res) {
|
||||
return false;
|
||||
}
|
||||
@@ -563,7 +566,7 @@ abstract class ObjectModelCore implements Core_Foundation_Database_EntityInterfa
|
||||
foreach ($res as $field => &$value) {
|
||||
if (isset($definition['fields'][$field])) {
|
||||
$value = ObjectModel::formatValue($value, $definition['fields'][$field]['type'], false, true,
|
||||
!empty($definition['fields'][$field]['allow_null']));
|
||||
!empty($definition['fields'][$field]['allow_null']));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -586,7 +589,7 @@ abstract class ObjectModelCore implements Core_Foundation_Database_EntityInterfa
|
||||
foreach ($row as $field => &$value) {
|
||||
if (isset($definition['fields'][$field])) {
|
||||
$value = ObjectModel::formatValue($value, $definition['fields'][$field]['type'], false, true,
|
||||
!empty($definition['fields'][$field]['allow_null']));
|
||||
!empty($definition['fields'][$field]['allow_null']));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1255,10 +1258,10 @@ abstract class ObjectModelCore implements Core_Foundation_Database_EntityInterfa
|
||||
}
|
||||
if (isset($details['validate'])) {
|
||||
$current_field['validateMethod'] = (
|
||||
array_key_exists('validateMethod', $resource_parameters['fields'][$field_name]) ?
|
||||
array_key_exists('validateMethod', $resource_parameters['fields'][$field_name]) ?
|
||||
array_merge($resource_parameters['fields'][$field_name]['validateMethod'], array($details['validate'])) :
|
||||
array($details['validate'])
|
||||
);
|
||||
);
|
||||
}
|
||||
$resource_parameters['fields'][$field_name] = array_merge($resource_parameters['fields'][$field_name], $current_field);
|
||||
|
||||
@@ -1665,9 +1668,16 @@ abstract class ObjectModelCore implements Core_Foundation_Database_EntityInterfa
|
||||
if ($force_delete || !$this->hasMultishopEntries()) {
|
||||
/* Deleting object images and thumbnails (cache) */
|
||||
if ($this->image_dir) {
|
||||
if (file_exists($this->image_dir.$this->id.'.'.$this->image_format)
|
||||
&& !unlink($this->image_dir.$this->id.'.'.$this->image_format)) {
|
||||
return false;
|
||||
if ($this->image_name) { // by webkul
|
||||
if (file_exists($this->image_dir.$this->image_name.'.'.$this->image_format)
|
||||
&& !unlink($this->image_dir.$this->image_name.'.'.$this->image_format)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (file_exists($this->image_dir.$this->id.'.'.$this->image_format)
|
||||
&& !unlink($this->image_dir.$this->id.'.'.$this->image_format)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (file_exists(_PS_TMP_IMG_DIR_.$this->def['table'].'_'.$this->id.'.'.$this->image_format)
|
||||
@@ -1681,9 +1691,16 @@ abstract class ObjectModelCore implements Core_Foundation_Database_EntityInterfa
|
||||
|
||||
$types = ImageType::getImagesTypes();
|
||||
foreach ($types as $image_type) {
|
||||
if (file_exists($this->image_dir.$this->id.'-'.stripslashes($image_type['name']).'.'.$this->image_format)
|
||||
&& !unlink($this->image_dir.$this->id.'-'.stripslashes($image_type['name']).'.'.$this->image_format)) {
|
||||
return false;
|
||||
if ($this->image_name) { // by webkul
|
||||
if (file_exists($this->image_dir.$this->id.'-'.stripslashes($image_type['name']).'.'.$this->image_format)
|
||||
&& !unlink($this->image_dir.$this->id.'-'.stripslashes($image_type['name']).'.'.$this->image_format)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (file_exists($this->image_dir.$this->id.'-'.stripslashes($image_type['name']).'.'.$this->image_format)
|
||||
&& !unlink($this->image_dir.$this->id.'-'.stripslashes($image_type['name']).'.'.$this->image_format)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1701,10 +1718,12 @@ abstract class ObjectModelCore implements Core_Foundation_Database_EntityInterfa
|
||||
*/
|
||||
public static function existsInDatabase($id_entity, $table)
|
||||
{
|
||||
$row = Db::getInstance()->getRow('
|
||||
$row = Db::getInstance()->getRow(
|
||||
'
|
||||
SELECT `id_'.bqSQL($table).'` as id
|
||||
FROM `'._DB_PREFIX_.bqSQL($table).'` e
|
||||
WHERE e.`id_'.bqSQL($table).'` = '.(int)$id_entity, false
|
||||
WHERE e.`id_'.bqSQL($table).'` = '.(int)$id_entity,
|
||||
false
|
||||
);
|
||||
|
||||
return isset($row['id']);
|
||||
|
||||
@@ -229,17 +229,12 @@ abstract class PaymentModuleCore extends Module
|
||||
$order_creation_failed = false;
|
||||
$cart_total_paid = (float)Tools::ps_round((float)$this->context->cart->getOrderTotal(true, Cart::BOTH), 2);
|
||||
|
||||
/* Total cart total in case of Advance Payment By webkul*/
|
||||
$freeAdvancePaymentOrder = false;
|
||||
if (Module::isInstalled('hotelreservationsystem')) {
|
||||
require_once(_PS_MODULE_DIR_.'hotelreservationsystem/define.php');
|
||||
$obj_adv_pmt = new HotelAdvancedPayment();
|
||||
$freeAdvancePaymentOrder = $obj_adv_pmt->_checkFreeAdvancePaymentOrder();
|
||||
if ($freeAdvancePaymentOrder) {
|
||||
$cart_total_paid = 0;
|
||||
}
|
||||
if ($this->context->cart->is_advance_payment) {
|
||||
$cart_total_paid = (float)Tools::ps_round(
|
||||
(float)$this->context->cart->getOrderTotal(true, CART::ADVANCE_PAYMENT),
|
||||
2
|
||||
);
|
||||
}
|
||||
/*END*/
|
||||
|
||||
foreach ($cart_delivery_option as $id_address => $key_carriers) {
|
||||
foreach ($delivery_option_list[$id_address][$key_carriers]['carrier_list'] as $id_carrier => $data) {
|
||||
@@ -358,6 +353,10 @@ abstract class PaymentModuleCore extends Module
|
||||
PrestaShopLogger::addLog('PaymentModule::validateOrder - Order is about to be added', 1, null, 'Cart', (int)$id_cart, true);
|
||||
}
|
||||
|
||||
// advance payment information
|
||||
$order->is_advance_payment = $this->context->cart->is_advance_payment;
|
||||
$order->advance_paid_amount = $cart_total_paid;
|
||||
|
||||
// Creating order
|
||||
$result = $order->add();
|
||||
|
||||
@@ -370,14 +369,7 @@ abstract class PaymentModuleCore extends Module
|
||||
// We don't use the following condition to avoid the float precision issues : http://www.php.net/manual/en/language.types.float.php
|
||||
// if ($order->total_paid != $order->total_paid_real)
|
||||
// We use number_format in order to compare two string
|
||||
if (Configuration::get('WK_ALLOW_ADVANCED_PAYMENT')) {
|
||||
$objCustAdv = new HotelCustomerAdvancedPayment();
|
||||
$advOrderTotal = $objCustAdv->getOrdertTotal($this->context->cart->id, $this->context->cart->id_guest);
|
||||
// if customer is paying advance payment amount
|
||||
if ($order_status->logable && number_format($advOrderTotal, _PS_PRICE_COMPUTE_PRECISION_) != number_format($amount_paid, _PS_PRICE_COMPUTE_PRECISION_)) {
|
||||
$id_order_state = Configuration::get('PS_OS_ERROR');
|
||||
}
|
||||
} elseif ($order_status->logable && number_format($cart_total_paid, _PS_PRICE_COMPUTE_PRECISION_) != number_format($amount_paid, _PS_PRICE_COMPUTE_PRECISION_)) {
|
||||
if ($order_status->logable && number_format($cart_total_paid, _PS_PRICE_COMPUTE_PRECISION_) != number_format($amount_paid, _PS_PRICE_COMPUTE_PRECISION_)) {
|
||||
// if customer is paying full payment amount
|
||||
$id_order_state = Configuration::get('PS_OS_ERROR');
|
||||
}
|
||||
@@ -740,32 +732,16 @@ abstract class PaymentModuleCore extends Module
|
||||
$delivery_state = $delivery->id_state ? new State($delivery->id_state) : false;
|
||||
$invoice_state = $invoice->id_state ? new State($invoice->id_state) : false;
|
||||
|
||||
//by webkul changing mail format
|
||||
// changing mail format
|
||||
$cart_booking_data = $this->cartBookingDataForMail($order);
|
||||
$cart_booking_data_text = $this->getEmailTemplateContent('hotel-booking-cart-data.text', Mail::TYPE_TEXT, $cart_booking_data['cart_htl_data']);
|
||||
$cart_booking_data_html = $this->getEmailTemplateContent('hotel-booking-cart-data.tpl', Mail::TYPE_HTML, $cart_booking_data['cart_htl_data']);
|
||||
|
||||
$extra_demands_details_html = $this->getEmailTemplateContent('booking_extra_demands.tpl', Mail::TYPE_HTML, $cart_booking_data['cart_htl_data']);
|
||||
|
||||
//For Advanced Payment
|
||||
$obj_customer_adv = new HotelCustomerAdvancedPayment();
|
||||
$order_adv_dtl = $obj_customer_adv->getCstAdvPaymentDtlByIdOrder($order->id);
|
||||
if ($order_adv_dtl) {
|
||||
$order_adv_dtl['total_due_amount'] = $order_adv_dtl['total_order_amount'] - $order_adv_dtl['total_paid_amount'];
|
||||
|
||||
$order_adv_dtl['total_paid_amount'] = Tools::displayPrice($order_adv_dtl['total_paid_amount'], $this->context->currency, false);
|
||||
$order_adv_dtl['total_order_amount'] = Tools::displayPrice($order_adv_dtl['total_order_amount'], $this->context->currency, false);
|
||||
$order_adv_dtl['total_due_amount'] = Tools::displayPrice($order_adv_dtl['total_due_amount'], $this->context->currency, false);
|
||||
}
|
||||
|
||||
$adv_data_html = $this->getEmailTemplateContent('advanced-book-data.tpl', Mail::TYPE_HTML, $order_adv_dtl);
|
||||
$adv_data_text = $this->getEmailTemplateContent('advanced-book-data.txt', Mail::TYPE_TEXT, $order_adv_dtl);
|
||||
|
||||
$data = array(
|
||||
'{adv_data_html}' => $adv_data_html,//by webkul
|
||||
'{adv_data_text}' => $adv_data_text,//by webkul
|
||||
'{cart_booking_data_html}' => $cart_booking_data_html,//by webkul
|
||||
'{extra_demands_details_html}' => $extra_demands_details_html,//by webkul
|
||||
'{cart_booking_data_html}' => $cart_booking_data_html,
|
||||
'{extra_demands_details_html}' => $extra_demands_details_html,
|
||||
'{total_extra_demands_te}' => Tools::displayPrice(
|
||||
$cart_booking_data['total_extra_demands_te'],
|
||||
$this->context->currency,
|
||||
@@ -1176,7 +1152,7 @@ abstract class PaymentModuleCore extends Module
|
||||
{
|
||||
$result = array();
|
||||
$customer = new Customer($order->id_customer);
|
||||
//by webkul to show order details properly on order history page
|
||||
// To show order details properly on order history page
|
||||
$products = $order->getProducts();
|
||||
if (Module::isInstalled('hotelreservationsystem')) {
|
||||
require_once(_PS_MODULE_DIR_.'hotelreservationsystem/define.php');
|
||||
|
||||
@@ -236,7 +236,7 @@ class ProductCore extends ObjectModel
|
||||
|
||||
/**
|
||||
* @var int tell the type of stock management to apply on the pack
|
||||
*/
|
||||
*/
|
||||
public $pack_stock_type = 3;
|
||||
|
||||
public static $_taxCalculationMethod = null;
|
||||
@@ -247,7 +247,7 @@ class ProductCore extends ObjectModel
|
||||
/**
|
||||
* @since 1.5.6.1
|
||||
* @var array $_cart_quantity is deprecated since 1.5.6.1
|
||||
*/
|
||||
*/
|
||||
protected static $_cart_quantity = array();
|
||||
|
||||
protected static $_tax_rules_group = array();
|
||||
@@ -346,10 +346,26 @@ class ProductCore extends ObjectModel
|
||||
protected $webserviceParameters = array(
|
||||
'objectMethods' => array(
|
||||
'add' => 'addWs',
|
||||
'update' => 'updateWs'
|
||||
'update' => 'updateWs',
|
||||
'delete' => 'deleteWs'
|
||||
),
|
||||
'objectNodeNames' => 'products',
|
||||
|
||||
'objectsNodeName' => 'room_types',
|
||||
'objectNodeName' => 'room_type',
|
||||
'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'
|
||||
),
|
||||
@@ -366,16 +382,16 @@ class ProductCore extends ObjectModel
|
||||
'setter' => 'setCoverWs',
|
||||
'xlink_resource' => array(
|
||||
'resourceName' => 'images',
|
||||
'subResourceName' => 'products'
|
||||
)
|
||||
),
|
||||
'id_default_combination' => array(
|
||||
'getter' => 'getWsDefaultCombination',
|
||||
'setter' => 'setWsDefaultCombination',
|
||||
'xlink_resource' => array(
|
||||
'resourceName' => 'combinations'
|
||||
'subResourceName' => 'room_types'
|
||||
)
|
||||
),
|
||||
// 'id_default_combination' => array(
|
||||
// 'getter' => 'getWsDefaultCombination',
|
||||
// 'setter' => 'setWsDefaultCombination',
|
||||
// 'xlink_resource' => array(
|
||||
// 'resourceName' => 'combinations'
|
||||
// )
|
||||
// ),
|
||||
'id_tax_rules_group' => array(
|
||||
'xlink_resource' => array(
|
||||
'resourceName' => 'tax_rule_groups'
|
||||
@@ -385,10 +401,10 @@ class ProductCore extends ObjectModel
|
||||
'getter' => 'getWsPositionInCategory',
|
||||
'setter' => 'setWsPositionInCategory'
|
||||
),
|
||||
'manufacturer_name' => array(
|
||||
'getter' => 'getWsManufacturerName',
|
||||
'setter' => false
|
||||
),
|
||||
// 'manufacturer_name' => array(
|
||||
// 'getter' => 'getWsManufacturerName',
|
||||
// 'setter' => false
|
||||
// ),
|
||||
'quantity' => array(
|
||||
'getter' => false,
|
||||
'setter' => false
|
||||
@@ -397,6 +413,13 @@ class ProductCore extends ObjectModel
|
||||
'getter' => 'getWsType',
|
||||
'setter' => 'setWsType',
|
||||
),
|
||||
'id_advance_paypent' => array(
|
||||
'xlink_resource' => array(
|
||||
'resourceName' => 'advance_payments'
|
||||
),
|
||||
'getter' => 'getWsRoomTypeAdvancePayment',
|
||||
'setter' => false
|
||||
),
|
||||
),
|
||||
'associations' => array(
|
||||
'categories' => array(
|
||||
@@ -409,55 +432,35 @@ class ProductCore extends ObjectModel
|
||||
'resource' => 'image',
|
||||
'fields' => array('id' => array())
|
||||
),
|
||||
'combinations' => array(
|
||||
'resource' => 'combination',
|
||||
'room_type_features' => array(
|
||||
'resource' => 'room_type_feature',
|
||||
'fields' => array(
|
||||
'id' => array('required' => true),
|
||||
)
|
||||
),
|
||||
'product_option_values' => array(
|
||||
'resource' => 'product_option_value',
|
||||
'fields' => array(
|
||||
'id' => array('required' => true),
|
||||
)
|
||||
),
|
||||
'product_features' => array(
|
||||
'resource' => 'product_feature',
|
||||
'fields' => array(
|
||||
'id' => array('required' => true),
|
||||
'id_feature_value' => array(
|
||||
'required' => true,
|
||||
'xlink_resource' => 'product_feature_values'
|
||||
),
|
||||
)
|
||||
),
|
||||
'tags' => array('resource' => 'tag',
|
||||
'fields' => array(
|
||||
'id' => array('required' => true),
|
||||
)),
|
||||
'stock_availables' => array('resource' => 'stock_available',
|
||||
'fields' => array(
|
||||
'id' => array('required' => true),
|
||||
'id_product_attribute' => array('required' => true),
|
||||
),
|
||||
'setter' => false
|
||||
),
|
||||
'accessories' => array(
|
||||
'resource' => 'product',
|
||||
'api' => 'products',
|
||||
'fields' => array(
|
||||
'id' => array(
|
||||
'required' => true,
|
||||
'xlink_resource' => 'product'),
|
||||
)
|
||||
),
|
||||
'product_bundle' => array(
|
||||
'resource' => 'product',
|
||||
'api' => 'products',
|
||||
'hotel_rooms' => array(
|
||||
'setter' => false,
|
||||
'resource' => 'hotel_room',
|
||||
'fields' => array('id' => array('required' => true))
|
||||
),
|
||||
'feature_prices' => array(
|
||||
'setter' => false,
|
||||
'resource' => 'feature_price',
|
||||
'fields' => array(
|
||||
'id' => array('required' => true),
|
||||
'quantity' => array(),
|
||||
),
|
||||
)
|
||||
),
|
||||
'extra_demands' => array(
|
||||
'setter' => false,
|
||||
'resource' => 'extra_demand',
|
||||
'fields' => array(
|
||||
'id' => array('required' => true),
|
||||
)
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -1487,7 +1490,7 @@ class ProductCore extends ObjectModel
|
||||
), 'id_product = '.(int)$id_product.Shop::addSqlRestriction());
|
||||
|
||||
$result &= Db::getInstance()->update('product', array(
|
||||
'cache_default_attribute' => $id_default_attribute,
|
||||
'cache_default_attribute' => $id_default_attribute,
|
||||
), 'id_product = '.(int)$id_product);
|
||||
|
||||
if ($result && $id_default_attribute) {
|
||||
@@ -3614,7 +3617,7 @@ class ProductCore extends ObjectModel
|
||||
* Link accessories with product
|
||||
*
|
||||
* @param array $accessories_id Accessories ids
|
||||
*/
|
||||
*/
|
||||
public function changeAccessories($accessories_id)
|
||||
{
|
||||
foreach ($accessories_id as $id_product_2) {
|
||||
@@ -5027,9 +5030,9 @@ class ProductCore extends ObjectModel
|
||||
$key = 'product_id_tax_rules_group_'.(int)$id_product.'_'.(int)$context->shop->id;
|
||||
if (!Cache::isStored($key)) {
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT `id_tax_rules_group`
|
||||
FROM `'._DB_PREFIX_.'product_shop`
|
||||
WHERE `id_product` = '.(int)$id_product.' AND id_shop='.(int)$context->shop->id);
|
||||
SELECT `id_tax_rules_group`
|
||||
FROM `'._DB_PREFIX_.'product_shop`
|
||||
WHERE `id_product` = '.(int)$id_product.' AND id_shop='.(int)$context->shop->id);
|
||||
Cache::store($key, (int)$result);
|
||||
return (int)$result;
|
||||
}
|
||||
@@ -5056,41 +5059,40 @@ class ProductCore extends ObjectModel
|
||||
|
||||
/**
|
||||
* Webservice getter : get product features association
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getWsProductFeatures()
|
||||
public function getWsRoomTypeFeatures()
|
||||
{
|
||||
$rows = $this->getFeatures();
|
||||
foreach ($rows as $keyrow => $row) {
|
||||
foreach ($row as $keyfeature => $feature) {
|
||||
if ($keyfeature == 'id_feature') {
|
||||
$rows[$keyrow]['id'] = $feature;
|
||||
unset($rows[$keyrow]['id_feature']);
|
||||
}
|
||||
unset($rows[$keyrow]['id_product']);
|
||||
unset($rows[$keyrow]['custom']);
|
||||
}
|
||||
asort($rows[$keyrow]);
|
||||
}
|
||||
return $rows;
|
||||
$result = Db::getInstance()->executeS(
|
||||
'SELECT `id_feature` AS id FROM `'._DB_PREFIX_.'feature_product`
|
||||
WHERE `id_product` = '.(int)$this->id
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Webservice setter : set product features association
|
||||
*
|
||||
* @param $product_features Product Feature ids
|
||||
* @return bool
|
||||
*/
|
||||
public function setWsProductFeatures($product_features)
|
||||
*/
|
||||
public function setWsRoomTypeFeatures($product_features)
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'feature_product`
|
||||
WHERE `id_product` = '.(int)$this->id
|
||||
);
|
||||
|
||||
foreach ($product_features as $product_feature) {
|
||||
$this->addFeaturesToDB($product_feature['id'], $product_feature['id_feature_value']);
|
||||
if ($featureValues = FeatureValue::getFeatureValuesWithLang(
|
||||
Configuration::get('PS_LANG_DEFAULT'),
|
||||
$product_feature['id']
|
||||
)) {
|
||||
$idFeatureValue = $featureValues[0]['id_feature_value'];
|
||||
$this->addFeaturesToDB($product_feature['id'], $idFeatureValue);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -5106,7 +5108,6 @@ class ProductCore extends ObjectModel
|
||||
|
||||
/**
|
||||
* Webservice setter : set virtual field default combination
|
||||
*
|
||||
* @param int $id_combination id default combination
|
||||
* @return bool
|
||||
*/
|
||||
@@ -5450,11 +5451,10 @@ class ProductCore extends ObjectModel
|
||||
return Db::getInstance()->delete('product_tag', 'id_product = '.(int)$this->id);
|
||||
}
|
||||
|
||||
|
||||
public function getWsManufacturerName()
|
||||
{
|
||||
return Manufacturer::getNameById((int)$this->id_manufacturer);
|
||||
}
|
||||
// public function getWsManufacturerName()
|
||||
// {
|
||||
// return Manufacturer::getNameById((int)$this->id_manufacturer);
|
||||
// }
|
||||
|
||||
public static function resetEcoTax()
|
||||
{
|
||||
@@ -5761,12 +5761,40 @@ class ProductCore extends ObjectModel
|
||||
return Db::getInstance()->getValue($query);
|
||||
}
|
||||
|
||||
// set room type info for room type maping
|
||||
public function setWsRoomTypeInfo()
|
||||
{
|
||||
if ($this->id) {
|
||||
// delete previous
|
||||
Db::getInstance()->execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'htl_room_type`
|
||||
WHERE `id_product` = '.(int)$this->id
|
||||
);
|
||||
|
||||
// save room type info adult, child, hotel info
|
||||
$postData = trim(file_get_contents('php://input'));
|
||||
libxml_use_internal_errors(true);
|
||||
$xml = simplexml_load_string(utf8_decode($postData));
|
||||
|
||||
$roomtypeData = Tools::jsonDecode(Tools::jsonEncode($xml), true);
|
||||
|
||||
// set room map info for the hotel from request
|
||||
return Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'htl_room_type` (`id_product`, `id_hotel`, `adult`, `children`, `date_add`, `date_upd`) VALUES ('.(int)$this->id.', '.(int) $roomtypeData['room_type']['id_hotel'].', '.(int) $roomtypeData['room_type']['adults'].', '.(int) $roomtypeData['room_type']['children'].', \''.date('Y-m-d h:i:s').'\', \''.date('Y-m-d h:i:s').'\')');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function addWs($autodate = true, $null_values = false)
|
||||
{
|
||||
$success = $this->add($autodate, $null_values);
|
||||
if ($success && Configuration::get('PS_SEARCH_INDEXATION')) {
|
||||
Search::indexation(false, $this->id);
|
||||
if ($success = $this->add($autodate, $null_values)) {
|
||||
if (Configuration::get('PS_SEARCH_INDEXATION')) {
|
||||
Search::indexation(false, $this->id);
|
||||
}
|
||||
|
||||
$this->setWsRoomTypeInfo();
|
||||
}
|
||||
|
||||
return $success;
|
||||
}
|
||||
|
||||
@@ -5776,6 +5804,9 @@ class ProductCore extends ObjectModel
|
||||
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;
|
||||
}
|
||||
@@ -6144,4 +6175,105 @@ class ProductCore extends ObjectModel
|
||||
return Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'product p
|
||||
'.Shop::addSqlAssociation('product', 'p').' SET product_shop.pack_stock_type = '.(int)$pack_stock_type.' WHERE p.`id_product` = '.(int)$id_product);
|
||||
}
|
||||
|
||||
// Webservice funcions
|
||||
public function getWsHotelRooms()
|
||||
{
|
||||
return Db::getInstance()->executeS(
|
||||
'SELECT `id` FROM `'._DB_PREFIX_.'htl_room_information` WHERE `id_product` = '.(int)$this->id.' ORDER BY `id` ASC'
|
||||
);
|
||||
}
|
||||
|
||||
public function getWsFeaturePrices()
|
||||
{
|
||||
return Db::getInstance()->executeS(
|
||||
'SELECT `id_feature_price` as `id` FROM `'._DB_PREFIX_.'htl_room_type_feature_pricing` WHERE `id_product` = '.(int)$this->id.' ORDER BY `id` ASC'
|
||||
);
|
||||
}
|
||||
|
||||
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'
|
||||
);
|
||||
}
|
||||
|
||||
public function getWsHotel()
|
||||
{
|
||||
return Db::getInstance()->getValue(
|
||||
'SELECT `id_hotel` FROM `'._DB_PREFIX_.'htl_room_type` WHERE `id_product` = '.(int)$this->id.' ORDER BY `id` ASC'
|
||||
);
|
||||
}
|
||||
|
||||
public function getWsAdults()
|
||||
{
|
||||
return Db::getInstance()->getValue(
|
||||
'SELECT `adult` FROM `'._DB_PREFIX_.'htl_room_type` WHERE `id_product` = '.(int)$this->id.' ORDER BY `id` ASC'
|
||||
);
|
||||
}
|
||||
|
||||
public function getWsChildren()
|
||||
{
|
||||
return Db::getInstance()->getValue(
|
||||
'SELECT `children` FROM `'._DB_PREFIX_.'htl_room_type` WHERE `id_product` = '.(int)$this->id.' ORDER BY `id` ASC'
|
||||
);
|
||||
}
|
||||
|
||||
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
|
||||
);
|
||||
}
|
||||
|
||||
public function getWsRoomTypeAdvancePayment()
|
||||
{
|
||||
return Db::getInstance()->getValue(
|
||||
'SELECT `id` FROM `'._DB_PREFIX_.'htl_advance_payment` WHERE `id_product` = '.(int)$this->id
|
||||
);
|
||||
}
|
||||
|
||||
public function setWsChildren($children)
|
||||
{
|
||||
if ($this->id) {
|
||||
return Db::getInstance()->execute(
|
||||
'UPDATE `'._DB_PREFIX_.'htl_room_type` '.'
|
||||
SET `children` = '.(int) $children.'
|
||||
WHERE `id_product` = '.(int)$this->id
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function setWsAdults($adults)
|
||||
{
|
||||
if ($this->id) {
|
||||
return Db::getInstance()->execute(
|
||||
'UPDATE `'._DB_PREFIX_.'htl_room_type` '.'
|
||||
SET `adults` = '.(int) $adults.'
|
||||
WHERE `id_product` = '.(int)$this->id
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function setWsHotel($idHotel)
|
||||
{
|
||||
if ($this->id) {
|
||||
return Db::getInstance()->execute(
|
||||
'UPDATE `'._DB_PREFIX_.'htl_room_type` '.'
|
||||
SET `id_hotel` = '.(int) $idHotel.'
|
||||
WHERE `id_product` = '.(int)$this->id
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function deleteWs()
|
||||
{
|
||||
return $this->delete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,8 +135,8 @@ class ProductDownloadCore extends ObjectModel
|
||||
return false;
|
||||
}
|
||||
|
||||
return unlink(_PS_DOWNLOAD_DIR_.$this->filename)
|
||||
&& Db::getInstance()->delete('product_download', 'id_product_download = '.(int)$id_product_download);
|
||||
return Tools::deleteFile(_PS_DOWNLOAD_DIR_.$this->filename)
|
||||
&& Db::getInstance()->delete('product_download', 'id_product_download = '.(int)$id_product_download);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -149,7 +149,7 @@ class ProductDownloadCore extends ObjectModel
|
||||
if (!$this->filename) {
|
||||
return false;
|
||||
}
|
||||
return file_exists(_PS_DOWNLOAD_DIR_.$this->filename);
|
||||
return (bool)Tools::file_get_contents(__PS_BASE_URI__.'download/'.$this->filename);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -776,7 +776,7 @@ class FrontControllerCore extends Controller
|
||||
header('HTTP/1.1 503 temporarily overloaded');
|
||||
$this->context->smarty->assign(array(
|
||||
'shop_name' => $this->context->shop->name,
|
||||
'favicon_url' => _PS_IMG_.Configuration::get('PS_FAVICON'),
|
||||
'favicon_url' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_FAVICON')),
|
||||
'logo_url' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_LOGO'))
|
||||
));
|
||||
$this->smartyOutputContent($this->getTemplatePath($this->getThemeDir().'restricted-country.tpl'));
|
||||
@@ -1630,7 +1630,7 @@ class FrontControllerCore extends Controller
|
||||
}
|
||||
|
||||
return array(
|
||||
'favicon_url' => _PS_IMG_.Configuration::get('PS_FAVICON'),
|
||||
'favicon_url' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_FAVICON')),
|
||||
'logo_image_width' => ($mobile_device == false ? Configuration::get('SHOP_LOGO_WIDTH') : Configuration::get('SHOP_LOGO_MOBILE_WIDTH')),
|
||||
'logo_image_height' => ($mobile_device == false ? Configuration::get('SHOP_LOGO_HEIGHT') : Configuration::get('SHOP_LOGO_MOBILE_HEIGHT')),
|
||||
'logo_url' => $logo
|
||||
|
||||
@@ -296,6 +296,13 @@ class HelperListCore extends Helper
|
||||
$path_to_image = _PS_IMG_DIR_.$params['image'].'/'.Image::getImgFolderStatic($tr['id_image']).(int)$tr['id_image'].'.'.$this->imageType;
|
||||
}
|
||||
$this->_list[$index][$key] = ImageManager::thumbnail($path_to_image, $this->table.'_mini_'.$item_id.'_'.$this->context->shop->id.'.'.$this->imageType, 45, $this->imageType);
|
||||
|
||||
// @todo find way to use media link insted of hook
|
||||
// by webkul for overriding images field if using media server.
|
||||
Hook::exec(
|
||||
'actionRenderListImageModifier',
|
||||
array('key' => $key, 'field' => $params, 'item_id' => $item_id, 'image_type' => $this->imageType, 'list' => &$this->_list[$index])
|
||||
);
|
||||
} elseif (isset($params['icon']) && isset($tr[$key]) && (isset($params['icon'][$tr[$key]]) || isset($params['icon']['default']))) {
|
||||
if (!$this->bootstrap) {
|
||||
if (isset($params['icon'][$tr[$key]]) && is_array($params['icon'][$tr[$key]])) {
|
||||
|
||||
@@ -1655,6 +1655,8 @@ abstract class ModuleCore
|
||||
$untrusted_modules_list_content = Tools::file_get_contents(_PS_ROOT_DIR_.self::CACHE_FILE_UNTRUSTED_MODULES_LIST);
|
||||
}
|
||||
|
||||
$objModule = Module::getInstanceByName($module_name);
|
||||
|
||||
// If the module is trusted, which includes both partner modules and modules bought on Addons
|
||||
|
||||
if (stripos($trusted_modules_list_content, $module_name) !== false) {
|
||||
@@ -1667,6 +1669,9 @@ abstract class ModuleCore
|
||||
}
|
||||
// The module seems to be trusted, but it does not seem to be dedicated to this country
|
||||
return 2;
|
||||
// Check if module is from webkul then it will be considered as trusted module
|
||||
} elseif (isset($objModule->author) && (strtolower($objModule->author) == 'webkul')) {
|
||||
return 1;
|
||||
} elseif (stripos($untrusted_modules_list_content, $module_name) !== false) {
|
||||
// If the module is already in the untrusted list, then return 0 (untrusted)
|
||||
return 0;
|
||||
|
||||
@@ -30,6 +30,9 @@ class OrderCore extends ObjectModel
|
||||
const ROUND_LINE = 2;
|
||||
const ROUND_TOTAL = 3;
|
||||
|
||||
// payment type for the customer on checkout page
|
||||
const ORDER_PAYMENT_TYPE_FULL = 1;
|
||||
const ORDER_PAYMENT_TYPE_ADVANCE = 2;
|
||||
|
||||
/** @var int Delivery address id */
|
||||
public $id_address_delivery;
|
||||
@@ -174,6 +177,16 @@ class OrderCore extends ObjectModel
|
||||
*/
|
||||
public $round_type;
|
||||
|
||||
/**
|
||||
* @var int is_advance_payment used to determine if this order is paid as advance payment or full payment
|
||||
*/
|
||||
public $is_advance_payment;
|
||||
|
||||
/**
|
||||
* @var int advance_paid_amount used to save paid amount for the advance payment
|
||||
*/
|
||||
public $advance_paid_amount;
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
@@ -189,7 +202,7 @@ class OrderCore extends ObjectModel
|
||||
'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'id_lang' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_carrier' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_carrier' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'current_state' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'secure_key' => array('type' => self::TYPE_STRING, 'validate' => 'isMd5'),
|
||||
'payment' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true),
|
||||
@@ -225,6 +238,8 @@ class OrderCore extends ObjectModel
|
||||
'source' => array('type' => self::TYPE_STRING),
|
||||
'valid' => array('type' => self::TYPE_BOOL),
|
||||
'reference' => array('type' => self::TYPE_STRING),
|
||||
'is_advance_payment' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'default' => 0),
|
||||
'advance_paid_amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
),
|
||||
@@ -249,31 +264,36 @@ class OrderCore extends ObjectModel
|
||||
'module' => array('required' => true),
|
||||
'invoice_number' => array(),
|
||||
'invoice_date' => array(),
|
||||
'delivery_number' => array(),
|
||||
'delivery_date' => array(),
|
||||
// 'delivery_number' => array(),
|
||||
// 'delivery_date' => array(),
|
||||
'valid' => array(),
|
||||
'date_add' => array(),
|
||||
'date_upd' => array(),
|
||||
'shipping_number' => array(
|
||||
'getter' => 'getWsShippingNumber',
|
||||
'setter' => 'setWsShippingNumber'
|
||||
),
|
||||
// 'shipping_number' => array(
|
||||
// 'getter' => 'getWsShippingNumber',
|
||||
// 'setter' => 'setWsShippingNumber'
|
||||
// ),
|
||||
),
|
||||
'associations' => array(
|
||||
'order_rows' => array('resource' => 'order_row', 'setter' => false, 'virtual_entity' => true,
|
||||
'fields' => array(
|
||||
'id' => array(),
|
||||
'product_id' => array('required' => true),
|
||||
'product_attribute_id' => array('required' => true),
|
||||
'product_quantity' => array('required' => true),
|
||||
'product_name' => array('setter' => false),
|
||||
'product_reference' => array('setter' => false),
|
||||
'product_ean13' => array('setter' => false),
|
||||
'product_upc' => array('setter' => false),
|
||||
'product_price' => array('setter' => false),
|
||||
'unit_price_tax_incl' => array('setter' => false),
|
||||
'unit_price_tax_excl' => array('setter' => false),
|
||||
)),
|
||||
// 'order_rows' => array('resource' => 'order_row', 'setter' => false, 'virtual_entity' => true,
|
||||
// 'fields' => array(
|
||||
// 'id' => array(),
|
||||
// 'product_id' => array('required' => true),
|
||||
// 'product_attribute_id' => array('required' => true),
|
||||
// 'product_quantity' => array('required' => true),
|
||||
// 'product_name' => array('setter' => false),
|
||||
// 'product_reference' => array('setter' => false),
|
||||
// 'product_ean13' => array('setter' => false),
|
||||
// 'product_upc' => array('setter' => false),
|
||||
// 'product_price' => array('setter' => false),
|
||||
// 'unit_price_tax_incl' => array('setter' => false),
|
||||
// 'unit_price_tax_excl' => array('setter' => false),
|
||||
// )),
|
||||
'bookings' => array(
|
||||
'resource' => 'booking',
|
||||
'setter' => false,
|
||||
'virtual_entity' => true
|
||||
),
|
||||
),
|
||||
|
||||
);
|
||||
@@ -1155,15 +1175,18 @@ class OrderCore extends ObjectModel
|
||||
|
||||
/**
|
||||
* Can this order be returned by the client?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
*/
|
||||
public function isReturnable()
|
||||
{
|
||||
if (Configuration::get('PS_ORDER_RETURN', null, null, $this->id_shop) && $this->isPaidAndShipped()) {
|
||||
return $this->getNumberOfDays();
|
||||
}
|
||||
$objBookingDetail = new HotelBookingDetail();
|
||||
if ($bookingInfo = $objBookingDetail->getBookingDataByOrderId($this->id)) {
|
||||
$idHotel = reset($bookingInfo)['id_hotel'];
|
||||
$objHotelBranch = new HotelBranchInformation($idHotel);
|
||||
|
||||
// check if global as well as hotel refund is allowed
|
||||
return (Configuration::get('WK_ORDER_REFUND_ALLOWED') && $objHotelBranch->active_refund);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2441,4 +2464,55 @@ class OrderCore extends ObjectModel
|
||||
{
|
||||
return Db::getInstance()->executeS('SELECT * FROM '._DB_PREFIX_.'orders WHERE id_cart = '.(int)$id_cart);
|
||||
}
|
||||
|
||||
// Order is considered as refunded if all bookings are requested for refund and all are with refunded status
|
||||
// $refundFlag [ORDER_RETURN_STATE_FLAG_REFUNDED || ORDER_RETURN_STATE_FLAG_DENIED]
|
||||
public function hasCompletelyRefunded($refundFlag = 0)
|
||||
{
|
||||
if ($refundBookings = OrderReturn::getOrdersReturnDetail($this->id)) {
|
||||
$objHotelBooking = new HotelBookingdetail();
|
||||
if ($orderBookings = $objHotelBooking->getOrderCurrentDataByOrderId($this->id)) {
|
||||
if (count($refundBookings) == count($orderBookings)) {
|
||||
if ($refundFlag) {
|
||||
foreach ($refundBookings as $refundRow) {
|
||||
if (Validate::isLoadedObject(
|
||||
$objReturnState = new OrderReturnState($refundRow['current_state']
|
||||
))) {
|
||||
if ($refundFlag == OrderReturnState::ORDER_RETURN_STATE_FLAG_REFUNDED
|
||||
&& !$objReturnState->refunded
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
if ($refundFlag == OrderReturnState::ORDER_RETURN_STATE_FLAG_DENIED
|
||||
&& !$objReturnState->denied
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Order is considered as denied if all bookings are requested for refund and all are with denied status
|
||||
public function orderRefundHasBeenDenied()
|
||||
{
|
||||
if (OrderReturn::getOrdersReturn($this->id_customer, $this->id)) {
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getWsBookings()
|
||||
{
|
||||
return Db::getInstance()->executeS(
|
||||
'SELECT `id` FROM `'._DB_PREFIX_.'htl_booking_detail` WHERE `id_order` = '.(int)$this->id.' ORDER BY `id` ASC'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ class OrderHistoryCore extends ObjectModel
|
||||
$employee = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// foreach products of the order
|
||||
foreach ($order->getProductsDetail() as $product) {
|
||||
|
||||
@@ -26,21 +26,28 @@
|
||||
|
||||
class OrderReturnCore extends ObjectModel
|
||||
{
|
||||
/** @var int */
|
||||
public $id;
|
||||
|
||||
/** @var int */
|
||||
public $id_customer;
|
||||
|
||||
/** @var int */
|
||||
public $id_order;
|
||||
|
||||
/** @var int */
|
||||
/** @var string id of the refund transaction */
|
||||
public $id_transaction;
|
||||
/** @var string payment mode of the refund transaction */
|
||||
public $payment_mode;
|
||||
/** @var float amount of the refund transaction */
|
||||
public $refunded_amount;
|
||||
|
||||
/** @var int current state of the refund*/
|
||||
public $state;
|
||||
|
||||
/** @var string message content */
|
||||
public $question;
|
||||
|
||||
/** @var int if request raised by the admin */
|
||||
public $by_admin;
|
||||
|
||||
/** @var string Object creation date */
|
||||
public $date_add;
|
||||
|
||||
@@ -54,12 +61,16 @@ class OrderReturnCore extends ObjectModel
|
||||
'table' => 'order_return',
|
||||
'primary' => 'id_order_return',
|
||||
'fields' => array(
|
||||
'id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'question' => array('type' => self::TYPE_HTML, 'validate' => 'isCleanHtml'),
|
||||
'state' => array('type' => self::TYPE_STRING),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
'id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'question' => array('type' => self::TYPE_HTML, 'validate' => 'isCleanHtml'),
|
||||
'id_transaction' => array('type' => self::TYPE_STRING),
|
||||
'payment_mode' => array('type' => self::TYPE_STRING),
|
||||
'refunded_amount' => array('type' => self::TYPE_FLOAT),
|
||||
'state' => array('type' => self::TYPE_INT),
|
||||
'by_admin' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -129,6 +140,16 @@ class OrderReturnCore extends ObjectModel
|
||||
return true;
|
||||
}
|
||||
|
||||
public function hasBeenCompleted()
|
||||
{
|
||||
if (Validate::isLoadedObject($objReturnState = new OrderReturnState($this->state))) {
|
||||
if ($objReturnState->denied || $objReturnState->refunded) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function countProduct()
|
||||
{
|
||||
if (!$data = Db::getInstance()->getRow('
|
||||
@@ -140,7 +161,73 @@ class OrderReturnCore extends ObjectModel
|
||||
return (int)($data['total']);
|
||||
}
|
||||
|
||||
public static function getOrdersReturn($customer_id, $order_id = false, $no_denied = false, Context $context = null)
|
||||
public function getOrderRefundRequestedBookings($idOrder, $idOrderReturn = 0, $onlyBookingIds = 0, $customerView = 0)
|
||||
{
|
||||
$sql = 'SELECT hbd.*, ord.* FROM `'._DB_PREFIX_.'order_return` orr';
|
||||
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'order_return_detail` ord ON (orr.`id_order_return` = ord.`id_order_return`)';
|
||||
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd ON (hbd.`id` = ord.`id_htl_booking`)';
|
||||
$sql .= ' WHERE orr.`id_order` = '.(int)$idOrder;
|
||||
|
||||
if ($idOrderReturn) {
|
||||
$sql .= ' AND ord.`id_order_return` = '.(int)$idOrderReturn;
|
||||
}
|
||||
|
||||
if ($returnDetails = Db::getInstance()->executeS($sql)) {
|
||||
if ($onlyBookingIds) {
|
||||
return array_column($returnDetails, 'id_htl_booking');
|
||||
}
|
||||
|
||||
if ($customerView) {
|
||||
$returnsCustView = array();
|
||||
}
|
||||
|
||||
$objBookingDemands = new HotelBookingDemands();
|
||||
foreach ($returnDetails as &$bookingRow) {
|
||||
$bookingRow['extra_demands_price_tax_incl'] = $objBookingDemands->getRoomTypeBookingExtraDemands(
|
||||
$bookingRow['id_order'],
|
||||
$bookingRow['id_product'],
|
||||
$bookingRow['id_room'],
|
||||
$bookingRow['date_from'],
|
||||
$bookingRow['date_to'],
|
||||
0,
|
||||
1
|
||||
);
|
||||
$bookingRow['extra_demands_price_tax_excl'] = $objBookingDemands->getRoomTypeBookingExtraDemands(
|
||||
$bookingRow['id_order'],
|
||||
$bookingRow['id_product'],
|
||||
$bookingRow['id_room'],
|
||||
$bookingRow['date_from'],
|
||||
$bookingRow['date_to'],
|
||||
0,
|
||||
1,
|
||||
0
|
||||
);
|
||||
if ($customerView) {
|
||||
$dateJoin = $bookingRow['id_product'].'_'.strtotime($bookingRow['date_from']).strtotime($bookingRow['date_to']);
|
||||
if (isset($returnsCustView[$dateJoin]['num_rooms'])) {
|
||||
$returnsCustView[$dateJoin]['num_rooms'] += 1;
|
||||
$returnsCustView[$dateJoin]['refunded_amount'] += $bookingRow['refunded_amount'];
|
||||
$returnsCustView[$dateJoin]['total_price_tax_incl'] += $bookingRow['total_price_tax_incl'];
|
||||
$returnsCustView[$dateJoin]['total_paid_amount'] += $bookingRow['total_paid_amount'];
|
||||
$returnsCustView[$dateJoin]['extra_demands_price_tax_incl'] += $bookingRow['extra_demands_price_tax_incl'];
|
||||
$returnsCustView[$dateJoin]['extra_demands_price_tax_excl'] += $bookingRow['extra_demands_price_tax_excl'];
|
||||
} else {
|
||||
unset($bookingRow['id_room']);
|
||||
unset($bookingRow['room_num']);
|
||||
unset($bookingRow['id_htl_booking']);
|
||||
$returnsCustView[$dateJoin] = $bookingRow;
|
||||
$returnsCustView[$dateJoin]['num_rooms'] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($customerView) {
|
||||
return $returnsCustView;
|
||||
}
|
||||
}
|
||||
return $returnDetails;
|
||||
}
|
||||
|
||||
public static function getOrdersReturn($customer_id, $order_id = false, $no_denied = false, $only_customer = 0, Context $context = null)
|
||||
{
|
||||
if (!$context) {
|
||||
$context = Context::getContext();
|
||||
@@ -148,27 +235,41 @@ class OrderReturnCore extends ObjectModel
|
||||
$data = Db::getInstance()->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'order_return`
|
||||
WHERE `id_customer` = '.(int)$customer_id.
|
||||
WHERE `id_customer` = '.(int)$customer_id.
|
||||
($only_customer ? ' AND `by_admin` = 0' : '').
|
||||
($order_id ? ' AND `id_order` = '.(int)$order_id : '').
|
||||
($no_denied ? ' AND `state` != 4' : '').'
|
||||
ORDER BY `date_add` DESC');
|
||||
foreach ($data as $k => $or) {
|
||||
$state = new OrderReturnState($or['state']);
|
||||
$data[$k]['state_name'] = $state->name[$context->language->id];
|
||||
$data[$k]['type'] = 'Return';
|
||||
$data[$k]['tracking_number'] = $or['id_order_return'];
|
||||
$data[$k]['can_edit'] = false;
|
||||
$data[$k]['state_color'] = $state->color;
|
||||
$data[$k]['reference'] = Order::getUniqReferenceOf($or['id_order']);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function getOrdersReturnDetail($id_order_return)
|
||||
public static function getOrdersReturnDetail($idOrder, $idOrderReturn = 0, $idHtlBooking = 0, $idLang = 0)
|
||||
{
|
||||
return Db::getInstance()->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'order_return_detail`
|
||||
WHERE `id_order_return` = '.(int)$id_order_return);
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
$sql = 'SELECT orr.*, ord.*, orsl.`name`, ors.`refunded`, ors.`denied`, ors.`color` FROM `'._DB_PREFIX_.'order_return` orr';
|
||||
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'order_return_detail` ord ON (orr.`id_order_return` = ord.`id_order_return`)';
|
||||
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'order_return_state` ors ON (orr.`state` = ors.`id_order_return_state`)';
|
||||
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'order_return_state_lang` orsl ON (ors.`id_order_return_state` = orsl.`id_order_return_state` AND orsl.`id_lang` = '.(int)$idLang.')';
|
||||
$sql .= ' WHERE orr.`id_order` = '.(int)$idOrder;
|
||||
|
||||
if ($idOrderReturn) {
|
||||
$sql .= ' AND ord.`id_order_return` = '.(int)$idOrderReturn;
|
||||
}
|
||||
|
||||
if ($idHtlBooking) {
|
||||
$sql .= ' AND ord.`id_htl_booking` = '.(int)$idHtlBooking;
|
||||
}
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -268,4 +369,227 @@ class OrderReturnCore extends ObjectModel
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the new order return state
|
||||
* @param int $newOrderReturnState
|
||||
* @param int/object $idOrderReturn
|
||||
*/
|
||||
public function changeIdOrderReturnState($newOrderReturnState, $idOrderReturn, $idLang = 0)
|
||||
{
|
||||
if (Validate::isLoadedObject($objOrderReturn = new OrderReturn((int)$idOrderReturn))) {
|
||||
$objOrder = new Order($objOrderReturn->id_order);
|
||||
|
||||
if (!$idLang) {
|
||||
$idLang = $objOrder->id_lang;
|
||||
}
|
||||
if (Validate::isLoadedObject(
|
||||
$objOrderReturnState = new OrderReturnState((int)$newOrderReturnState, $idLang)
|
||||
)) {
|
||||
if ($objOrderReturn->state != $newOrderReturnState) {
|
||||
$objOrderReturn->state = $newOrderReturnState;
|
||||
$objOrderReturn->save();
|
||||
|
||||
if ($objOrderReturnState->send_email_to_customer
|
||||
|| $objOrderReturnState->send_email_to_superadmin
|
||||
|| $objOrderReturnState->send_email_to_employee
|
||||
|| $objOrderReturnState->send_email_to_hotelier
|
||||
) {
|
||||
// Lets create data for the email templates
|
||||
$objMail = new Mail();
|
||||
$idHotel = 0;
|
||||
|
||||
$data = array (
|
||||
'{status_name}' => $objOrderReturnState->name,
|
||||
'{status_color}' => $objOrderReturnState->color,
|
||||
'{order_reference}' => $objOrder->reference,
|
||||
'{order_date}' => date('Y-m-d h:i:s', strtotime($objOrder->date_add)),
|
||||
'{refunded_amount}' => Tools::displayPrice($objOrderReturn->refunded_amount, new Currency($objOrder->id_currency)),
|
||||
'{payment_mode}' => $objOrderReturn->payment_mode,
|
||||
'{id_transaction}' => $objOrderReturn->id_transaction,
|
||||
);
|
||||
|
||||
// if mail is true for the customer then send mail to customer with selected template
|
||||
$objCustomer = new Customer($objOrderReturn->id_customer);
|
||||
if ($objOrderReturnState->send_email_to_customer && $objOrderReturnState->customer_template) {
|
||||
if ($refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings(
|
||||
$objOrderReturn->id_order,
|
||||
$objOrderReturn->id,
|
||||
0,
|
||||
1
|
||||
)) {
|
||||
$idHotel = reset($refundReqBookings)['id_hotel'];
|
||||
}
|
||||
|
||||
$refBookHtml = $objMail->getEmailTemplateContent('refund_request_detail_customer', Mail::TYPE_HTML, $refundReqBookings);
|
||||
$refBookTxt = $objMail->getEmailTemplateContent('refund_request_detail_customer', Mail::TYPE_TEXT, $refundReqBookings);
|
||||
|
||||
$data['{refundBookingHtml}'] = $refBookHtml;
|
||||
$data['{refundBookingTxt}'] = $refBookTxt;
|
||||
|
||||
// send customer information
|
||||
$link = new Link();
|
||||
$data['{refund_reqests_url}'] = $link->getPageLink('order-follow');
|
||||
$data['{firstname}'] = $objCustomer->firstname;
|
||||
$data['{lastname}'] = $objCustomer->lastname;
|
||||
|
||||
Mail::Send(
|
||||
(int)$idLang,
|
||||
$objOrderReturnState->customer_template,
|
||||
$objOrderReturnState->name,
|
||||
$data,
|
||||
$objCustomer->email,
|
||||
$objCustomer->firstname.' '.$objCustomer->lastname,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
_PS_MAIL_DIR_,
|
||||
false,
|
||||
(int)$objOrder->id_shop
|
||||
);
|
||||
}
|
||||
|
||||
if ($objOrderReturnState->admin_template) {
|
||||
if ($refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings(
|
||||
$objOrderReturn->id_order,
|
||||
$objOrderReturn->id
|
||||
)) {
|
||||
$idHotel = $refundReqBookings[0]['id_hotel'];
|
||||
}
|
||||
|
||||
$refBookHtml = $objMail->getEmailTemplateContent('refund_request_detail_admin', Mail::TYPE_HTML, $refundReqBookings);
|
||||
$refBookTxt = $objMail->getEmailTemplateContent('refund_request_detail_admin', Mail::TYPE_TEXT, $refundReqBookings);
|
||||
|
||||
$data['{cancelation_reason}'] = $objOrderReturn->question;
|
||||
$data['{refundBookingHtml}'] = $refBookHtml;
|
||||
$data['{refundBookingTxt}'] = $refBookTxt;
|
||||
|
||||
// send mail to the super admin
|
||||
if ($objOrderReturnState->send_email_to_superadmin) {
|
||||
// send superadmin information
|
||||
if (Validate::isLoadedObject($superAdmin = new Employee(_PS_ADMIN_PROFILE_))) {
|
||||
if (Validate::isEmail($superAdmin->email)) {
|
||||
$data['{customer_name}'] = $objCustomer->firstname.' '.$objCustomer->lastname;
|
||||
$data['{customer_email}'] = $objCustomer->email;
|
||||
$data['{firstname}'] = $superAdmin->firstname;
|
||||
$data['{lastname}'] = $superAdmin->lastname;
|
||||
|
||||
Mail::Send(
|
||||
(int)$idLang,
|
||||
$objOrderReturnState->admin_template,
|
||||
$objOrderReturnState->name,
|
||||
$data,
|
||||
$superAdmin->email,
|
||||
$superAdmin->firstname.' '.$superAdmin->lastname,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
_PS_MAIL_DIR_,
|
||||
false,
|
||||
(int)$objOrder->id_shop
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($idHotel
|
||||
&& Validate::isLoadedObject($objHotel = new HotelBranchInformation($idHotel))
|
||||
) {
|
||||
// send mail to the hotelier
|
||||
if ($objOrderReturnState->send_email_to_hotelier) {
|
||||
$data['{customer_name}'] = $objCustomer->firstname.' '.$objCustomer->lastname;
|
||||
$data['{customer_email}'] = $objCustomer->email;
|
||||
$data['{firstname}'] = '';
|
||||
$data['{lastname}'] = '';
|
||||
$data['{email}'] = $objHotel->email;
|
||||
|
||||
Mail::Send(
|
||||
(int)$idLang,
|
||||
$objOrderReturnState->admin_template,
|
||||
$objOrderReturnState->name,
|
||||
$data,
|
||||
$objHotel->email,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
_PS_MAIL_DIR_,
|
||||
false,
|
||||
(int)$objOrder->id_shop
|
||||
);
|
||||
}
|
||||
|
||||
// send mail to the employee
|
||||
if ($objOrderReturnState->send_email_to_employee) {
|
||||
if ($htlAccesses = $objHotel->getHotelAccess($idHotel)) {
|
||||
$data['{customer_name}'] = $objCustomer->firstname.' '.$objCustomer->lastname;
|
||||
$data['{customer_email}'] = $objCustomer->email;
|
||||
foreach ($htlAccesses as $access) {
|
||||
if ($access['id_profile'] != _PS_ADMIN_PROFILE_) {
|
||||
if ($htlEmployees = Employee::getEmployeesByProfile($access['id_profile'])) {
|
||||
foreach ($htlEmployees as $empl) {
|
||||
if (Validate::isEmail($empl['email'])) {
|
||||
// send hotel manager (employee) have permission for this hotel
|
||||
$data['{firstname}'] = $empl['firstname'];
|
||||
$data['{lastname}'] = $empl['lastname'];
|
||||
$data['{email}'] = $empl['email'];
|
||||
|
||||
Mail::Send(
|
||||
(int)$idLang,
|
||||
$objOrderReturnState->admin_template,
|
||||
$objOrderReturnState->name,
|
||||
$data,
|
||||
$empl['email'],
|
||||
$empl['firstname'].' '.$empl['lastname'],
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
_PS_MAIL_DIR_,
|
||||
false,
|
||||
(int)$objOrder->id_shop
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// executes hook
|
||||
Hook::exec(
|
||||
'actionOrderReFundStatusPostUpdate',
|
||||
array(
|
||||
'new_order_return_status' => $newOrderReturnState,
|
||||
'id_order_return' => (int)$idOrderReturn
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getRefundedAmount($idOrder, $idOrderReturn = 0, $idHtlBooking = 0)
|
||||
{
|
||||
$sql = 'SELECT SUM(ord.`refunded_amount`) FROM `'._DB_PREFIX_.'order_return_detail` ord';
|
||||
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'order_return` orr ON (orr.`id_order_return` = ord.`id_order_return`)';
|
||||
$sql .= ' WHERE orr.`id_order` = '.(int)$idOrder;
|
||||
|
||||
if ($idOrderReturn) {
|
||||
$sql .= ' AND ord.`id_order_return` = '.(int)$idOrderReturn;
|
||||
}
|
||||
|
||||
if ($idHtlBooking) {
|
||||
$sql .= ' AND ord.`id_htl_booking` = '.(int)$idHtlBooking;
|
||||
}
|
||||
|
||||
return Db::getInstance()->getValue($sql);
|
||||
}
|
||||
}
|
||||
|
||||
51
classes/order/OrderReturnDetail.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* 2010-2020 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 2010-2020 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
class OrderReturnDetailCore extends ObjectModel
|
||||
{
|
||||
/** @var int */
|
||||
public $id_order_return;
|
||||
|
||||
/** @var int */
|
||||
public $id_htl_booking;
|
||||
|
||||
/** @var float amount of the refund transaction */
|
||||
public $refunded_amount;
|
||||
|
||||
public $id_order_detail;
|
||||
public $id_customization;
|
||||
public $product_quantity;
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
public static $definition = array(
|
||||
'table' => 'order_return_detail',
|
||||
'primary' => 'id_order_return_detail',
|
||||
'fields' => array(
|
||||
'id_order_return' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_htl_booking' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_order_detail' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'default' => 0),
|
||||
'id_customization' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'default' => 0),
|
||||
'product_quantity' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'default' => 0),
|
||||
'refunded_amount' => array('type' => self::TYPE_FLOAT),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -29,9 +29,32 @@ class OrderReturnStateCore extends ObjectModel
|
||||
/** @var string Name */
|
||||
public $name;
|
||||
|
||||
/** @var string Template name if there is any e-mail to send to customer */
|
||||
public $customer_template;
|
||||
|
||||
/** @var string Template name if there is any e-mail to send to admin */
|
||||
public $admin_template;
|
||||
|
||||
/** @var string Display state in the specified color */
|
||||
public $color;
|
||||
|
||||
/** @var bool Send an e-mail to customer ? */
|
||||
public $send_email_to_customer;
|
||||
/** @var bool Send an e-mail to superadmin ? */
|
||||
public $send_email_to_superadmin;
|
||||
/** @var bool Send an e-mail to employee ? */
|
||||
public $send_email_to_employee;
|
||||
/** @var bool Send an e-mail to hotelier ? */
|
||||
public $send_email_to_hotelier;
|
||||
|
||||
/** @var bool order refund denied ? */
|
||||
public $denied;
|
||||
|
||||
/** @var bool order refunded ? */
|
||||
public $refunded;
|
||||
|
||||
public $module_name;
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
@@ -40,13 +63,27 @@ class OrderReturnStateCore extends ObjectModel
|
||||
'primary' => 'id_order_return_state',
|
||||
'multilang' => true,
|
||||
'fields' => array(
|
||||
'color' => array('type' => self::TYPE_STRING, 'validate' => 'isColor'),
|
||||
'color' => array('type' => self::TYPE_STRING, 'validate' => 'isColor'),
|
||||
'denied' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'refunded' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'send_email_to_customer' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'send_email_to_superadmin' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'send_email_to_employee' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'send_email_to_hotelier' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'module_name' => array('type' => self::TYPE_STRING),
|
||||
|
||||
/* Lang fields */
|
||||
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 64),
|
||||
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 64),
|
||||
'customer_template' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isTplName', 'size' => 64),
|
||||
'admin_template' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isTplName', 'size' => 64),
|
||||
),
|
||||
);
|
||||
|
||||
const ORDER_RETRUN_FIRST_STATUS = 1;
|
||||
|
||||
const ORDER_RETURN_STATE_FLAG_REFUNDED = 1;
|
||||
const ORDER_RETURN_STATE_FLAG_DENIED = 2;
|
||||
|
||||
/**
|
||||
* Get all available order statuses
|
||||
*
|
||||
|
||||
@@ -88,6 +88,7 @@ class OrderSlipCore extends ObjectModel
|
||||
'amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'),
|
||||
'shipping_cost' => array('type' => self::TYPE_INT),
|
||||
'shipping_cost_amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'),
|
||||
'amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'),
|
||||
'partial' => array('type' => self::TYPE_INT),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
@@ -159,23 +160,52 @@ class OrderSlipCore extends ObjectModel
|
||||
*/
|
||||
public static function getOrdersSlipProducts($orderSlipId, $order)
|
||||
{
|
||||
// by webkul :: function return is customized as per booking info
|
||||
$cart_rules = $order->getCartRules(true);
|
||||
$productsRet = OrderSlip::getOrdersSlipDetail($orderSlipId);
|
||||
$order_details = $order->getProductsDetail();
|
||||
|
||||
$slip_quantity = array();
|
||||
foreach ($productsRet as $slip_detail) {
|
||||
$slip_quantity[$slip_detail['id_order_detail']] = $slip_detail;
|
||||
$orderDetailCustom = array();
|
||||
foreach ($order_details as $orderDtl) {
|
||||
$orderDetailCustom[$orderDtl['id_order_detail']] = $orderDtl;
|
||||
}
|
||||
|
||||
$products = array();
|
||||
foreach ($order_details as $key => $product) {
|
||||
if (isset($slip_quantity[$product['id_order_detail']]) && $slip_quantity[$product['id_order_detail']]['product_quantity']) {
|
||||
$products[$key] = $product;
|
||||
$products[$key] = array_merge($products[$key], $slip_quantity[$product['id_order_detail']]);
|
||||
$slipDetails = array();
|
||||
foreach ($productsRet as &$slipRow) {
|
||||
$objHtlBooking = new HotelBookingDetail($slipRow['id_htl_booking']);
|
||||
$slipRow['product_id'] = $objHtlBooking->id_product;
|
||||
$slipRow['date_from'] = $objHtlBooking->date_from;
|
||||
$slipRow['date_to'] = $objHtlBooking->date_to;
|
||||
$slipRow['hotel_name'] = $objHtlBooking->hotel_name;
|
||||
$slipRow['product_name'] = $objHtlBooking->room_type_name;
|
||||
$slipRow['room_num'] = $objHtlBooking->room_num;
|
||||
|
||||
if (isset($orderDetailCustom[$slipRow['id_order_detail']])) {
|
||||
$slipRow = array_merge($orderDetailCustom[$slipRow['id_order_detail']], $slipRow);
|
||||
}
|
||||
|
||||
$orderProduct = $order->getProducts(array($slipRow));
|
||||
$slipRow = array_merge(reset($orderProduct), $slipRow);
|
||||
|
||||
$dateJoin = $slipRow['product_id'].'_'.strtotime($slipRow['date_from']).strtotime($slipRow['date_to']);
|
||||
if (isset($slipDetails[$dateJoin]['num_rooms'])) {
|
||||
$slipDetails[$dateJoin]['num_rooms'] += 1;
|
||||
$slipDetails[$dateJoin]['unit_price_tax_excl'] += $slipRow['unit_price_tax_excl'];
|
||||
$slipDetails[$dateJoin]['unit_price_tax_incl'] += $slipRow['unit_price_tax_incl'];
|
||||
$slipDetails[$dateJoin]['total_price_tax_excl'] += $slipRow['total_price_tax_excl'];
|
||||
$slipDetails[$dateJoin]['total_price_tax_incl'] += $slipRow['total_price_tax_incl'];
|
||||
$slipDetails[$dateJoin]['amount_tax_excl'] += $slipRow['amount_tax_excl'];
|
||||
$slipDetails[$dateJoin]['amount_tax_incl'] += $slipRow['amount_tax_incl'];
|
||||
|
||||
$slipDetails[$dateJoin]['unit_price_tax_excl'] /= $slipDetails[$dateJoin]['num_rooms'];
|
||||
$slipDetails[$dateJoin]['unit_price_tax_incl'] /= $slipDetails[$dateJoin]['num_rooms'];
|
||||
} else {
|
||||
$slipDetails[$dateJoin] = $slipRow;
|
||||
$slipDetails[$dateJoin]['num_rooms'] = 1;
|
||||
}
|
||||
}
|
||||
return $order->getProducts($products);
|
||||
|
||||
return $slipDetails;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -264,7 +294,7 @@ class OrderSlipCore extends ObjectModel
|
||||
return OrderSlip::create($order, $product_list, $shipping);
|
||||
}
|
||||
|
||||
public static function create(Order $order, $product_list, $shipping_cost = false, $amount = 0, $amount_choosen = false, $add_tax = true)
|
||||
public static function create(Order $order, $booking_list, $shipping_cost = false, $amount = 0, $amount_choosen = false, $add_tax = true)
|
||||
{
|
||||
$currency = new Currency((int)$order->id_currency);
|
||||
$order_slip = new OrderSlip();
|
||||
@@ -306,32 +336,33 @@ class OrderSlipCore extends ObjectModel
|
||||
$order_slip->{'total_products_tax_'.$inc_or_ex_1} = 0;
|
||||
$order_slip->{'total_products_tax_'.$inc_or_ex_2} = 0;
|
||||
|
||||
foreach ($product_list as &$product) {
|
||||
$order_detail = new OrderDetail((int)$product['id_order_detail']);
|
||||
$price = (float)$product['unit_price'];
|
||||
$quantity = (int)$product['quantity'];
|
||||
foreach ($booking_list as &$booking) {
|
||||
$objHtlBooking = new HotelBookingDetail($booking['id_htl_booking']);
|
||||
$order_detail = new OrderDetail((int)$objHtlBooking->id_order_detail);
|
||||
|
||||
$price = (float)$booking['unit_price'];
|
||||
$numDays = (int)$booking['num_days'];
|
||||
|
||||
$order_slip_resume = OrderSlip::getProductSlipResume((int)$order_detail->id);
|
||||
|
||||
if ($quantity + $order_slip_resume['product_quantity'] > $order_detail->product_quantity) {
|
||||
$quantity = $order_detail->product_quantity - $order_slip_resume['product_quantity'];
|
||||
if ($numDays + $order_slip_resume['product_quantity'] > $order_detail->product_quantity) {
|
||||
$numDays = $order_detail->product_quantity - $order_slip_resume['product_quantity'];
|
||||
}
|
||||
|
||||
if ($quantity == 0) {
|
||||
if ($numDays == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!Tools::isSubmit('cancelProduct') && $order->hasBeenPaid()) {
|
||||
$order_detail->product_quantity_refunded += $quantity;
|
||||
$order_detail->product_quantity_refunded += $numDays;
|
||||
}
|
||||
|
||||
$order_detail->save();
|
||||
|
||||
$address = Address::initialize($order->id_address_invoice, false);
|
||||
$id_address = (int)$address->id;
|
||||
$id_tax_rules_group = Product::getIdTaxRulesGroupByIdProduct((int)$order_detail->product_id);
|
||||
$tax_calculator = TaxManagerFactory::getManager($address, $id_tax_rules_group)->getTaxCalculator();
|
||||
|
||||
$order_slip->{'total_products_tax_'.$inc_or_ex_1} += $price * $quantity;
|
||||
$order_slip->{'total_products_tax_'.$inc_or_ex_1} += $price * $numDays;
|
||||
|
||||
if (in_array(Configuration::get('PS_ROUND_TYPE'), array(Order::ROUND_ITEM, Order::ROUND_LINE))) {
|
||||
if (!isset($total_products[$id_tax_rules_group])) {
|
||||
@@ -343,11 +374,11 @@ class OrderSlipCore extends ObjectModel
|
||||
}
|
||||
}
|
||||
|
||||
$product_tax_incl_line = Tools::ps_round($tax_calculator->{$add_or_remove.'Taxes'}($price) * $quantity, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$product_tax_incl_line = Tools::ps_round($tax_calculator->{$add_or_remove.'Taxes'}($price) * $numDays, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
|
||||
switch (Configuration::get('PS_ROUND_TYPE')) {
|
||||
case Order::ROUND_ITEM:
|
||||
$product_tax_incl = Tools::ps_round($tax_calculator->{$add_or_remove.'Taxes'}($price), _PS_PRICE_COMPUTE_PRECISION_) * $quantity;
|
||||
$product_tax_incl = Tools::ps_round($tax_calculator->{$add_or_remove.'Taxes'}($price), _PS_PRICE_COMPUTE_PRECISION_) * $numDays;
|
||||
$total_products[$id_tax_rules_group] += $product_tax_incl;
|
||||
break;
|
||||
case Order::ROUND_LINE:
|
||||
@@ -356,14 +387,14 @@ class OrderSlipCore extends ObjectModel
|
||||
break;
|
||||
case Order::ROUND_TOTAL:
|
||||
$product_tax_incl = $product_tax_incl_line;
|
||||
$total_products[$id_tax_rules_group.'_'.$id_address] += $price * $quantity;
|
||||
$total_products[$id_tax_rules_group.'_'.$id_address] += $price * $numDays;
|
||||
break;
|
||||
}
|
||||
|
||||
$product['unit_price_tax_'.$inc_or_ex_1] = $price;
|
||||
$product['unit_price_tax_'.$inc_or_ex_2] = Tools::ps_round($tax_calculator->{$add_or_remove.'Taxes'}($price), _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$product['total_price_tax_'.$inc_or_ex_1] = Tools::ps_round($price * $quantity, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$product['total_price_tax_'.$inc_or_ex_2] = Tools::ps_round($product_tax_incl, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$booking['unit_price_tax_'.$inc_or_ex_1] = $price;
|
||||
$booking['unit_price_tax_'.$inc_or_ex_2] = Tools::ps_round($tax_calculator->{$add_or_remove.'Taxes'}($price), _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$booking['total_price_tax_'.$inc_or_ex_1] = Tools::ps_round($price * $numDays, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$booking['total_price_tax_'.$inc_or_ex_2] = Tools::ps_round($product_tax_incl, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
}
|
||||
|
||||
unset($product);
|
||||
@@ -381,12 +412,11 @@ class OrderSlipCore extends ObjectModel
|
||||
|
||||
$order_slip->{'total_products_tax_'.$inc_or_ex_2} -= (float)$amount && !$amount_choosen ? (float)$amount : 0;
|
||||
$order_slip->amount = $amount_choosen ? (float)$amount : $order_slip->{'total_products_tax_'.$inc_or_ex_1};
|
||||
$order_slip->shipping_cost_amount = $order_slip->total_shipping_tax_incl;
|
||||
|
||||
if ((float)$amount && !$amount_choosen) {
|
||||
$order_slip->order_slip_type = 1;
|
||||
}
|
||||
if (((float)$amount && $amount_choosen) || $order_slip->shipping_cost_amount > 0) {
|
||||
if (((float)$amount && $amount_choosen)) {
|
||||
$order_slip->order_slip_type = 2;
|
||||
}
|
||||
|
||||
@@ -394,27 +424,26 @@ class OrderSlipCore extends ObjectModel
|
||||
return false;
|
||||
}
|
||||
|
||||
$res = true;
|
||||
|
||||
foreach ($product_list as $product) {
|
||||
$res &= $order_slip->addProductOrderSlip($product);
|
||||
foreach ($booking_list as $bookingRow) {
|
||||
$order_slip->addProductOrderSlip($bookingRow);
|
||||
}
|
||||
|
||||
return $res;
|
||||
return $order_slip->id;
|
||||
}
|
||||
|
||||
protected function addProductOrderSlip($product)
|
||||
protected function addProductOrderSlip($booking)
|
||||
{
|
||||
return Db::getInstance()->insert('order_slip_detail', array(
|
||||
'id_order_slip' => (int)$this->id,
|
||||
'id_order_detail' => (int)$product['id_order_detail'],
|
||||
'product_quantity' => $product['quantity'],
|
||||
'unit_price_tax_excl' => $product['unit_price_tax_excl'],
|
||||
'unit_price_tax_incl' => $product['unit_price_tax_incl'],
|
||||
'total_price_tax_excl' => $product['total_price_tax_excl'],
|
||||
'total_price_tax_incl' => $product['total_price_tax_incl'],
|
||||
'amount_tax_excl' => $product['total_price_tax_excl'],
|
||||
'amount_tax_incl' => $product['total_price_tax_incl']
|
||||
'id_htl_booking' => (int)$booking['id_htl_booking'],
|
||||
'id_order_detail' => (int)$booking['id_order_detail'],
|
||||
'product_quantity' => $booking['quantity'],
|
||||
'unit_price_tax_excl' => $booking['unit_price_tax_excl'],
|
||||
'unit_price_tax_incl' => $booking['unit_price_tax_incl'],
|
||||
'total_price_tax_excl' => $booking['total_price_tax_excl'],
|
||||
'total_price_tax_incl' => $booking['total_price_tax_incl'],
|
||||
'amount_tax_excl' => $booking['total_price_tax_excl'],
|
||||
'amount_tax_incl' => $booking['total_price_tax_incl']
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -321,9 +321,11 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
$customer = new Customer($this->order->id_customer);
|
||||
if (!empty($products)) {
|
||||
$processed_product = array();
|
||||
$refunded_rooms = 0;
|
||||
$cart_bk_data=array();
|
||||
$totalDemandsPrice = 0;
|
||||
|
||||
$totalDemandsPriceTE = 0;
|
||||
$totalDemandsPriceTI = 0;
|
||||
|
||||
foreach ($products as $type_key => $type_value) {
|
||||
if (in_array($type_value['product_id'], $processed_product)) {
|
||||
continue;
|
||||
@@ -331,10 +333,6 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
$processed_product[] = $type_value['product_id'];
|
||||
|
||||
$product = new Product($type_value['product_id'], false, $this->context->language->id);
|
||||
$order_prod_dtl = $obj_htl_bk_dtl->getPsOrderDetailsByProduct(
|
||||
$type_value['product_id'],
|
||||
$this->order->id
|
||||
);
|
||||
$cover_image_arr = $product->getCover($type_value['product_id']);
|
||||
|
||||
if (!empty($cover_image_arr)) {
|
||||
@@ -366,25 +364,11 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
$unit_price_tax_incl = 0;
|
||||
$unit_price_tax_excl = $order_details_obj->unit_price_tax_excl;
|
||||
$unit_price_tax_incl = $order_details_obj->unit_price_tax_incl;
|
||||
$prod_ord_dtl_name = $order_details_obj->product_name;
|
||||
$cart_htl_data[$type_key]['name'] = $prod_ord_dtl_name;
|
||||
|
||||
$cart_htl_data[$type_key]['name'] = $order_details_obj->product_name;
|
||||
$cart_htl_data[$type_key]['unit_price_tax_excl'] = $unit_price_tax_excl;
|
||||
$cart_htl_data[$type_key]['unit_price_tax_incl'] = $unit_price_tax_incl;
|
||||
//work on entring refund data
|
||||
$obj_ord_ref_info = new HotelOrderRefundInfo();
|
||||
$ord_refnd_info = $obj_ord_ref_info->getOderRefundInfoByIdOrderIdProductByDate($this->order->id, $type_value['product_id'], $data_v['date_from'], $data_v['date_to']);
|
||||
if ($ord_refnd_info) {
|
||||
$obj_refund_stages = new HotelOrderRefundStages();
|
||||
$stage_name = $obj_refund_stages->getNameById($ord_refnd_info['refund_stage_id']);
|
||||
|
||||
if ($stage_name == 'Refunded') {
|
||||
$refunded_rooms = 1;
|
||||
}
|
||||
} else {
|
||||
$stage_name = '';
|
||||
}
|
||||
// END Order Refund
|
||||
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,
|
||||
@@ -488,20 +472,15 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
}
|
||||
}
|
||||
unset($tax_temp);
|
||||
// For Advanced Payment
|
||||
$obj_customer_adv = new HotelCustomerAdvancedPayment();
|
||||
$order_adv_dtl = $obj_customer_adv->getCstAdvPaymentDtlByIdOrder($order_obj->id);
|
||||
if ($order_adv_dtl) {
|
||||
$this->smarty->assign('order_adv_dtl', $order_adv_dtl);
|
||||
}
|
||||
|
||||
// enter extra demands price to the footer total details
|
||||
$footer['total_extra_demands_ti'] = $totalDemandsPriceTI;
|
||||
$footer['total_extra_demands_te'] = $totalDemandsPriceTE;
|
||||
}
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'cart_htl_data' => $cart_htl_data,
|
||||
'refunded_rooms' => $refunded_rooms,
|
||||
'order' => $this->order,
|
||||
'order_invoice' => $this->order_invoice,
|
||||
'order_details' => $order_details,
|
||||
|
||||
@@ -75,7 +75,7 @@ class HTMLTemplateOrderReturnCore extends HTMLTemplate
|
||||
'invoice_address' => $formatted_invoice_address,
|
||||
'shop_address' => AddressFormat::generateAddress($this->shop->getAddress(), array(), '<br />', ' ')
|
||||
));
|
||||
|
||||
|
||||
$tpls = array(
|
||||
'style_tab' => $this->smarty->fetch($this->getTemplate('invoice.style-tab')),
|
||||
'addresses_tab' => $this->smarty->fetch($this->getTemplate('order-return.addresses-tab')),
|
||||
@@ -84,7 +84,7 @@ class HTMLTemplateOrderReturnCore extends HTMLTemplate
|
||||
'conditions_tab' => $this->smarty->fetch($this->getTemplate('order-return.conditions-tab')),
|
||||
);
|
||||
$this->smarty->assign($tpls);
|
||||
|
||||
|
||||
return $this->smarty->fetch($this->getTemplate('order-return'));
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ class HTMLTemplateOrderReturnCore extends HTMLTemplate
|
||||
{
|
||||
return 'invoices.pdf';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the template's HTML header
|
||||
*
|
||||
|
||||
@@ -93,14 +93,15 @@ class HTMLTemplateOrderSlipCore extends HTMLTemplateInvoice
|
||||
|
||||
if ($this->order_slip->amount > 0) {
|
||||
foreach ($this->order->products as &$product) {
|
||||
$product['total_price_tax_excl'] = $product['unit_price_tax_excl'] * $product['product_quantity'];
|
||||
$product['total_price_tax_incl'] = $product['unit_price_tax_incl'] * $product['product_quantity'];
|
||||
// $product['total_price_tax_excl'] = $product['unit_price_tax_excl'] * $product['product_quantity'];
|
||||
// $product['total_price_tax_incl'] = $product['unit_price_tax_incl'] * $product['product_quantity'];
|
||||
|
||||
if ($this->order_slip->partial == 1) {
|
||||
$order_slip_detail = Db::getInstance()->getRow('
|
||||
SELECT * FROM `'._DB_PREFIX_.'order_slip_detail`
|
||||
WHERE `id_order_slip` = '.(int)$this->order_slip->id.'
|
||||
AND `id_order_detail` = '.(int)$product['id_order_detail']);
|
||||
AND `id_order_detail` = '.(int)$product['id_order_detail'].'
|
||||
AND `id_htl_booking` = '.(int)$product['id_htl_booking']);
|
||||
|
||||
$product['total_price_tax_excl'] = $order_slip_detail['amount_tax_excl'];
|
||||
$product['total_price_tax_incl'] = $order_slip_detail['amount_tax_incl'];
|
||||
@@ -143,7 +144,6 @@ class HTMLTemplateOrderSlipCore extends HTMLTemplateInvoice
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->smarty->assign(array(
|
||||
'order' => $this->order,
|
||||
'order_slip' => $this->order_slip,
|
||||
|
||||
@@ -595,10 +595,10 @@ class WebserviceOutputBuilderCore
|
||||
}
|
||||
|
||||
$parent_details = array(
|
||||
'object_id' => $object->id,
|
||||
'entity_name' => $ws_params['objectNodeName'],
|
||||
'entities_name' => $ws_params['objectsNodeName'],
|
||||
);
|
||||
'object_id' => $object->id,
|
||||
'entity_name' => $ws_params['objectNodeName'],
|
||||
'entities_name' => $ws_params['objectsNodeName'],
|
||||
);
|
||||
|
||||
if (is_array($getter)) {
|
||||
$association_resources = call_user_func($getter, $object);
|
||||
|
||||
@@ -173,10 +173,11 @@ class WebserviceOutputXMLCore implements WebserviceOutputInterface
|
||||
}
|
||||
public function overrideContent($content)
|
||||
{
|
||||
// changed QloApps in place of prestashop
|
||||
$xml = '<?xml version="1.0" encoding="UTF-8"?>'."\n";
|
||||
$xml .= '<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">'."\n";
|
||||
$xml .= '<qloapps xmlns:xlink="http://www.w3.org/1999/xlink">'."\n";
|
||||
$xml .= $content;
|
||||
$xml .= '</prestashop>'."\n";
|
||||
$xml .= '</qloapps>'."\n";
|
||||
return $xml;
|
||||
}
|
||||
public function renderAssociationWrapperHeader()
|
||||
|
||||
@@ -285,15 +285,15 @@ class WebserviceRequestCore
|
||||
'order_states' => array('description' => 'The Order statuses','class' => 'OrderState'),
|
||||
'order_slip' => array('description' => 'The Order slips', 'class' => 'OrderSlip'),
|
||||
'price_ranges' => array('description' => 'Price ranges', 'class' => 'RangePrice'),
|
||||
'product_features' => array('description' => 'The product features','class' => 'Feature'),
|
||||
'product_feature_values' => array('description' => 'The product feature values','class' => 'FeatureValue'),
|
||||
'product_options' => array('description' => 'The product options','class' => 'AttributeGroup'),
|
||||
'product_option_values' => array('description' => 'The product options value','class' => 'Attribute'),
|
||||
'products' => array('description' => 'The products','class' => 'Product'),
|
||||
'room_type_features' => array('description' => 'The product features','class' => 'Feature'),
|
||||
'room_type_feature_values' => array('description' => 'The product feature values','class' => 'FeatureValue'),
|
||||
'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'),
|
||||
'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'),
|
||||
'tags' => array('description' => 'The Products tags','class' => 'Tag'),
|
||||
'tags' => array('description' => 'The products tags','class' => 'Tag'),
|
||||
'translated_configurations' => array('description' => 'Shop configuration', 'class' => 'TranslatedConfiguration'),
|
||||
'weight_ranges' => array('description' => 'Weight ranges', 'class' => 'RangeWeight'),
|
||||
'zones' => array('description' => 'The Countries zones','class' => 'Zone'),
|
||||
@@ -757,7 +757,7 @@ class WebserviceRequestCore
|
||||
}
|
||||
}
|
||||
if ($this->hasErrors()) {
|
||||
header('WWW-Authenticate: Basic realm="Welcome to PrestaShop Webservice, please enter the authentication key as the login. No password required."');
|
||||
header('WWW-Authenticate: Basic realm="Welcome to QloApps Webservice, please enter the authentication key as the login. No password required."');
|
||||
$this->objOutput->setStatus(401);
|
||||
return false;
|
||||
} else {
|
||||
@@ -776,7 +776,7 @@ class WebserviceRequestCore
|
||||
protected function isActivated()
|
||||
{
|
||||
if (!Configuration::get('PS_WEBSERVICE')) {
|
||||
$this->setError(503, 'The PrestaShop webservice is disabled. Please activate it in the PrestaShop Back Office', 22);
|
||||
$this->setError(503, 'The QloApps webservice is disabled. Please activate it in the QloApps Back Office', 22);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -125,6 +125,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
if ($this->output != '') {
|
||||
return $this->objOutput->getObjectRender()->overrideContent($this->output);
|
||||
}
|
||||
|
||||
// display image content if needed
|
||||
elseif ($this->imgToDisplay) {
|
||||
if (empty($this->imgExtension)) {
|
||||
@@ -283,6 +284,10 @@ 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') {
|
||||
$this->imageType = 'products';
|
||||
}
|
||||
|
||||
switch ($this->wsObject->urlSegment[1]) {
|
||||
// general images management : like header's logo, invoice logo, etc...
|
||||
@@ -294,6 +299,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
case 'manufacturers':
|
||||
case 'suppliers':
|
||||
case 'stores':
|
||||
case 'features':
|
||||
switch ($this->wsObject->urlSegment[1]) {
|
||||
case 'categories':
|
||||
$directory = _PS_CAT_IMG_DIR_;
|
||||
@@ -307,12 +313,15 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
case 'stores':
|
||||
$directory = _PS_STORE_IMG_DIR_;
|
||||
break;
|
||||
case 'features':
|
||||
$directory = _PS_IMG_DIR_.'rf/';
|
||||
break;
|
||||
}
|
||||
return $this->manageDeclinatedImages($directory);
|
||||
break;
|
||||
|
||||
// product image management : many image for one entity (product)
|
||||
case 'products':
|
||||
case 'room_types':
|
||||
return $this->manageProductImages();
|
||||
break;
|
||||
case 'customizations':
|
||||
@@ -417,7 +426,6 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
return true;
|
||||
break;
|
||||
case 'PUT':
|
||||
|
||||
if ($this->writePostedImageOnDisk($path, null, null)) {
|
||||
if ($this->wsObject->urlSegment[2] == 'header') {
|
||||
$logo_name = Configuration::get('PS_LOGO') ? Configuration::get('PS_LOGO') : 'logo.png';
|
||||
@@ -480,9 +488,8 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
{
|
||||
// Check if method is allowed
|
||||
if ($this->wsObject->method != 'GET') {
|
||||
throw new WebserviceException('This method is not allowed for listing category images.', array(55, 405));
|
||||
throw new WebserviceException('This method is not allowed for listing images.', array(55, 405));
|
||||
}
|
||||
|
||||
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('image_types', array());
|
||||
foreach ($normal_image_sizes as $image_size) {
|
||||
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('image_type', array(), array('id' => $image_size['id_image_type'], 'name' => $image_size['name'], 'xlink_resource'=>$this->wsObject->wsUrl.'image_types/'.$image_size['id_image_type']), false);
|
||||
@@ -499,7 +506,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
$ids = array_unique($ids, SORT_NUMERIC);
|
||||
asort($ids);
|
||||
foreach ($ids as $id) {
|
||||
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('image', array(), array('id' => $id, 'xlink_resource'=>$this->wsObject->wsUrl.'images/'.$this->imageType.'/'.$id), false);
|
||||
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('image', array(), array('id' => $id, 'xlink_resource'=>$this->wsObject->wsUrl.'images/'.'room_types'.'/'.$id), false);
|
||||
}
|
||||
} else {
|
||||
$nodes = scandir($directory);
|
||||
@@ -576,7 +583,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
if ($available_image_ids) {
|
||||
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('image', array(), array('id'=>$object_id));
|
||||
foreach ($available_image_ids as $available_image_id) {
|
||||
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('declination', array(), array('id'=>$available_image_id, 'xlink_resource'=>$this->wsObject->wsUrl.'images/'.$this->imageType.'/'.$object_id.'/'.$available_image_id), false);
|
||||
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('declination', array(), array('id'=>$available_image_id, 'xlink_resource'=>$this->wsObject->wsUrl.'images/'.'room_types'.'/'.$object_id.'/'.$available_image_id), false);
|
||||
}
|
||||
$this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('image', array());
|
||||
} else {
|
||||
@@ -585,13 +592,17 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// for all other cases
|
||||
else {
|
||||
$orig_filename = $directory.$object_id.'.jpg';
|
||||
$image_size = $this->wsObject->urlSegment[3];
|
||||
$filename = $directory.$object_id.'-'.$image_size.'.jpg';
|
||||
if ($this->imageType == 'features') {
|
||||
$filename = $orig_filename;
|
||||
} else {
|
||||
$image_size = $this->wsObject->urlSegment[3];
|
||||
$filename = $directory.$object_id.'-'.$image_size.'.jpg';
|
||||
}
|
||||
}
|
||||
|
||||
// in case of declinated images list of a product is get
|
||||
if ($this->output != '') {
|
||||
return true;
|
||||
@@ -599,7 +610,6 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
|
||||
// If a size was given try to display it
|
||||
elseif (isset($image_size) && $image_size != '') {
|
||||
|
||||
// Check the given size
|
||||
if ($this->imageType == 'products' && $image_size == 'bin') {
|
||||
$filename = $directory.$object_id.'-'.$image_id.'.jpg';
|
||||
@@ -607,6 +617,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
$exception = new WebserviceException('This image size does not exist', array(58, 400));
|
||||
throw $exception->setDidYouMean($image_size, $normal_image_size_names);
|
||||
}
|
||||
|
||||
if (!file_exists($filename)) {
|
||||
throw new WebserviceException('This image does not exist on disk', array(59, 500));
|
||||
}
|
||||
@@ -615,6 +626,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
$this->imgToDisplay = $filename;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Management of the original image (GET, PUT, POST, DELETE)
|
||||
elseif (isset($orig_filename)) {
|
||||
$orig_filename_exists = file_exists($orig_filename);
|
||||
@@ -633,7 +645,10 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
protected function manageDeclinatedImages($directory)
|
||||
{
|
||||
// Get available image sizes for the current image type
|
||||
$normal_image_sizes = ImageType::getImagesTypes($this->imageType);
|
||||
$normal_image_sizes = array();
|
||||
if ($this->imageType != 'features') {
|
||||
$normal_image_sizes = ImageType::getImagesTypes($this->imageType);
|
||||
}
|
||||
switch ($this->wsObject->urlSegment[2]) {
|
||||
// Match the default images
|
||||
case 'default':
|
||||
@@ -1052,11 +1067,14 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
throw new WebserviceException('Please set an "image" parameter with image data for value', array(76, 400));
|
||||
}
|
||||
} elseif ($this->wsObject->method == 'POST') {
|
||||
|
||||
if (isset($_FILES['image']['tmp_name']) && $_FILES['image']['tmp_name']) {
|
||||
$file = $_FILES['image'];
|
||||
|
||||
if ($file['size'] > $this->imgMaxUploadSize) {
|
||||
throw new WebserviceException(sprintf('The image size is too large (maximum allowed is %d KB)', ($this->imgMaxUploadSize / 1000)), array(72, 400));
|
||||
}
|
||||
|
||||
require_once(_PS_CORE_DIR_.'/images.inc.php');
|
||||
if ($error = ImageManager::validateUpload($file)) {
|
||||
throw new WebserviceException('Image upload error : '.$error, array(76, 400));
|
||||
@@ -1086,7 +1104,6 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
}
|
||||
Hook::exec('updateProduct', array('id_product' => (int)$this->wsObject->urlSegment[2]));
|
||||
}
|
||||
|
||||
// copy image
|
||||
if (!isset($file['tmp_name'])) {
|
||||
return false;
|
||||
|
||||
@@ -185,6 +185,7 @@ class AdminCountriesControllerCore extends AdminController
|
||||
'title' => $this->l('Countries'),
|
||||
'icon' => 'icon-globe'
|
||||
),
|
||||
'description' => $this->l('After changing \'Zip/postal code format\' for a country, please make sure to update the correct zip/postal code for hotels in that country.'),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'text',
|
||||
|
||||
@@ -458,7 +458,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
if (isset($_GET['filename']) && file_exists(_PS_UPLOAD_DIR_.$_GET['filename']) && Validate::isFileName($_GET['filename'])) {
|
||||
if (isset($_GET['filename']) && (bool)Tools::file_get_contents($context->link->getMediaLink(_THEME_PROD_PIC_DIR_.$_GET['filename'])) && Validate::isFileName($_GET['filename'])) { // by webkul
|
||||
AdminCustomerThreadsController::openUploadedFile();
|
||||
}
|
||||
|
||||
@@ -808,7 +808,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
'email' => $email,
|
||||
'id_employee' => $id_employee,
|
||||
'PS_SHOP_NAME' => Configuration::get('PS_SHOP_NAME'),
|
||||
'file_name' => file_exists(_PS_UPLOAD_DIR_.$message['file_name']),
|
||||
'file_name' => (bool)Tools::file_get_contents($context->link->getMediaLink(_THEME_PROD_PIC_DIR_.$message['file_name'])), // by webkul
|
||||
'contacts' => $contacts,
|
||||
'is_valid_order_id' => $is_valid_order_id
|
||||
));
|
||||
|
||||
@@ -40,7 +40,7 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
$this->list_id = 'feature';
|
||||
$this->identifier = 'id_feature';
|
||||
$this->lang = true;
|
||||
$this->imageType = 'png';
|
||||
$this->imageType = 'jpg';
|
||||
$this->fieldImageSettings = array(
|
||||
'name' => 'icon',
|
||||
'dir' => 'rf'
|
||||
@@ -169,16 +169,17 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
if (!($obj = $this->loadObject(true))) {
|
||||
return;
|
||||
}
|
||||
$ps_img_url = _PS_IMG_DIR_.'rf/'.$obj->id.'.png';
|
||||
if ($img_exist = file_exists($ps_img_url)) {
|
||||
$img_url = _PS_IMG_.'rf/'.$obj->id.'.png';
|
||||
// by webkul to get media link.
|
||||
// $ps_img_url = _PS_IMG_DIR_.'rf/'.$obj->id.'.jpg';
|
||||
$img_url = $this->context->link->getMediaLink(_PS_IMG_.'rf/'.$obj->id.'.jpg');
|
||||
if ($img_exist = Tools::file_get_contents($img_url)) {
|
||||
$image = "<img class='img-thumbnail img-responsive' style='max-width:100px' src='".$img_url."'>";
|
||||
}
|
||||
|
||||
$this->toolbar_title = $this->l('Add a new feature');
|
||||
$this->toolbar_title = $this->l('Add a new room feature');
|
||||
$this->fields_form = array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Feature'),
|
||||
'title' => $this->l('Room feature'),
|
||||
'icon' => 'icon-info-sign'
|
||||
),
|
||||
'input' => array(
|
||||
@@ -188,16 +189,16 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
'name' => 'name',
|
||||
'lang' => true,
|
||||
'size' => 33,
|
||||
'hint' => $this->l('Enter a name for the feature. Invalid characters:').' <>;=#{}',
|
||||
'hint' => $this->l('Enter a name for the room feature. Invalid characters:').' <>;=#{}',
|
||||
'required' => true
|
||||
),
|
||||
array(
|
||||
'type' => 'file',
|
||||
'label' => $this->l('Feature Logo'),
|
||||
'label' => $this->l('Room Feature Logo'),
|
||||
'name' => 'logo',
|
||||
'image' => $img_exist ? $image : false,
|
||||
'display_image' => true,
|
||||
'hint' => $this->l('Upload a feature logo.'),
|
||||
'hint' => $this->l('Upload a room feature logo.'),
|
||||
'required' => true
|
||||
)
|
||||
)
|
||||
@@ -223,21 +224,21 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
if (empty($this->display)) {
|
||||
$this->page_header_toolbar_btn['new_feature'] = array(
|
||||
'href' => self::$currentIndex.'&addfeature&token='.$this->token,
|
||||
'desc' => $this->l('Add new feature', null, null, false),
|
||||
'desc' => $this->l('Add new room feature', null, null, false),
|
||||
'icon' => 'process-icon-new'
|
||||
);
|
||||
|
||||
$this->page_header_toolbar_btn['new_feature_value'] = array(
|
||||
'href' => self::$currentIndex.'&addfeature_value&id_feature='.(int)Tools::getValue('id_feature').'&token='.$this->token,
|
||||
'desc' => $this->l('Add new feature value', null, null, false),
|
||||
'icon' => 'process-icon-new'
|
||||
);
|
||||
// $this->page_header_toolbar_btn['new_feature_value'] = array(
|
||||
// 'href' => self::$currentIndex.'&addfeature_value&id_feature='.(int)Tools::getValue('id_feature').'&token='.$this->token,
|
||||
// 'desc' => $this->l('Add new room feature value', null, null, false),
|
||||
// 'icon' => 'process-icon-new'
|
||||
// );
|
||||
}
|
||||
|
||||
if ($this->display == 'view') {
|
||||
$this->page_header_toolbar_btn['new_feature_value'] = array(
|
||||
'href' => self::$currentIndex.'&addfeature_value&id_feature='.(int)Tools::getValue('id_feature').'&token='.$this->token,
|
||||
'desc' => $this->l('Add new feature value', null, null, false),
|
||||
'desc' => $this->l('Add new room feature value', null, null, false),
|
||||
'icon' => 'process-icon-new'
|
||||
);
|
||||
}
|
||||
@@ -283,7 +284,7 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
case 'view':
|
||||
$this->toolbar_btn['newAttributes'] = array(
|
||||
'href' => self::$currentIndex.'&addfeature_value&id_feature='.(int)Tools::getValue('id_feature').'&token='.$this->token,
|
||||
'desc' => $this->l('Add new feature values')
|
||||
'desc' => $this->l('Add new room feature values')
|
||||
);
|
||||
$this->toolbar_btn['back'] = array(
|
||||
'href' => self::$currentIndex.'&token='.$this->token,
|
||||
@@ -301,12 +302,12 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
|
||||
switch ($this->display) {
|
||||
case 'edit':
|
||||
$bread_extended[] = $this->l('Edit New Feature');
|
||||
$bread_extended[] = $this->l('Edit New Room Feature');
|
||||
$this->addMetaTitle($bread_extended[count($bread_extended) - 1]);
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
$bread_extended[] = $this->l('Add New Feature');
|
||||
$bread_extended[] = $this->l('Add New Room Feature');
|
||||
$this->addMetaTitle($bread_extended[count($bread_extended) - 1]);
|
||||
break;
|
||||
|
||||
@@ -351,13 +352,13 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
|
||||
$this->fields_form[0]['form'] = array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Feature value'),
|
||||
'title' => $this->l('Room feature value'),
|
||||
'icon' => 'icon-info-sign'
|
||||
),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'select',
|
||||
'label' => $this->l('Feature'),
|
||||
'label' => $this->l('Room feature'),
|
||||
'name' => 'id_feature',
|
||||
'options' => array(
|
||||
'query' => Feature::getFeatures($this->context->language->id),
|
||||
@@ -425,7 +426,7 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
$helper->allow_employee_form_lang = $this->allow_employee_form_lang;
|
||||
$helper->fields_value = $this->getFieldsValue($feature_value);
|
||||
$helper->toolbar_btn = $this->toolbar_btn;
|
||||
$helper->title = $this->l('Add a new feature value');
|
||||
$helper->title = $this->l('Add a new room feature value');
|
||||
$this->content .= $helper->generateForm($this->fields_form);
|
||||
}
|
||||
|
||||
@@ -464,7 +465,7 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
}
|
||||
} else {
|
||||
$url = '<a href="index.php?tab=AdminPerformance&token='.Tools::getAdminTokenLite('AdminPerformance').'#featuresDetachables">'.$this->l('Performance').'</a>';
|
||||
$this->displayWarning(sprintf($this->l('This feature has been disabled. You can activate it here: %s.'), $url));
|
||||
$this->displayWarning(sprintf($this->l('This room feature has been disabled. You can activate it here: %s.'), $url));
|
||||
}
|
||||
|
||||
$this->context->smarty->assign(
|
||||
@@ -581,7 +582,7 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
$sql = 'SELECT `position`+1
|
||||
FROM `'._DB_PREFIX_.'feature`
|
||||
ORDER BY position DESC';
|
||||
// set the position of the new feature in $_POST for postProcess() method
|
||||
// set the position of the new feature in $_POST for postProcess() method
|
||||
$_POST['position'] = DB::getInstance()->getValue($sql);
|
||||
}
|
||||
// clean \n\r characters
|
||||
@@ -607,15 +608,15 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
if (isset($featureImage['tmp_name']) && $featureImage['tmp_name']) {
|
||||
// if already feature image then delete it once before uploading new image
|
||||
if ($idFeature) {
|
||||
$currentImg = _PS_TMP_IMG_DIR_.'feature_mini_'.$objFeature->id.'_'.$this->context->shop->id.'.png';
|
||||
$currentImg = _PS_TMP_IMG_DIR_.'feature_mini_'.$objFeature->id.'_'.$this->context->shop->id.'.jpg';
|
||||
if (file_exists($currentImg)) {
|
||||
unlink($currentImg);
|
||||
}
|
||||
}
|
||||
// upload feature image
|
||||
$imgPath = _PS_IMG_DIR_.'rf/'.$objFeature->id.'.png';
|
||||
$imgPath = _PS_IMG_DIR_.'rf/'.$objFeature->id.'.jpg';
|
||||
if (!ImageManager::resize($featureImage['tmp_name'], $imgPath)) {
|
||||
$this->errors[] = $this->l('Some error occurred while uploding feature image. Please try again.');
|
||||
$this->errors[] = $this->l('Some error occurred while uploding room feature image. Please try again.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -627,9 +628,10 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
} else {
|
||||
$objFeatureValue = new FeatureValue();
|
||||
}
|
||||
|
||||
$objFeatureValue->id_feature = $objFeature->id;
|
||||
foreach (Language::getLanguages(true) as $lang) {
|
||||
$objFeatureValue->value[$lang['id_lang']] = $objFeature->id.'.png';
|
||||
$objFeatureValue->value[$lang['id_lang']] = $objFeature->id.'.jpg';
|
||||
}
|
||||
$objFeatureValue->save();
|
||||
return $objFeature;
|
||||
@@ -695,12 +697,12 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
if (isset($pos[2]) && (int)$pos[2] === $idFeature) {
|
||||
if ($feature = new Feature((int)$pos[2])) {
|
||||
if (isset($position) && $feature->updatePosition($way, $position, $idFeature)) {
|
||||
echo 'ok position '.(int)$position.' for feature '.(int)$pos[1].'\r\n';
|
||||
echo 'ok position '.(int)$position.' for room feature '.(int)$pos[1].'\r\n';
|
||||
} else {
|
||||
echo '{"hasError" : true, "errors" : "Can not update feature '.(int)$idFeature.' to position '.(int)$position.' "}';
|
||||
echo '{"hasError" : true, "errors" : "Can not update room feature '.(int)$idFeature.' to position '.(int)$position.' "}';
|
||||
}
|
||||
} else {
|
||||
echo '{"hasError" : true, "errors" : "This feature ('.(int)$idFeature.') can t be loaded"}';
|
||||
echo '{"hasError" : true, "errors" : "This room feature ('.(int)$idFeature.') can t be loaded"}';
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -219,7 +219,7 @@ class AdminGendersControllerCore extends AdminController
|
||||
parent::afterImageUpload();
|
||||
|
||||
if (($id_gender = (int)Tools::getValue('id_gender')) &&
|
||||
isset($_FILES) && count($_FILES) && file_exists(_PS_GENDERS_DIR_.$id_gender.'.jpg')) {
|
||||
isset($_FILES) && count($_FILES) && Tools::file_get_contents($this->context->link->getMediaLink(_THEME_GENDERS_DIR_.$id_gender.'.jpg'))) { // by webkul
|
||||
$current_file = _PS_TMP_IMG_DIR_.'gender_mini_'.$id_gender.'_'.$this->context->shop->id.'.jpg';
|
||||
|
||||
if (file_exists($current_file)) {
|
||||
|
||||
@@ -568,7 +568,7 @@ class AdminLanguagesControllerCore extends AdminController
|
||||
parent::afterImageUpload();
|
||||
|
||||
if (($id_lang = (int)Tools::getValue('id_lang')) &&
|
||||
isset($_FILES) && count($_FILES) && file_exists(_PS_LANG_IMG_DIR_.$id_lang.'.jpg')) {
|
||||
isset($_FILES) && count($_FILES) && (bool)Tools::file_get_contents($this->context->link->getMediaLink(_THEME_LANG_DIR_.$id_lang.'.jpg'))) { //by webkul
|
||||
$current_file = _PS_TMP_IMG_DIR_.'lang_mini_'.$id_lang.'_'.$this->context->shop->id.'.jpg';
|
||||
|
||||
if (file_exists($current_file)) {
|
||||
|
||||
@@ -73,7 +73,6 @@ class AdminPdfControllerCore extends AdminController
|
||||
die(Tools::displayError('The order cannot be found within your database.'));
|
||||
}
|
||||
|
||||
$order->products = OrderSlip::getOrdersSlipProducts($order_slip->id, $order);
|
||||
$this->generatePDF($order_slip, PDF::TEMPLATE_ORDER_SLIP);
|
||||
}
|
||||
|
||||
@@ -129,7 +128,6 @@ class AdminPdfControllerCore extends AdminController
|
||||
foreach ($id_order_slips_list as $id_order_slips) {
|
||||
$order_slips[] = new OrderSlip((int)$id_order_slips);
|
||||
}
|
||||
|
||||
$this->generatePDF($order_slips, PDF::TEMPLATE_ORDER_SLIP);
|
||||
}
|
||||
|
||||
|
||||
@@ -111,6 +111,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
//'Suppliers' => $this->l('Suppliers'),
|
||||
'Warehouses' => $this->l('Warehouses'),
|
||||
'Configuration' => $this->l('Configuration'),
|
||||
'Occupancy' => $this->l('Occupancy'),
|
||||
'Booking' => $this->l('Booking Information'),
|
||||
);
|
||||
|
||||
@@ -131,7 +132,8 @@ class AdminProductsControllerCore extends AdminController
|
||||
//'Attachments' => 12,
|
||||
//'Suppliers' => 13,
|
||||
'Configuration' => 14,
|
||||
'Booking' => 15,
|
||||
'Occupancy' => 15,
|
||||
'Booking' => 16,
|
||||
));
|
||||
}
|
||||
|
||||
@@ -198,12 +200,17 @@ class AdminProductsControllerCore extends AdminController
|
||||
|
||||
$id_shop = Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP? (int)$this->context->shop->id : 'a.id_shop_default';
|
||||
$this->_join .= ' JOIN `'._DB_PREFIX_.'product_shop` sa ON (a.`id_product` = sa.`id_product` AND sa.id_shop = '.$id_shop.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type` hrt ON (a.`id_product` = hrt.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_branch_info` hb ON (hrt.`id_hotel` = hb.`id`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_branch_info_lang` hbl ON (hb.`id` = hbl.`id` AND b.`id_lang` = hbl.`id_lang`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON ('.$alias.'.`id_category_default` = cl.`id_category` AND b.`id_lang` = cl.`id_lang` AND cl.id_shop = '.$id_shop.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'shop` shop ON (shop.id_shop = '.$id_shop.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop ON (image_shop.`id_product` = a.`id_product` AND image_shop.`cover` = 1 AND image_shop.id_shop = '.$id_shop.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_image` = image_shop.`id_image`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_download` pd ON (pd.`id_product` = a.`id_product` AND pd.`active` = 1)';
|
||||
|
||||
$this->_select .= ' (SELECT COUNT(hri.`id`) FROM `'._DB_PREFIX_.'htl_room_information` hri WHERE hri.`id_product` = a.`id_product`) as num_rooms, ';
|
||||
$this->_select .= 'hrt.`adult`, hrt.`children`, hb.`id` as id_hotel, hb.`city`, hbl.`hotel_name`, ';
|
||||
$this->_select .= 'shop.`name` AS `shopname`, a.`id_shop_default`, ';
|
||||
$this->_select .= $alias_image.'.`id_image` AS `id_image`, cl.`name` AS `name_category`, '.$alias.'.`price`, 0 AS `price_final`, a.`is_virtual`, pd.`nb_downloadable`, sav.`quantity` AS `sav_quantity`, '.$alias.'.`active`, IF(sav.`quantity`<=0, 1, 0) AS `badge_danger`';
|
||||
|
||||
@@ -233,32 +240,44 @@ class AdminProductsControllerCore extends AdminController
|
||||
'title' => $this->l('Name'),
|
||||
'filter_key' => 'b!name'
|
||||
);
|
||||
$this->fields_list['reference'] = array(
|
||||
'title' => $this->l('Reference'),
|
||||
'align' => 'left',
|
||||
);
|
||||
|
||||
if (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_SHOP) {
|
||||
$this->fields_list['shopname'] = array(
|
||||
'title' => $this->l('Default shop'),
|
||||
'filter_key' => 'shop!name',
|
||||
);
|
||||
} else {
|
||||
$this->fields_list['name_category'] = array(
|
||||
'title' => $this->l('Category'),
|
||||
'filter_key' => 'cl!name',
|
||||
$this->fields_list['hotel_name'] = array(
|
||||
'title' => $this->l('Hotel'),
|
||||
'filter_key' => 'hbl!hotel_name',
|
||||
'callback' => 'getHotelName',
|
||||
);
|
||||
}
|
||||
$this->fields_list['adult'] = array(
|
||||
'title' => $this->l('Adults'),
|
||||
'filter_key' => 'hrt!adult',
|
||||
'align' => 'center',
|
||||
);
|
||||
$this->fields_list['child'] = array(
|
||||
'title' => $this->l('Children'),
|
||||
'filter_key' => 'hrt!children',
|
||||
'align' => 'center',
|
||||
);
|
||||
// use it for total rooms
|
||||
$this->fields_list['num_rooms'] = array(
|
||||
'title' => $this->l('Total Rooms'),
|
||||
'align' => 'center',
|
||||
'havingFilter' => true,
|
||||
);
|
||||
$this->fields_list['price'] = array(
|
||||
'title' => $this->l('Base price'),
|
||||
'type' => 'price',
|
||||
'align' => 'text-right',
|
||||
'align' => 'text-left',
|
||||
'filter_key' => 'a!price'
|
||||
);
|
||||
$this->fields_list['price_final'] = array(
|
||||
'title' => $this->l('Final price'),
|
||||
'type' => 'price',
|
||||
'align' => 'text-right',
|
||||
'align' => 'text-left',
|
||||
'havingFilter' => true,
|
||||
'orderby' => false,
|
||||
'search' => false
|
||||
@@ -284,7 +303,16 @@ class AdminProductsControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public static function getQuantities($echo, $tr)
|
||||
public function getHotelName($hotelName, $row)
|
||||
{
|
||||
if ($hotelName && isset($row['city'])) {
|
||||
return $hotelName.' - '.$row['city'];
|
||||
}
|
||||
|
||||
return '--';
|
||||
}
|
||||
|
||||
public static function getQuantities($hotelName, $tr)
|
||||
{
|
||||
if ((int)$tr['is_virtual'] == 1 && $tr['nb_downloadable'] == 0) {
|
||||
return '∞';
|
||||
@@ -2135,7 +2163,9 @@ class AdminProductsControllerCore extends AdminController
|
||||
if ($this->isTabSubmitted('Images')) {
|
||||
$this->processImageLegends();
|
||||
}
|
||||
|
||||
if ($this->isTabSubmitted('Occupancy')) {
|
||||
$this->processOccupancy();
|
||||
}
|
||||
if ($this->isTabSubmitted('Configuration')) {
|
||||
$this->processConfiguration();
|
||||
}
|
||||
@@ -3271,8 +3301,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
$roomStatus = $objRoomStatus->getAllRoomStatus();
|
||||
|
||||
$objRoomType = new HotelRoomType();
|
||||
$hotelRoomType = $objRoomType->getRoomTypeInfoByIdProduct($obj->id);
|
||||
if ($hotelRoomType) {
|
||||
if ($hotelRoomType = $objRoomType->getRoomTypeInfoByIdProduct($obj->id)) {
|
||||
$data->assign('htl_room_type', $hotelRoomType);
|
||||
|
||||
$hotelFullInfo = $objHotelInfo->hotelBranchInfoById($hotelRoomType['id_hotel']);
|
||||
@@ -3314,6 +3343,66 @@ class AdminProductsControllerCore extends AdminController
|
||||
$this->tpl_form_vars['custom_form'] = $data->fetch();
|
||||
}
|
||||
|
||||
// send information for the occupancy tab
|
||||
public function initFormOccupancy($obj)
|
||||
{
|
||||
$data = $this->createTemplate($this->tpl_form);
|
||||
if ($obj->id) {
|
||||
$smartyVars['product'] = $obj;
|
||||
if ($this->product_exists_in_shop) {
|
||||
// Check is any hotel is created or not
|
||||
$objHotelInfo = new HotelBranchInformation();
|
||||
if ($objHotelInfo->hotelsNameAndId()) {
|
||||
$objRoomType = new HotelRoomType();
|
||||
if ($roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($obj->id)) {
|
||||
$smartyVars['roomTypeInfo'] = $roomTypeInfo;
|
||||
}
|
||||
} else {
|
||||
$this->displayWarning($this->l('Add Hotel Before configurate this room type.'));
|
||||
}
|
||||
} else {
|
||||
$this->displayWarning($this->l('You must save the room type in this shop before managing occupancy.'));
|
||||
}
|
||||
} else {
|
||||
$this->displayWarning($this->l('You must save this room type before managing occupancy.'));
|
||||
}
|
||||
$data->assign($smartyVars);
|
||||
$this->tpl_form_vars['custom_form'] = $data->fetch();
|
||||
}
|
||||
|
||||
// save occupancy information
|
||||
public function processOccupancy()
|
||||
{
|
||||
$idProduct = Tools::getValue('id_product');
|
||||
if ((int)Tools::getValue('is_occupancy_submit')
|
||||
&& Validate::isLoadedObject($product = new Product((int)$idProduct)
|
||||
)) {
|
||||
// htl_room_type id field use only in edit case
|
||||
if ($idHtlRoomType = Tools::getValue('wk_id_room_type')) {
|
||||
if (Validate::isLoadedObject($objRoomType = new HotelRoomType($idHtlRoomType))) {
|
||||
$baseAdults = Tools::getValue('base_adults');
|
||||
$baseChildren = Tools::getValue('base_children');
|
||||
|
||||
if (!$baseAdults || !Validate::isUnsignedInt($baseAdults)) {
|
||||
$this->errors[] = Tools::displayError('Invalid base adults');
|
||||
}
|
||||
if (!Validate::isUnsignedInt($baseChildren)) {
|
||||
$this->errors[] = Tools::displayError('Invalid base children');
|
||||
}
|
||||
if (!count($this->errors)) {
|
||||
$objRoomType->adult = $baseAdults;
|
||||
$objRoomType->children = $baseChildren;
|
||||
$objRoomType->save();
|
||||
}
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('Invalid room type found.');
|
||||
}
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('Please save hotel of the room type from configuration tab.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function validateDisableDateRanges($disableDates)
|
||||
{
|
||||
if (count($disableDates)) {
|
||||
@@ -3343,30 +3432,20 @@ class AdminProductsControllerCore extends AdminController
|
||||
|
||||
public function processConfiguration()
|
||||
{
|
||||
/*Check if save of configuration tab is clicked*/
|
||||
$checkConfSubmit = Tools::getValue('checkConfSubmit');
|
||||
if ($checkConfSubmit) {
|
||||
$wk_id_room_type = Tools::getValue('wk_id_room_type'); // htl_room_type id field use only in edit case
|
||||
/*Check if save of configuration tab is submitted*/
|
||||
if (Tools::getValue('checkConfSubmit')) {
|
||||
// htl_room_type id field use only in edit case
|
||||
$wk_id_room_type = Tools::getValue('wk_id_room_type');
|
||||
|
||||
$id_product = Tools::getValue('id_product'); //room type
|
||||
$id_hotel = Tools::getValue('id_hotel');
|
||||
|
||||
$adult = Tools::getValue('num_adults');
|
||||
$children = Tools::getValue('num_child');
|
||||
|
||||
if (!$id_product || !Validate::isUnsignedInt($id_product)) {
|
||||
$this->errors[] = Tools::displayError('There is some problem while setting room information');
|
||||
}
|
||||
if (!$id_hotel || !Validate::isUnsignedInt($id_hotel)) {
|
||||
$this->errors[] = Tools::displayError('Please select a hotel');
|
||||
}
|
||||
if (!$adult || !Validate::isUnsignedInt($adult)) {
|
||||
$this->errors[] = Tools::displayError('Please enter valid number of Adults');
|
||||
}
|
||||
if ($children === false || !Validate::isUnsignedInt($children)) {
|
||||
$this->errors[] = Tools::displayError('Please enter valid number of children');
|
||||
}
|
||||
|
||||
if (!count($this->errors)) {
|
||||
$room_numbers = Tools::getValue('room_num');
|
||||
if ($room_numbers) {
|
||||
@@ -3393,7 +3472,6 @@ class AdminProductsControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!count($this->errors)) {
|
||||
if ($wk_id_room_type) {
|
||||
$objRoomType = new HotelRoomType($wk_id_room_type);
|
||||
@@ -3403,8 +3481,6 @@ class AdminProductsControllerCore extends AdminController
|
||||
$objRoomType->id_product = $id_product;
|
||||
$objRoomType->id_hotel = $id_hotel;
|
||||
}
|
||||
$objRoomType->adult = $adult;
|
||||
$objRoomType->children = $children;
|
||||
$objRoomType->save();
|
||||
|
||||
$id_rm_type = $objRoomType->id;
|
||||
|
||||
@@ -141,48 +141,108 @@ class AdminStatusesControllerCore extends AdminController
|
||||
'align' => 'left',
|
||||
'width' => 'auto',
|
||||
'color' => 'color'
|
||||
)
|
||||
),
|
||||
'refunded' => array(
|
||||
'title' => $this->l('Refunded'),
|
||||
'align' => 'text-center',
|
||||
'active' => 'refunded',
|
||||
'type' => 'bool',
|
||||
'ajax' => true,
|
||||
'orderby' => false,
|
||||
'class' => 'fixed-width-sm'
|
||||
),
|
||||
'denied' => array(
|
||||
'title' => $this->l('Denied'),
|
||||
'align' => 'text-center',
|
||||
'active' => 'denied',
|
||||
'type' => 'bool',
|
||||
'ajax' => true,
|
||||
'orderby' => false,
|
||||
'class' => 'fixed-width-sm'
|
||||
),
|
||||
'send_email_to_customer' => array(
|
||||
'title' => $this->l('Send email to customer'),
|
||||
'align' => 'text-center',
|
||||
'active' => 'sendEmailToSuperAdmin',
|
||||
'type' => 'bool',
|
||||
'ajax' => true,
|
||||
'orderby' => false,
|
||||
'class' => 'fixed-width-sm'
|
||||
),
|
||||
'send_email_to_superadmin' => array(
|
||||
'title' => $this->l('Send email to super admin'),
|
||||
'align' => 'text-center',
|
||||
'active' => 'sendEmailToCustomer',
|
||||
'type' => 'bool',
|
||||
'ajax' => true,
|
||||
'orderby' => false,
|
||||
'class' => 'fixed-width-sm'
|
||||
),
|
||||
'send_email_to_employee' => array(
|
||||
'title' => $this->l('Send email to employee'),
|
||||
'align' => 'text-center',
|
||||
'active' => 'sendEmailToEmployee',
|
||||
'type' => 'bool',
|
||||
'ajax' => true,
|
||||
'orderby' => false,
|
||||
'class' => 'fixed-width-sm'
|
||||
),
|
||||
'send_email_to_hotelier' => array(
|
||||
'title' => $this->l('Send email to hotelier'),
|
||||
'align' => 'text-center',
|
||||
'active' => 'sendEmailToHotelier',
|
||||
'type' => 'bool',
|
||||
'ajax' => true,
|
||||
'orderby' => false,
|
||||
'class' => 'fixed-width-sm'
|
||||
),
|
||||
// 'customer_template' => array(
|
||||
// 'title' => $this->l('Customer Email template')
|
||||
// ),
|
||||
// 'admin_template' => array(
|
||||
// 'title' => $this->l('Admin Email template')
|
||||
// ),
|
||||
);
|
||||
}
|
||||
|
||||
protected function initOrderReturnsForm()
|
||||
{
|
||||
$id_order_return_state = (int)Tools::getValue('id_order_return_state');
|
||||
|
||||
// Create Object OrderReturnState
|
||||
$order_return_state = new OrderReturnState($id_order_return_state);
|
||||
|
||||
//init field form variable for order return form
|
||||
$this->fields_form = array();
|
||||
|
||||
//$this->initToolbar();
|
||||
$this->getlanguages();
|
||||
$helper = new HelperForm();
|
||||
$helper->currentIndex = self::$currentIndex;
|
||||
$helper->token = $this->token;
|
||||
$helper->table = 'order_return_state';
|
||||
$helper->identifier = 'id_order_return_state';
|
||||
$helper->id = $order_return_state->id;
|
||||
$helper->toolbar_scroll = false;
|
||||
$helper->languages = $this->_languages;
|
||||
$helper->default_form_language = $this->default_form_language;
|
||||
$helper->allow_employee_form_lang = $this->allow_employee_form_lang;
|
||||
$this->table = 'order_return_state';
|
||||
$this->className = 'OrderReturnState';
|
||||
$this->identifier = 'id_order_return_state';
|
||||
$this->object = null;
|
||||
|
||||
if ($order_return_state->id) {
|
||||
$helper->fields_value = array(
|
||||
$mailToCustomer = $this->getFieldValue($order_return_state, 'send_email_to_customer');
|
||||
$mailToSuperadmin = $this->getFieldValue($order_return_state, 'send_email_to_superadmin');
|
||||
$mailToEmployee = $this->getFieldValue($order_return_state, 'send_email_to_employee');
|
||||
$mailToHotelier = $this->getFieldValue($order_return_state, 'send_email_to_hotelier');
|
||||
$this->fields_value = array(
|
||||
'name' => $this->getFieldValue($order_return_state, 'name'),
|
||||
'color' => $this->getFieldValue($order_return_state, 'color'),
|
||||
'refunded_on' => $this->getFieldValue($order_return_state, 'refunded'),
|
||||
'denied_on' => $this->getFieldValue($order_return_state, 'denied'),
|
||||
'send_email_to_customer_on' => $mailToCustomer,
|
||||
'send_email_to_customer' => $mailToCustomer,
|
||||
'send_email_to_superadmin_on' => $mailToSuperadmin,
|
||||
'send_email_to_superadmin' => $mailToSuperadmin,
|
||||
'send_email_to_employee_on' => $mailToEmployee,
|
||||
'send_email_to_employee' => $mailToEmployee,
|
||||
'send_email_to_hotelier_on' => $mailToHotelier,
|
||||
'send_email_to_hotelier' => $mailToHotelier,
|
||||
'show_customer_template' => $mailToCustomer,
|
||||
'show_admin_template' => $mailToSuperadmin || $mailToEmployee || $mailToHotelier,
|
||||
);
|
||||
} else {
|
||||
$helper->fields_value = array(
|
||||
$this->fields_value = array(
|
||||
'name' => $this->getFieldValue($order_return_state, 'name'),
|
||||
'color' => "#ffffff",
|
||||
);
|
||||
}
|
||||
|
||||
$helper->toolbar_btn = $this->toolbar_btn;
|
||||
$helper->title = $this->l('Edit Return Status');
|
||||
return $helper;
|
||||
}
|
||||
|
||||
public function initPageHeaderToolbar()
|
||||
@@ -195,7 +255,7 @@ class AdminStatusesControllerCore extends AdminController
|
||||
);
|
||||
$this->page_header_toolbar_btn['new_order_return_state'] = array(
|
||||
'href' => self::$currentIndex.'&addorder_return_state&token='.$this->token,
|
||||
'desc' => $this->l('Add new order return status', null, null, false),
|
||||
'desc' => $this->l('Add new order refund status', null, null, false),
|
||||
'icon' => 'process-icon-new'
|
||||
);
|
||||
}
|
||||
@@ -236,9 +296,10 @@ class AdminStatusesControllerCore extends AdminController
|
||||
|
||||
// call postProcess() to take care of actions and filters
|
||||
$this->postProcess();
|
||||
$this->toolbar_title = $this->l('Return statuses');
|
||||
$this->toolbar_title = $this->l('Refund statuses');
|
||||
|
||||
parent::initToolbar();
|
||||
|
||||
$lists .= parent::renderList();
|
||||
|
||||
return $lists;
|
||||
@@ -261,158 +322,161 @@ class AdminStatusesControllerCore extends AdminController
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
$this->fields_form = array(
|
||||
'tinymce' => true,
|
||||
'legend' => array(
|
||||
'title' => $this->l('Order status'),
|
||||
'icon' => 'icon-time'
|
||||
),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Status name'),
|
||||
'name' => 'name',
|
||||
'lang' => true,
|
||||
'required' => true,
|
||||
'hint' => array(
|
||||
$this->l('Order status (e.g. \'Pending\').'),
|
||||
$this->l('Invalid characters: numbers and').' !<>,;?=+()@#"{}_$%:'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'file',
|
||||
'label' => $this->l('Icon'),
|
||||
'name' => 'icon',
|
||||
'hint' => $this->l('Upload an icon from your computer (File type: .gif, suggested size: 16x16).')
|
||||
),
|
||||
array(
|
||||
'type' => 'color',
|
||||
'label' => $this->l('Color'),
|
||||
'name' => 'color',
|
||||
'hint' => $this->l('Status will be highlighted in this color. HTML colors only.').' "lightblue", "#CC6600")'
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'logable',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id' => 'on', 'name' => $this->l('Consider the associated order as validated.'), 'val' => '1'),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'invoice',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id' => 'on', 'name' => $this->l('Allow a customer to download and view PDF versions of his/her invoices.'), 'val' => '1'),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'hidden',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id' => 'on', 'name' => $this->l('Hide this status in all customer orders.'), 'val' => '1'),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'send_email',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id' => 'on', 'name' => $this->l('Send an email to the customer when his/her order status has changed.'), 'val' => '1'),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'pdf_invoice',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id' => 'on', 'name' => $this->l('Attach invoice PDF to email.'), 'val' => '1'),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'pdf_delivery',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id' => 'on', 'name' => $this->l('Attach delivery slip PDF to email.'), 'val' => '1'),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'shipped',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id' => 'on', 'name' => $this->l('Set the order as shipped.'), 'val' => '1'),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'paid',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id' => 'on', 'name' => $this->l('Set the order as paid.'), 'val' => '1'),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'delivery',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id' => 'on', 'name' => $this->l('Show delivery PDF.'), 'val' => '1'),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'select_template',
|
||||
'label' => $this->l('Template'),
|
||||
'name' => 'template',
|
||||
'lang' => true,
|
||||
'options' => array(
|
||||
'query' => $this->getTemplates(),
|
||||
'id' => 'id',
|
||||
'name' => 'name',
|
||||
'folder' => 'folder'
|
||||
),
|
||||
'hint' => array(
|
||||
$this->l('Only letters, numbers and underscores ("_") are allowed.'),
|
||||
$this->l('Email template for both .html and .txt.')
|
||||
)
|
||||
)
|
||||
),
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save'),
|
||||
)
|
||||
);
|
||||
|
||||
if (Tools::isSubmit('updateorder_state') || Tools::isSubmit('addorder_state')) {
|
||||
$this->fields_form = array(
|
||||
'tinymce' => true,
|
||||
'legend' => array(
|
||||
'title' => $this->l('Order status'),
|
||||
'icon' => 'icon-time'
|
||||
),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Status name'),
|
||||
'name' => 'name',
|
||||
'lang' => true,
|
||||
'required' => true,
|
||||
'hint' => array(
|
||||
$this->l('Order status (e.g. \'Pending\').'),
|
||||
$this->l('Invalid characters: numbers and').' !<>,;?=+()@#"{}_$%:'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'file',
|
||||
'label' => $this->l('Icon'),
|
||||
'name' => 'icon',
|
||||
'hint' => $this->l('Upload an icon from your computer (File type: .gif, suggested size: 16x16).')
|
||||
),
|
||||
array(
|
||||
'type' => 'color',
|
||||
'label' => $this->l('Color'),
|
||||
'name' => 'color',
|
||||
'hint' => $this->l('Status will be highlighted in this color. HTML colors only.').' "lightblue", "#CC6600")'
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'logable',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id' => 'on', 'name' => $this->l('Consider the associated order as validated.'), 'val' => '1'),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'invoice',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id' => 'on', 'name' => $this->l('Allow a customer to download and view PDF versions of his/her invoices.'), 'val' => '1'),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'hidden',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id' => 'on', 'name' => $this->l('Hide this status in all customer orders.'), 'val' => '1'),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'class' => 'email_to_customer',
|
||||
'type' => 'checkbox',
|
||||
'name' => 'send_email',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id' => 'on', 'name' => $this->l('Send an email to the customer when his/her order status has changed.'), 'val' => '1'),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'pdf_invoice',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id' => 'on', 'name' => $this->l('Attach invoice PDF to email.'), 'val' => '1'),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'pdf_delivery',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id' => 'on', 'name' => $this->l('Attach delivery slip PDF to email.'), 'val' => '1'),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'shipped',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id' => 'on', 'name' => $this->l('Set the order as shipped.'), 'val' => '1'),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'paid',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id' => 'on', 'name' => $this->l('Set the order as paid.'), 'val' => '1'),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'delivery',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id' => 'on', 'name' => $this->l('Show delivery PDF.'), 'val' => '1'),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'select_template',
|
||||
'is_customer_template' => 1,
|
||||
'label' => $this->l('Template'),
|
||||
'field_name' => 'send_email',
|
||||
'template_attr' => 'email_to_customer',
|
||||
'name' => 'template',
|
||||
'lang' => true,
|
||||
'options' => array(
|
||||
'query' => $this->getTemplates(),
|
||||
'id' => 'id',
|
||||
'name' => 'name',
|
||||
'folder' => 'folder'
|
||||
),
|
||||
'hint' => array(
|
||||
$this->l('Only letters, numbers and underscores ("_") are allowed.'),
|
||||
$this->l('Email template for both .html and .txt.')
|
||||
)
|
||||
)
|
||||
),
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save'),
|
||||
)
|
||||
);
|
||||
return $this->renderOrderStatusForm();
|
||||
} elseif (Tools::isSubmit('updateorder_return_state') || Tools::isSubmit('addorder_return_state')) {
|
||||
return $this->renderOrderReturnsForm();
|
||||
@@ -428,6 +492,8 @@ class AdminStatusesControllerCore extends AdminController
|
||||
}
|
||||
|
||||
$this->fields_value = array(
|
||||
'show_customer_template' => $this->getFieldValue($obj, 'send_email'),
|
||||
'show_admin_template' => 0,
|
||||
'logable_on' => $this->getFieldValue($obj, 'logable'),
|
||||
'invoice_on' => $this->getFieldValue($obj, 'invoice'),
|
||||
'hidden_on' => $this->getFieldValue($obj, 'hidden'),
|
||||
@@ -450,23 +516,17 @@ class AdminStatusesControllerCore extends AdminController
|
||||
|
||||
protected function renderOrderReturnsForm()
|
||||
{
|
||||
$helper = $this->initOrderReturnsForm();
|
||||
$helper->show_cancel_button = true;
|
||||
$this->initOrderReturnsForm();
|
||||
|
||||
$back = Tools::safeOutput(Tools::getValue('back', ''));
|
||||
if (empty($back)) {
|
||||
$back = self::$currentIndex.'&token='.$this->token;
|
||||
}
|
||||
if (!Validate::isCleanHtml($back)) {
|
||||
die(Tools::displayError());
|
||||
if (!($obj = $this->loadObject(true))) {
|
||||
return;
|
||||
}
|
||||
|
||||
$helper->back_url = $back;
|
||||
|
||||
$this->fields_form[0]['form'] = array(
|
||||
//init field form variable for order return form
|
||||
$this->fields_form = array(
|
||||
'tinymce' => true,
|
||||
'legend' => array(
|
||||
'title' => $this->l('Return status'),
|
||||
'title' => $this->l('Refund status'),
|
||||
'icon' => 'icon-time'
|
||||
),
|
||||
'input' => array(
|
||||
@@ -477,7 +537,7 @@ class AdminStatusesControllerCore extends AdminController
|
||||
'lang' => true,
|
||||
'required' => true,
|
||||
'hint' => array(
|
||||
$this->l('Order\'s return status name.'),
|
||||
$this->l('Order\'s refund status name.'),
|
||||
$this->l('Invalid characters: numbers and').' !<>,;?=+()@#"<22>{}_$%:'
|
||||
)
|
||||
),
|
||||
@@ -486,13 +546,141 @@ class AdminStatusesControllerCore extends AdminController
|
||||
'label' => $this->l('Color'),
|
||||
'name' => 'color',
|
||||
'hint' => $this->l('Status will be highlighted in this color. HTML colors only.').' "lightblue", "#CC6600")'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'refunded',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id' => 'on', 'name' => $this->l('Consider the associated order refund as refunded.'), 'val' => '1'),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'name' => 'denied',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id' => 'on', 'name' => $this->l('Consider the associated order refund as denied.'), 'val' => '1'),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'class' => 'email_to_customer',
|
||||
'type' => 'checkbox',
|
||||
'name' => 'send_email_to_customer',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array(
|
||||
'id' => 'on',
|
||||
'name' => $this->l('Send an email to the customer when his/her order refund status has changed.'),
|
||||
'val' => '1'
|
||||
),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'class' => 'email_to_admin',
|
||||
'name' => 'send_email_to_superadmin',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array(
|
||||
'id' => 'on',
|
||||
'name' => $this->l('Send an email to the super admin order refund status has changed.'),
|
||||
'val' => '1'
|
||||
),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'class' => 'email_to_admin',
|
||||
'name' => 'send_email_to_employee',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array(
|
||||
'id' => 'on',
|
||||
'name' => $this->l('Send an email to the employee when order refund status has changed.'),
|
||||
'val' => '1'
|
||||
),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'class' => 'email_to_admin',
|
||||
'name' => 'send_email_to_hotelier',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array(
|
||||
'id' => 'on',
|
||||
'name' => $this->l('Send an email to the hotelier when order refund status has changed.'),
|
||||
'val' => '1'
|
||||
),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'select_template',
|
||||
'is_customer_template' => 1,
|
||||
'field_name' => 'send_email_to_customer',
|
||||
'template_attr' => 'email_to_customer',
|
||||
'label' => $this->l('Template for customer email'),
|
||||
'name' => 'customer_template',
|
||||
'lang' => true,
|
||||
'options' => array(
|
||||
'query' => $this->getTemplates(),
|
||||
'id' => 'id',
|
||||
'name' => 'name',
|
||||
'folder' => 'folder'
|
||||
),
|
||||
'hint' => array(
|
||||
$this->l('This email will be sent to the customer.'),
|
||||
$this->l('Only letters, numbers and underscores ("_") are allowed.'),
|
||||
$this->l('Email template for both .html and .txt.')
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'select_template',
|
||||
'is_customer_template' => 0,
|
||||
'is_admin_template' => 1,
|
||||
'field_name' => 'send_email_to_customer',
|
||||
'template_attr' => 'email_to_admin',
|
||||
'label' => $this->l('Template for admin email'),
|
||||
'name' => 'admin_template',
|
||||
'lang' => true,
|
||||
'options' => array(
|
||||
'query' => $this->getTemplates(),
|
||||
'id' => 'id',
|
||||
'name' => 'name',
|
||||
'folder' => 'folder'
|
||||
),
|
||||
'hint' => array(
|
||||
$this->l('This email will be sent to the admin (superadmin, employee, hotelier).'),
|
||||
$this->l('Only letters, numbers and underscores ("_") are allowed.'),
|
||||
$this->l('Email template for both .html and .txt.')
|
||||
)
|
||||
),
|
||||
),
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save'),
|
||||
)
|
||||
);
|
||||
return $helper->generateForm($this->fields_form);
|
||||
|
||||
return parent::renderForm();
|
||||
}
|
||||
|
||||
protected function getTemplates()
|
||||
@@ -536,22 +724,67 @@ class AdminStatusesControllerCore extends AdminController
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('submitAddorder_return_state')) {
|
||||
$id_order_return_state = Tools::getValue('id_order_return_state');
|
||||
$refunded = Tools::getValue('refunded_on');
|
||||
$denied = Tools::getValue('denied_on');
|
||||
|
||||
// Create Object OrderReturnState
|
||||
$order_return_state = new OrderReturnState((int)$id_order_return_state);
|
||||
$defaultLangId = Configuration::get('PS_LANG_DEFAULT');
|
||||
$objDefaultLanguage = Language::getLanguage((int) $defaultLangId);
|
||||
$languages = Language::getLanguages(false);
|
||||
|
||||
$order_return_state->color = Tools::getValue('color');
|
||||
$order_return_state->name = array();
|
||||
foreach (Language::getIDs(false) as $id_lang) {
|
||||
$order_return_state->name[$id_lang] = Tools::getValue('name_'.$id_lang);
|
||||
if (!trim(Tools::getValue('name_'.$defaultLangId))) {
|
||||
$this->errors[] = $this->l('Name is required at least in ').
|
||||
$objDefaultLanguage['name'];
|
||||
} else {
|
||||
foreach ($languages as $lang) {
|
||||
// validate non required fields
|
||||
if (trim(Tools::getValue('name_'.$lang['id_lang']))) {
|
||||
if (!Validate::isGenericName(Tools::getValue('name_'.$lang['id_lang']))) {
|
||||
$this->errors[] = $this->l('Invalid name in ').$lang['name'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update object
|
||||
if (!$order_return_state->save()) {
|
||||
$this->errors[] = Tools::displayError('An error has occurred: Can\'t save the current order\'s return status.');
|
||||
} else {
|
||||
Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token);
|
||||
if ($refunded && $denied) {
|
||||
$this->errors[] = $this->l('Return state can not be set refunded and denied together.');
|
||||
}
|
||||
|
||||
if (!count($this->errors)) {
|
||||
$id_order_return_state = Tools::getValue('id_order_return_state');
|
||||
// Create Object OrderReturnState
|
||||
$order_return_state = new OrderReturnState((int)$id_order_return_state);
|
||||
$order_return_state->color = Tools::getValue('color');
|
||||
$order_return_state->send_email_to_customer = Tools::getValue('send_email_to_customer_on');
|
||||
$order_return_state->send_email_to_superadmin = Tools::getValue('send_email_to_superadmin_on');
|
||||
$order_return_state->send_email_to_employee = Tools::getValue('send_email_to_employee_on');
|
||||
$order_return_state->send_email_to_hotelier = Tools::getValue('send_email_to_hotelier_on');
|
||||
$order_return_state->name = array();
|
||||
$order_return_state->template = array();
|
||||
foreach (Language::getIDs(false) as $id_lang) {
|
||||
$order_return_state->name[$id_lang] = Tools::getValue('name_'.$id_lang);
|
||||
if ($order_return_state->send_email_to_customer) {
|
||||
$order_return_state->customer_template[$id_lang] = Tools::getValue('customer_template_'.$id_lang);
|
||||
} else {
|
||||
$order_return_state->customer_template[$id_lang] = '';
|
||||
}
|
||||
|
||||
if ($order_return_state->send_email_to_superadmin
|
||||
|| $order_return_state->send_email_to_employee
|
||||
|| $order_return_state->send_email_to_hotelier
|
||||
) {
|
||||
$order_return_state->admin_template[$id_lang] = Tools::getValue('admin_template_'.$id_lang);
|
||||
} else {
|
||||
$order_return_state->admin_template[$id_lang] = '';
|
||||
}
|
||||
}
|
||||
$order_return_state->refunded = $refunded;
|
||||
$order_return_state->denied = $denied;
|
||||
// Update object
|
||||
if (!$order_return_state->save()) {
|
||||
$this->errors[] = Tools::displayError('An error has occurred: Can\'t save the current order\'s refund status.');
|
||||
} else {
|
||||
Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -569,7 +802,7 @@ class AdminStatusesControllerCore extends AdminController
|
||||
$order_return_state = new OrderReturnState((int)$id_order_return_state);
|
||||
|
||||
if (!$order_return_state->delete()) {
|
||||
$this->errors[] = Tools::displayError('An error has occurred: Can\'t delete the current order\'s return status.');
|
||||
$this->errors[] = Tools::displayError('An error has occurred: Can\'t delete the current order\'s refund status.');
|
||||
} else {
|
||||
Tools::redirectAdmin(self::$currentIndex.'&conf=1&token='.$this->token);
|
||||
}
|
||||
@@ -633,7 +866,7 @@ class AdminStatusesControllerCore extends AdminController
|
||||
parent::afterImageUpload();
|
||||
|
||||
if (($id_order_state = (int)Tools::getValue('id_order_state')) &&
|
||||
isset($_FILES) && count($_FILES) && file_exists(_PS_ORDER_STATE_IMG_DIR_.$id_order_state.'.gif')) {
|
||||
isset($_FILES) && count($_FILES) && (bool)Tools::file_get_contents($this->context->link->getMediaLink(_PS_IMG_.'os/'.$id_order_state.'.gif'))) { //by webkul
|
||||
$current_file = _PS_TMP_IMG_DIR_.'order_state_mini_'.$id_order_state.'_'.$this->context->shop->id.'.gif';
|
||||
|
||||
if (file_exists($current_file)) {
|
||||
@@ -685,4 +918,97 @@ class AdminStatusesControllerCore extends AdminController
|
||||
echo json_encode(array('success' => 0, 'text' => $this->l('An error occurred while updating this meta.')));
|
||||
}
|
||||
}
|
||||
|
||||
public function ajaxProcessSendEmailToCustomerOrderReturnState()
|
||||
{
|
||||
$id_order_return_state = (int)Tools::getValue('id_order_return_state');
|
||||
|
||||
$sql = 'UPDATE '._DB_PREFIX_.'order_return_state SET `send_email_to_customer`= NOT `send_email_to_customer` WHERE id_order_return_state='.(int)$id_order_return_state;
|
||||
$result = Db::getInstance()->execute($sql);
|
||||
|
||||
if ($result) {
|
||||
echo json_encode(array('success' => 1, 'text' => $this->l('The status has been updated successfully.')));
|
||||
} else {
|
||||
echo json_encode(array('success' => 0, 'text' => $this->l('An error occurred while updating this meta.')));
|
||||
}
|
||||
}
|
||||
|
||||
public function ajaxProcessSendEmailToSuperAdminOrderReturnState()
|
||||
{
|
||||
$id_order_return_state = (int)Tools::getValue('id_order_return_state');
|
||||
|
||||
$sql = 'UPDATE '._DB_PREFIX_.'order_return_state SET `send_email_to_superadmin`= NOT `send_email_to_superadmin` WHERE id_order_return_state='.(int)$id_order_return_state;
|
||||
$result = Db::getInstance()->execute($sql);
|
||||
|
||||
if ($result) {
|
||||
echo json_encode(array('success' => 1, 'text' => $this->l('The status has been updated successfully.')));
|
||||
} else {
|
||||
echo json_encode(array('success' => 0, 'text' => $this->l('An error occurred while updating this meta.')));
|
||||
}
|
||||
}
|
||||
|
||||
public function ajaxProcessSendEmailToEmployeeOrderReturnState()
|
||||
{
|
||||
$id_order_return_state = (int)Tools::getValue('id_order_return_state');
|
||||
|
||||
$sql = 'UPDATE '._DB_PREFIX_.'order_return_state SET `send_email_to_employee`= NOT `send_email_to_employee` WHERE id_order_return_state='.(int)$id_order_return_state;
|
||||
$result = Db::getInstance()->execute($sql);
|
||||
|
||||
if ($result) {
|
||||
echo json_encode(array('success' => 1, 'text' => $this->l('The status has been updated successfully.')));
|
||||
} else {
|
||||
echo json_encode(array('success' => 0, 'text' => $this->l('An error occurred while updating this meta.')));
|
||||
}
|
||||
}
|
||||
|
||||
public function ajaxProcessSendEmailToHotelierOrderReturnState()
|
||||
{
|
||||
$id_order_return_state = (int)Tools::getValue('id_order_return_state');
|
||||
|
||||
$sql = 'UPDATE '._DB_PREFIX_.'order_return_state SET `send_email_to_hotelier`= NOT `send_email_to_hotelier` WHERE id_order_return_state='.(int)$id_order_return_state;
|
||||
$result = Db::getInstance()->execute($sql);
|
||||
|
||||
if ($result) {
|
||||
echo json_encode(array('success' => 1, 'text' => $this->l('The status has been updated successfully.')));
|
||||
} else {
|
||||
echo json_encode(array('success' => 0, 'text' => $this->l('An error occurred while updating this meta.')));
|
||||
}
|
||||
}
|
||||
|
||||
public function ajaxProcessRefundedOrderReturnState()
|
||||
{
|
||||
$id_order_return_state = (int)Tools::getValue('id_order_return_state');
|
||||
|
||||
$sql = 'UPDATE '._DB_PREFIX_.'order_return_state SET `refunded`= NOT `refunded` WHERE id_order_return_state='.(int)$id_order_return_state;
|
||||
$result = Db::getInstance()->execute($sql);
|
||||
|
||||
if ($result) {
|
||||
echo json_encode(array('success' => 1, 'text' => $this->l('The status has been updated successfully.')));
|
||||
} else {
|
||||
echo json_encode(array('success' => 0, 'text' => $this->l('An error occurred while updating this meta.')));
|
||||
}
|
||||
}
|
||||
|
||||
public function ajaxProcessDeniedOrderReturnState()
|
||||
{
|
||||
$id_order_return_state = (int)Tools::getValue('id_order_return_state');
|
||||
|
||||
$sql = 'UPDATE '._DB_PREFIX_.'order_return_state SET `denied`= NOT `denied` WHERE id_order_return_state='.(int)$id_order_return_state;
|
||||
$result = Db::getInstance()->execute($sql);
|
||||
|
||||
if ($result) {
|
||||
echo json_encode(array('success' => 1, 'text' => $this->l('The status has been updated successfully.')));
|
||||
} else {
|
||||
echo json_encode(array('success' => 0, 'text' => $this->l('An error occurred while updating this meta.')));
|
||||
}
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
|
||||
if ($this->tabAccess['edit'] == 1 && $this->display == 'edit') {
|
||||
$this->addJS(_PS_JS_DIR_.'admin/order_states.js');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -414,7 +414,7 @@ class AdminStoresControllerCore extends AdminController
|
||||
$ret = parent::postImage($id);
|
||||
$generate_hight_dpi_images = (bool)Configuration::get('PS_HIGHT_DPI');
|
||||
|
||||
if (($id_store = (int)Tools::getValue('id_store')) && isset($_FILES) && count($_FILES) && file_exists(_PS_STORE_IMG_DIR_.$id_store.'.jpg')) {
|
||||
if (($id_store = (int)Tools::getValue('id_store')) && isset($_FILES) && count($_FILES) && Tools::file_get_contents($this->context->link->getMediaLink(_THEME_STORE_DIR_.$id_store.'.jpg'))) {
|
||||
$images_types = ImageType::getImagesTypes('stores');
|
||||
foreach ($images_types as $k => $image_type) {
|
||||
ImageManager::resize(_PS_STORE_IMG_DIR_.$id_store.'.jpg',
|
||||
|
||||
@@ -148,7 +148,7 @@ class AdminThemesControllerCore extends AdminController
|
||||
'type' => 'file',
|
||||
'name' => 'PS_LOGO',
|
||||
'tab' => 'logo',
|
||||
'thumb' => _PS_IMG_.Configuration::get('PS_LOGO')
|
||||
'thumb' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_LOGO'))
|
||||
),
|
||||
'PS_LOGO_MOBILE' => array(
|
||||
'title' => $this->l('Header logo for mobile'),
|
||||
@@ -157,7 +157,7 @@ class AdminThemesControllerCore extends AdminController
|
||||
'type' => 'file',
|
||||
'name' => 'PS_LOGO_MOBILE',
|
||||
'tab' => 'mobile',
|
||||
'thumb' => (Configuration::get('PS_LOGO_MOBILE') !== false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MOBILE'))) ? _PS_IMG_.Configuration::get('PS_LOGO_MOBILE') : _PS_IMG_.Configuration::get('PS_LOGO')
|
||||
'thumb' => (Configuration::get('PS_LOGO_MOBILE') !== false && (bool)Tools::file_get_contents($this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_LOGO_MOBILE')))) ? $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_LOGO_MOBILE')) : $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_LOGO'))
|
||||
),
|
||||
'PS_LOGO_MAIL' => array(
|
||||
'title' => $this->l('Mail logo'),
|
||||
@@ -166,7 +166,7 @@ class AdminThemesControllerCore extends AdminController
|
||||
'type' => 'file',
|
||||
'name' => 'PS_LOGO_MAIL',
|
||||
'tab' => 'logo2',
|
||||
'thumb' => (Configuration::get('PS_LOGO_MAIL') !== false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL'))) ? _PS_IMG_.Configuration::get('PS_LOGO_MAIL') : _PS_IMG_.Configuration::get('PS_LOGO')
|
||||
'thumb' => (Configuration::get('PS_LOGO_MAIL') !== false && (bool)Tools::file_get_contents($this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_LOGO_MAIL')))) ? $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_LOGO_MAIL')) : $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_LOGO'))
|
||||
),
|
||||
'PS_LOGO_INVOICE' => array(
|
||||
'title' => $this->l('Invoice logo'),
|
||||
@@ -175,7 +175,7 @@ class AdminThemesControllerCore extends AdminController
|
||||
'type' => 'file',
|
||||
'name' => 'PS_LOGO_INVOICE',
|
||||
'tab' => 'logo2',
|
||||
'thumb' => (Configuration::get('PS_LOGO_INVOICE') !== false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_INVOICE'))) ? _PS_IMG_.Configuration::get('PS_LOGO_INVOICE') : _PS_IMG_.Configuration::get('PS_LOGO')
|
||||
'thumb' => (Configuration::get('PS_LOGO_INVOICE') !== false && (bool)Tools::file_get_contents($this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_LOGO_INVOICE')))) ? $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_LOGO_INVOICE')) : $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_LOGO'))
|
||||
),
|
||||
'PS_FAVICON' => array(
|
||||
'title' => $this->l('Favicon'),
|
||||
@@ -183,7 +183,7 @@ class AdminThemesControllerCore extends AdminController
|
||||
'type' => 'file',
|
||||
'name' => 'PS_FAVICON',
|
||||
'tab' => 'icons',
|
||||
'thumb' => _PS_IMG_.Configuration::get('PS_FAVICON').(Tools::getValue('conf') ? sprintf('?%04d', rand(0, 9999)) : '')
|
||||
'thumb' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_FAVICON').(Tools::getValue('conf') ? sprintf('?%04d', rand(0, 9999)) : ''))
|
||||
),
|
||||
'PS_STORES_ICON' => array(
|
||||
'title' => $this->l('Store icon'),
|
||||
@@ -191,7 +191,7 @@ class AdminThemesControllerCore extends AdminController
|
||||
'type' => 'file',
|
||||
'name' => 'PS_STORES_ICON',
|
||||
'tab' => 'icons',
|
||||
'thumb' => _PS_IMG_.Configuration::get('PS_STORES_ICON')
|
||||
'thumb' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_STORES_ICON'))
|
||||
),
|
||||
'PS_ALLOW_MOBILE_DEVICE' => array(
|
||||
'title' => $this->l('Enable the mobile theme'),
|
||||
@@ -2775,7 +2775,7 @@ class AdminThemesControllerCore extends AdminController
|
||||
Shop::setContext(Shop::CONTEXT_SHOP);
|
||||
$logo_shop = Configuration::get($field_name);
|
||||
if ($logo_all != $logo_shop && $logo_group != $logo_shop && $logo_shop != false) {
|
||||
@unlink(_PS_IMG_DIR_.Configuration::get($field_name));
|
||||
Tools::deleteFile(_PS_IMG_DIR_.Configuration::get($field_name)); //by webkul use deleteFile insted of unlink
|
||||
}
|
||||
} elseif (Shop::getContext() == Shop::CONTEXT_GROUP) {
|
||||
$id_shop_group = Shop::getContextShopGroupID();
|
||||
@@ -2783,16 +2783,16 @@ class AdminThemesControllerCore extends AdminController
|
||||
$logo_all = Configuration::get($field_name);
|
||||
Shop::setContext(Shop::CONTEXT_GROUP);
|
||||
if ($logo_all != Configuration::get($field_name)) {
|
||||
@unlink(_PS_IMG_DIR_.Configuration::get($field_name));
|
||||
Tools::deleteFile(_PS_IMG_DIR_.Configuration::get($field_name)); //by webkul use deleteFile insted of unlink
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@unlink(_PS_IMG_DIR_.Configuration::get($field_name));
|
||||
Tools::deleteFile(_PS_IMG_DIR_.Configuration::get($field_name)); //by webkul use deleteFile insted of unlink
|
||||
}
|
||||
}
|
||||
Configuration::updateValue($field_name, $logo_name, false, $id_shop_group, $id_shop);
|
||||
Hook::exec('actionAdminThemesControllerUpdate_optionsAfter');
|
||||
@unlink($tmp_name);
|
||||
unlink($tmp_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -220,7 +220,8 @@ class CartControllerCore extends FrontController
|
||||
$this->id_product,
|
||||
$this->id_product_attribute,
|
||||
$old_id_address_delivery,
|
||||
$new_id_address_delivery);
|
||||
$new_id_address_delivery
|
||||
);
|
||||
}
|
||||
|
||||
protected function processAllowSeperatedPackage()
|
||||
@@ -245,11 +246,11 @@ class CartControllerCore extends FrontController
|
||||
}
|
||||
|
||||
if (!$this->context->cart->duplicateProduct(
|
||||
$this->id_product,
|
||||
$this->id_product_attribute,
|
||||
$this->id_address_delivery,
|
||||
(int)Tools::getValue('new_id_address_delivery')
|
||||
)) {
|
||||
$this->id_product,
|
||||
$this->id_product_attribute,
|
||||
$this->id_address_delivery,
|
||||
(int)Tools::getValue('new_id_address_delivery')
|
||||
)) {
|
||||
//$error_message = $this->l('Error durring product duplication');
|
||||
// For the moment no translations
|
||||
$error_message = 'Error durring product duplication';
|
||||
@@ -281,7 +282,7 @@ class CartControllerCore extends FrontController
|
||||
$this->errors[] = Tools::displayError('Check-out date must be after check-in date');
|
||||
} elseif ($maxOrdDate = HotelOrderRestrictDate::getMaxOrderDate($id_hotel)) {
|
||||
// Check Order restrict condition before adding in to cart
|
||||
if (strtotime($maxOrdDate) < strtotime($date_from)
|
||||
if (strtotime('-1 day', strtotime($maxOrdDate)) < strtotime($date_from)
|
||||
|| strtotime($maxOrdDate) < strtotime($date_to)
|
||||
) {
|
||||
$maxOrdDate = date('d-m-Y', strtotime($maxOrdDate));
|
||||
|
||||
@@ -274,16 +274,16 @@ class ContactControllerCore extends FrontController
|
||||
$objHtlImg = new HotelImage($hotel['id_cover_img'])
|
||||
)
|
||||
) {
|
||||
if (file_exists(
|
||||
_PS_MODULE_DIR_.'hotelreservationsystem/views/img/hotel_img/'.$objHtlImg->hotel_image_id.'.jpg'
|
||||
)) {
|
||||
$hotel['image_url'] = _MODULE_DIR_.'hotelreservationsystem/views/img/hotel_img/'.
|
||||
$objHtlImg->hotel_image_id.'.jpg';
|
||||
// by webkul to get media link.
|
||||
$htlImgLink = $this->context->link->getMediaLink(_MODULE_DIR_.'hotelreservationsystem/views/img/hotel_img/'.$objHtlImg->hotel_image_id.'.jpg');
|
||||
|
||||
if ((bool)Tools::file_get_contents($htlImgLink)) {
|
||||
$hotel['image_url'] = $htlImgLink;
|
||||
} else {
|
||||
$hotel['image_url'] = _MODULE_DIR_.'hotelreservationsystem/views/img/Slices/hotel-default-icon.png';
|
||||
$hotel['image_url'] = $this->context->link->getMediaLink(_MODULE_DIR_.'hotelreservationsystem/views/img/Slices/hotel-default-icon.png');
|
||||
}
|
||||
} else {
|
||||
$hotel['image_url'] = _MODULE_DIR_.'hotelreservationsystem/views/img/Slices/hotel-default-icon.png';
|
||||
$hotel['image_url'] = $this->context->link->getMediaLink(_MODULE_DIR_.'hotelreservationsystem/views/img/Slices/hotel-default-icon.png');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,9 +186,6 @@ class GuestTrackingControllerCore extends FrontController
|
||||
$objHtlBranchInfo = new HotelBranchInformation();
|
||||
$objBookingDetail = new HotelBookingDetail();
|
||||
$objRoomType = new HotelRoomType();
|
||||
$objCustomerAdv = new HotelCustomerAdvancedPayment();
|
||||
$objOrdRefundInfo = new HotelOrderRefundInfo();
|
||||
$objRefundStages = new HotelOrderRefundStages();
|
||||
|
||||
$nonRequestedRooms = 0;
|
||||
$anyBackOrder = 0;
|
||||
@@ -268,14 +265,6 @@ class GuestTrackingControllerCore extends FrontController
|
||||
$cartHotelData[$type_key]['paid_unit_price_tax_excl'] = ($order_details_obj->total_price_tax_excl)/$order_details_obj->product_quantity;
|
||||
$cartHotelData[$type_key]['paid_unit_price_tax_incl'] = ($order_details_obj->total_price_tax_incl)/$order_details_obj->product_quantity;
|
||||
|
||||
//work on entring refund data
|
||||
$ord_refnd_info = $objOrdRefundInfo->getOderRefundInfoByIdOrderIdProductByDate($idOrder, $type_value['product_id'], $data_v['date_from'], $data_v['date_to']);
|
||||
if ($ord_refnd_info) {
|
||||
$stage_name = $objRefundStages->getNameById($ord_refnd_info['refund_stage_id']);
|
||||
} else {
|
||||
$stage_name = '';
|
||||
$nonRequestedRooms = 1;
|
||||
}
|
||||
if (isset($cartHotelData[$type_key]['date_diff'][$date_join])) {
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['num_rm'] += 1;
|
||||
|
||||
@@ -290,8 +279,6 @@ class GuestTrackingControllerCore extends FrontController
|
||||
if ($data_v['is_back_order']) {
|
||||
$anyBackOrder = 1;
|
||||
}
|
||||
//refund_stage
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['stage_name'] = $stage_name;
|
||||
} else {
|
||||
$num_days = $objBookingDetail->getNumberOfDays($data_v['date_from'], $data_v['date_to']);
|
||||
|
||||
@@ -308,8 +295,6 @@ class GuestTrackingControllerCore extends FrontController
|
||||
if ($data_v['is_back_order']) {
|
||||
$anyBackOrder = 1;
|
||||
}
|
||||
//refund_stage
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['stage_name'] = $stage_name;
|
||||
}
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$idOrder,
|
||||
@@ -366,8 +351,6 @@ class GuestTrackingControllerCore extends FrontController
|
||||
$cartHotelData[$type_key]['hotel_name'] = $hotelInfo['hotel_name'];
|
||||
}
|
||||
}
|
||||
//For Advanced Payment
|
||||
$order_adv_dtl = $objCustomerAdv->getCstAdvPaymentDtlByIdOrder($idOrder);
|
||||
}
|
||||
}
|
||||
// end booking details entries
|
||||
@@ -384,10 +367,8 @@ class GuestTrackingControllerCore extends FrontController
|
||||
'shw_bo_msg' => Configuration::get('WK_SHOW_MSG_ON_BO'),
|
||||
'back_ord_msg' => Configuration::get('WK_BO_MESSAGE'),
|
||||
'order_has_invoice' => $order->hasInvoice(),
|
||||
'redirect_link_terms', $redirectTermsLink,
|
||||
'cart_htl_data' => $cartHotelData,
|
||||
'non_requested_rooms' => $nonRequestedRooms,
|
||||
'order_adv_dtl' => $order_adv_dtl
|
||||
)
|
||||
);
|
||||
//end
|
||||
@@ -398,7 +379,7 @@ class GuestTrackingControllerCore extends FrontController
|
||||
$this->context->smarty->assign(array(
|
||||
'shop_name' => Configuration::get('PS_SHOP_NAME'),
|
||||
'order_collection' => $order_list,
|
||||
'return_allowed' => false,
|
||||
'refund_allowed' => false,
|
||||
'invoiceAllowed' => (int)Configuration::get('PS_INVOICE'),
|
||||
'is_guest' => true,
|
||||
'group_use_tax' => (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC),
|
||||
|
||||
@@ -53,65 +53,15 @@ class HistoryControllerCore extends FrontController
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
if ($is_htlInst = Module::isInstalled('hotelreservationsystem')) {
|
||||
require_once(_PS_MODULE_DIR_.'hotelreservationsystem/define.php');
|
||||
|
||||
$advance_payment_active = Configuration::get('WK_ALLOW_ADVANCED_PAYMENT');
|
||||
$obj_customer_adv = new HotelCustomerAdvancedPayment();
|
||||
|
||||
$obj_ord_ref_info = new HotelOrderRefundInfo();
|
||||
|
||||
$order_refund_info = array();
|
||||
|
||||
if ($advance_payment_active) {
|
||||
$this->context->smarty->assign('adv_active', $advance_payment_active);
|
||||
}
|
||||
}
|
||||
|
||||
if ($orders = Order::getCustomerOrders($this->context->customer->id)) {
|
||||
foreach ($orders as &$order) {
|
||||
$myOrder = new Order((int)$order['id_order']);
|
||||
if (Validate::isLoadedObject($myOrder)) {
|
||||
$order['virtual'] = $myOrder->isVirtual(false);
|
||||
}
|
||||
|
||||
if ($is_htlInst) {
|
||||
//For Advanced Payment
|
||||
if ($advance_payment_active) {
|
||||
$order_adv_dtl = $obj_customer_adv->getCstAdvPaymentDtlByIdOrder($myOrder->id);
|
||||
if ($order_adv_dtl) {
|
||||
$order['due_amount'] = $order_adv_dtl['total_order_amount'] - $order_adv_dtl['total_paid_amount'];
|
||||
$order['pay_currency'] = $order_adv_dtl['id_currency'];
|
||||
} else {
|
||||
$order['due_amount'] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// For order Refund
|
||||
$order_refund_data = $obj_ord_ref_info->getOrderRefundInforDataByOrderId((int)$order['id_order']);
|
||||
if ($order_refund_data) {
|
||||
$waitting = 0;
|
||||
$accepted = 0;
|
||||
$refunded = 0;
|
||||
$rejected = 0;
|
||||
foreach ($order_refund_data as $key_ref_data => $val_ref_data) {
|
||||
if ($val_ref_data['refund_stage_id'] == 1) {
|
||||
$order_refund_info[$order['id_order']]['waitting'] = ++$waitting;
|
||||
} elseif ($val_ref_data['refund_stage_id'] == 2) {
|
||||
$order_refund_info[$order['id_order']]['accepted'] = ++$accepted;
|
||||
} elseif ($val_ref_data['refund_stage_id'] == 3) {
|
||||
$order_refund_info[$order['id_order']]['refunded'] = ++$refunded;
|
||||
} elseif ($val_ref_data['refund_stage_id'] == 4) {
|
||||
$order_refund_info[$order['id_order']]['rejected'] = ++$rejected;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->context->smarty->assign(array(
|
||||
'order_refund_info' => $order_refund_info, // by webkul
|
||||
'orders' => $orders,
|
||||
'invoiceAllowed' => (int)Configuration::get('PS_INVOICE'),
|
||||
'reorderingAllowed' => !(bool)Configuration::get('PS_DISALLOW_HISTORY_REORDERING'),
|
||||
|
||||
@@ -49,7 +49,7 @@ class MyAccountControllerCore extends FrontController
|
||||
$this->context->smarty->assign(array(
|
||||
'has_customer_an_address' => empty($has_address),
|
||||
'voucherAllowed' => (int)CartRule::isFeatureActive(),
|
||||
'returnAllowed' => (int)Configuration::get('PS_ORDER_RETURN')
|
||||
'refundAllowed' => (int)Configuration::get('WK_ORDER_REFUND_ALLOWED')
|
||||
));
|
||||
$this->context->smarty->assign('HOOK_CUSTOMER_ACCOUNT', Hook::exec('displayCustomerAccount'));
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
|
||||
$this->id_cart = (int)(Tools::getValue('id_cart', 0));
|
||||
$is_guest = false;
|
||||
|
||||
/* check if the cart has been made by a Guest customer, for redirect link */
|
||||
if (Cart::isGuestCartByCartId($this->id_cart)) {
|
||||
$is_guest = true;
|
||||
@@ -104,32 +103,28 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
/*By webkul to show order details properly on order history page*/
|
||||
if (Module::isInstalled('hotelreservationsystem')) {
|
||||
require_once _PS_MODULE_DIR_.'hotelreservationsystem/define.php';
|
||||
$non_requested_rooms = 0;
|
||||
$any_back_order = 0;
|
||||
$processed_product = array();
|
||||
$orderTotalInfo = array();
|
||||
$orderTotalInfo['total_demands_price_te'] = 0;
|
||||
$orderTotalInfo['total_demands_price_ti'] = 0;
|
||||
$orderTotalInfo['total_products_te'] = 0;
|
||||
$orderTotalInfo['total_products_ti'] = 0;
|
||||
$orderTotalInfo['total_discounts'] = 0;
|
||||
$orderTotalInfo['total_paid'] = 0;
|
||||
$orderTotalInfo['total_paid_real'] = 0;
|
||||
$orderTotalInfo['total_wrapping'] = 0;
|
||||
$orderTotalInfo['total_order_amount'] = 0;
|
||||
|
||||
$cartOrders = Order::getAllOrdersByCartId($order->id_cart);
|
||||
if ($cartOrders) {
|
||||
$orders_has_invoice = 1;
|
||||
if ($cartOrders = Order::getAllOrdersByCartId($order->id_cart)) {
|
||||
$objHtlBranchInfo = new HotelBranchInformation();
|
||||
$obj_cart_bk_data = new HotelCartBookingData();
|
||||
$obj_htl_bk_dtl = new HotelBookingDetail();
|
||||
$obj_rm_type = new HotelRoomType();
|
||||
$non_requested_rooms = 0;
|
||||
$any_back_order = 0;
|
||||
$processed_product = array();
|
||||
$orderTotalInfo = array();
|
||||
$orderTotalInfo['total_demands_price_te'] = 0;
|
||||
$orderTotalInfo['total_demands_price_ti'] = 0;
|
||||
$orderTotalInfo['total_products_te'] = 0;
|
||||
$orderTotalInfo['total_products_ti'] = 0;
|
||||
$orderTotalInfo['total_discounts'] = 0;
|
||||
$orderTotalInfo['total_paid'] = 0;
|
||||
$orderTotalInfo['total_paid_amount'] = 0;
|
||||
$orderTotalInfo['total_wrapping'] = 0;
|
||||
$orderTotalInfo['total_order_amount'] = 0;
|
||||
$orderTotalInfo['total_order_amount'] = 0;
|
||||
$orders_has_invoice = 1;
|
||||
$hotelCartBookingData = new HotelCartBookingData();
|
||||
$obj_customer_adv = new HotelCustomerAdvancedPayment();
|
||||
$obj_refund_stages = new HotelOrderRefundStages();
|
||||
$obj_ord_ref_info = new HotelOrderRefundInfo();
|
||||
$objBookingDemand = new HotelBookingDemands();
|
||||
foreach ($cartOrders as $cartOrder) {
|
||||
$idOrder = $cartOrder['id_order'];
|
||||
@@ -166,16 +161,15 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
$date_join = strtotime($data_v['date_from']).strtotime($data_v['date_to']);
|
||||
/*Product price when order was created*/
|
||||
$order_details_obj = new OrderDetail($data_v['id_order_detail']);
|
||||
$prod_ord_dtl_name = $order_details_obj->product_name;
|
||||
$cart_htl_data[$type_key]['name'] = $prod_ord_dtl_name;
|
||||
$cart_htl_data[$type_key]['name'] = $order_details_obj->product_name;
|
||||
//work on entring refund data
|
||||
$ord_refnd_info = $obj_ord_ref_info->getOderRefundInfoByIdOrderIdProductByDate($this->id_order, $type_value['product_id'], $data_v['date_from'], $data_v['date_to']);
|
||||
if ($ord_refnd_info) {
|
||||
$stage_name = $obj_refund_stages->getNameById($ord_refnd_info['refund_stage_id']);
|
||||
} else {
|
||||
$stage_name = '';
|
||||
$non_requested_rooms = 1;
|
||||
}
|
||||
// $ord_refnd_info = $obj_ord_ref_info->getOderRefundInfoByIdOrderIdProductByDate($this->id_order, $type_value['product_id'], $data_v['date_from'], $data_v['date_to']);
|
||||
// if ($ord_refnd_info) {
|
||||
// $stage_name = $obj_refund_stages->getNameById($ord_refnd_info['refund_stage_id']);
|
||||
// } else {
|
||||
// $non_requested_rooms = 1;
|
||||
// }
|
||||
$stage_name = '';
|
||||
if (isset($cart_htl_data[$type_key]['date_diff'][$date_join])) {
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['num_rm'] += 1;
|
||||
|
||||
@@ -259,46 +253,35 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['feature_price_diff'] = $feature_price_diff;
|
||||
|
||||
//enter hotel name
|
||||
$hotelInfo = $objHtlBranchInfo->hotelBranchesInfo(
|
||||
Configuration::get('PS_LANG_DEFAULT'),
|
||||
2,
|
||||
0,
|
||||
$data_v['id_hotel']
|
||||
);
|
||||
$cart_htl_data[$type_key]['hotel_name'] = $hotelInfo['hotel_name'];
|
||||
$cart_htl_data[$type_key]['hotel_name'] = $data_v['hotel_name'];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$objCartOrder->hasInvoice()) {
|
||||
$orders_has_invoice = 0;
|
||||
}
|
||||
//For Advanced Payment
|
||||
$order_adv_dtl = $obj_customer_adv->getCstAdvPaymentDtlByIdOrder($idOrder);
|
||||
if ($order_adv_dtl) {
|
||||
$this->context->smarty->assign('order_adv_dtl', $order_adv_dtl);
|
||||
}
|
||||
|
||||
$orderTotalInfo['total_wrapping'] += $objCartOrder->total_wrapping;
|
||||
$orderTotalInfo['total_products_te'] += $objCartOrder->getTotalProductsWithoutTaxes();
|
||||
$orderTotalInfo['total_products_ti'] += $objCartOrder->getTotalProductsWithTaxes();
|
||||
$orderTotalInfo['total_discounts'] += $objCartOrder->total_discounts;
|
||||
$orderTotalInfo['total_paid'] += $objCartOrder->total_paid;
|
||||
$orderTotalInfo['total_paid_amount'] += $order_adv_dtl['total_paid_amount'];
|
||||
$orderTotalInfo['total_order_amount'] += $order_adv_dtl['total_order_amount'];
|
||||
$orderTotalInfo['total_paid_real'] += $objCartOrder->total_paid_real;
|
||||
}
|
||||
$redirect_link_terms = $this->context->link->getCMSLink(new CMS(3, $this->context->language->id), null, $this->context->language->id);
|
||||
$this->context->smarty->assign('orderTotalInfo', $orderTotalInfo);
|
||||
$this->context->smarty->assign('redirect_link_terms', $redirect_link_terms);
|
||||
|
||||
$this->context->smarty->assign('cart_htl_data', $cart_htl_data);
|
||||
$this->context->smarty->assign('non_requested_rooms', $non_requested_rooms);
|
||||
$this->context->smarty->assign('orders_has_invoice', $orders_has_invoice);
|
||||
}
|
||||
|
||||
$this->context->smarty->assign('orderTotalInfo', $orderTotalInfo);
|
||||
$this->context->smarty->assign('non_requested_rooms', $non_requested_rooms);
|
||||
$this->context->smarty->assign('orders_has_invoice', $orders_has_invoice);
|
||||
}
|
||||
|
||||
$shw_bo_msg = Configuration::get('WK_SHOW_MSG_ON_BO');
|
||||
$bo_msg = Configuration::get('WK_BO_MESSAGE');
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'return_allowed' => (int) $order->isReturnable(),
|
||||
'refund_allowed' => (int) $order->isReturnable(),
|
||||
'any_back_order' => $any_back_order,
|
||||
'shw_bo_msg' => $shw_bo_msg,
|
||||
'back_ord_msg' => $bo_msg,
|
||||
@@ -308,7 +291,6 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
)
|
||||
);
|
||||
|
||||
/*END*/
|
||||
$this->setTemplate(_PS_THEME_DIR_.'order-confirmation.tpl');
|
||||
}
|
||||
|
||||
|
||||
@@ -159,185 +159,99 @@ class OrderDetailControllerCore extends FrontController
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
//By webkul to save order refund Info in our table
|
||||
$saveRefundInfo = Tools::getValue('saveRefundInfo');
|
||||
$saveTotalOrderRefundInfo = Tools::getValue('saveTotalOrderRefundInfo');
|
||||
$method = Tools::getValue('method');
|
||||
if ($method == 'getRoomTypeBookingDemands') {
|
||||
$extraDemandsTpl = '';
|
||||
if (($idProduct = Tools::getValue('id_product'))
|
||||
&& ($idOrder = Tools::getValue('id_order'))
|
||||
&& ($dateFrom = Tools::getValue('date_from'))
|
||||
&& ($dateTo = Tools::getValue('date_to'))
|
||||
) {
|
||||
$objBookingDemand = new HotelBookingDemands();
|
||||
$useTax = 0;
|
||||
$customer = Context::getContext()->customer;
|
||||
if (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC) {
|
||||
$useTax = 1;
|
||||
}
|
||||
if ($extraDemands = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$idOrder,
|
||||
$idProduct,
|
||||
0,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
1,
|
||||
0,
|
||||
$useTax
|
||||
)) {
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'useTax' => $useTax,
|
||||
'extraDemands' => $extraDemands,
|
||||
)
|
||||
);
|
||||
$extraDemandsTpl .= $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order_booking_demands.tpl');
|
||||
}
|
||||
}
|
||||
die($extraDemandsTpl);
|
||||
}
|
||||
|
||||
/*If requesst for only one room cancellation*/
|
||||
if (isset($saveRefundInfo) && $saveRefundInfo) {
|
||||
$id_order = Tools::getValue('id_order');
|
||||
$id_customer = Tools::getValue('id_customer');
|
||||
$id_currency = Tools::getValue('id_currency');
|
||||
$id_product = Tools::getValue('id_product');
|
||||
$num_rooms = Tools::getValue('num_rooms');
|
||||
$date_from = Tools::getValue('date_from');
|
||||
$date_to = Tools::getValue('date_to');
|
||||
$amount = Tools::getValue('amount');
|
||||
$cancellation_reason = Tools::getValue('cancellation_reason');
|
||||
|
||||
$objHtlRefundInfo = new HotelOrderRefundInfo();
|
||||
$objHtlRefundInfo->id_order = $id_order;
|
||||
$objHtlRefundInfo->id_product = $id_product;
|
||||
$objHtlRefundInfo->id_customer = $id_customer;
|
||||
$objHtlRefundInfo->id_currency = $id_currency;
|
||||
$objHtlRefundInfo->refund_stage_id = 1;
|
||||
$objHtlRefundInfo->order_amount = $amount;
|
||||
$objHtlRefundInfo->cancellation_reason = $cancellation_reason;
|
||||
$objHtlRefundInfo->num_rooms = $num_rooms;
|
||||
$objHtlRefundInfo->date_from = $date_from;
|
||||
$objHtlRefundInfo->date_to = $date_to;
|
||||
$objHtlRefundInfo->save();
|
||||
|
||||
$id_shop = Context::getContext()->shop->id;
|
||||
|
||||
//customer info
|
||||
$obj_customer = new Customer($id_customer);
|
||||
|
||||
//product info
|
||||
$prod_obj = new Product($id_product, false, $this->context->language->id);
|
||||
$product_name = $prod_obj->name;
|
||||
|
||||
//currency data
|
||||
$obj_currency = new Currency($id_currency);
|
||||
$currency_sign = $obj_currency->sign;
|
||||
|
||||
$admin_data = new EmployeeCore(1);
|
||||
$templateVars = array(
|
||||
'{shop_name}' => Tools::safeOutput(Configuration::get('PS_SHOP_NAME', null, null, $id_shop)),
|
||||
'{history_url}' => Context::getContext()->link->getPageLink('history', true, Context::getContext()->language->id, null, false, $id_shop),
|
||||
'{my_account_url}' => Context::getContext()->link->getPageLink('my-account', true, Context::getContext()->language->id, null, false, $id_shop),
|
||||
'{currency_sign}' => $currency_sign,
|
||||
'{amount}' => $amount,
|
||||
'{date_from}' => $date_from,
|
||||
'{date_to}' => $date_to,
|
||||
'{cust_name}' => $obj_customer->firstname.' '.$obj_customer->lastname,
|
||||
'{cust_email}' => $obj_customer->email,
|
||||
'{product_name}' => $product_name,
|
||||
'{admin_email}' => $admin_data->email,
|
||||
);
|
||||
$to = $obj_customer->email;
|
||||
$id_lang = Configuration::get('PS_LANG_DEFAULT');
|
||||
$temp_path = _PS_MODULE_DIR_.'hotelreservationsystem/mails/';
|
||||
$template_name = 'request_processed';
|
||||
|
||||
if ($objHtlRefundInfo->id) {
|
||||
if (Mail::Send($id_lang, $template_name, Mail::l('Order Cancellation Status', $id_lang), $templateVars, $to, null, null, null, null, null, $temp_path, false, null, null)) {
|
||||
$mail_err = 0;
|
||||
} else {
|
||||
$mail_err = 1;
|
||||
}
|
||||
|
||||
die(Tools::jsonEncode(array('status' => 'success', 'mail_err' => $mail_err)));
|
||||
} else {
|
||||
die(Tools::jsonEncode(array('status' => 'failed', 'mail_err' => $mail_err)));
|
||||
}
|
||||
}
|
||||
|
||||
/*If requesst for only all rooms cancellation in the order*/
|
||||
if (isset($saveTotalOrderRefundInfo) && $saveTotalOrderRefundInfo) {
|
||||
$total_order_json_string_data = Tools::getValue('total_order_data');
|
||||
$total_order_data = Tools::jsonDecode($total_order_json_string_data, true);
|
||||
$id_customer = Tools::getValue('id_customer');
|
||||
$id_currency = Tools::getValue('id_currency');
|
||||
$cancellation_reason = Tools::getValue('cancellation_reason');
|
||||
$id_order = Tools::getValue('id_order');
|
||||
|
||||
if (isset($total_order_data) && $total_order_data) {
|
||||
$objHtlRefund = new HotelOrderRefundInfo();
|
||||
foreach ($total_order_data as $data_k => $data_v) {
|
||||
foreach ($data_v['date_diff'] as $rm_k => $rm_v) {
|
||||
$exist_info_refund = $objHtlRefund->getOderRefundInfoByIdOrderIdProductByDate($id_order, $data_v['id_product'], $rm_v['data_form'], $rm_v['data_to']);
|
||||
|
||||
// any room existing in htl_order_refund_info
|
||||
if (!$exist_info_refund) {
|
||||
$objHtlRefundInfo = new HotelOrderRefundInfo();
|
||||
$objHtlRefundInfo->id_order = $id_order;
|
||||
$objHtlRefundInfo->id_product = $data_v['id_product'];
|
||||
$objHtlRefundInfo->id_customer = $id_customer;
|
||||
$objHtlRefundInfo->id_currency = $id_currency;
|
||||
$objHtlRefundInfo->refund_stage_id = 1;
|
||||
$objHtlRefundInfo->order_amount = $rm_v['amount_tax_incl'] + $rm_v['extra_demands_price'];
|
||||
$objHtlRefundInfo->cancellation_reason = $cancellation_reason;
|
||||
$objHtlRefundInfo->num_rooms = $rm_v['num_rm'];
|
||||
$objHtlRefundInfo->date_from = $rm_v['data_form'];
|
||||
$objHtlRefundInfo->date_to = $rm_v['data_to'];
|
||||
$objHtlRefundInfo->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$id_shop = Context::getContext()->shop->id;
|
||||
$obj_order = new Order($id_order);
|
||||
|
||||
//customer info
|
||||
$obj_customer = new Customer($id_customer);
|
||||
|
||||
$admin_data = new EmployeeCore(1);
|
||||
$templateVars = array(
|
||||
'{shop_name}' => Tools::safeOutput(Configuration::get('PS_SHOP_NAME', null, null, $id_shop)),
|
||||
'{history_url}' => Context::getContext()->link->getPageLink('history', true, Context::getContext()->language->id, null, false, $id_shop),
|
||||
'{my_account_url}' => Context::getContext()->link->getPageLink('my-account', true, Context::getContext()->language->id, null, false, $id_shop),
|
||||
'{cust_name}' => $obj_customer->firstname.' '.$obj_customer->lastname,
|
||||
'{order_reference}' => $obj_order->reference,
|
||||
);
|
||||
$to = $obj_customer->email;
|
||||
$id_lang = Configuration::get('PS_LANG_DEFAULT');
|
||||
$temp_path = _PS_MODULE_DIR_.'hotelreservationsystem/mails/';
|
||||
$template_name = 'total_order_processed';
|
||||
|
||||
if ($objHtlRefundInfo->id) {
|
||||
if (Mail::Send($id_lang, $template_name, Mail::l('Order Cancellation Status', $id_lang), $templateVars, $to, null, null, null, null, null, $temp_path, false, null, null)) {
|
||||
$mail_err = 0;
|
||||
} else {
|
||||
$mail_err = 1;
|
||||
}
|
||||
die(Tools::jsonEncode(array('status' => 'success', 'mail_err' => $mail_err)));
|
||||
} else {
|
||||
die(Tools::jsonEncode(array('status' => 'failed')));
|
||||
}
|
||||
}
|
||||
//end
|
||||
|
||||
if (!($id_order = (int) Tools::getValue('id_order')) || !Validate::isUnsignedId($id_order)) {
|
||||
$this->errors[] = Tools::displayError('Order ID required');
|
||||
} else {
|
||||
$order = new Order($id_order);
|
||||
// Here handle request from the ajax on order details page i.e refund, additional qty etc
|
||||
$method = Tools::getValue('method');
|
||||
// extra demands popup ajax
|
||||
if ($method == 'getRoomTypeBookingDemands') {
|
||||
$extraDemandsTpl = '';
|
||||
if (($idProduct = Tools::getValue('id_product'))
|
||||
&& ($idOrder = Tools::getValue('id_order'))
|
||||
&& ($dateFrom = Tools::getValue('date_from'))
|
||||
&& ($dateTo = Tools::getValue('date_to'))
|
||||
) {
|
||||
$objBookingDemand = new HotelBookingDemands();
|
||||
$useTax = 0;
|
||||
$customer = Context::getContext()->customer;
|
||||
if (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC) {
|
||||
$useTax = 1;
|
||||
}
|
||||
if ($extraDemands = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$idOrder,
|
||||
$idProduct,
|
||||
0,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
1,
|
||||
0,
|
||||
$useTax
|
||||
)) {
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'useTax' => $useTax,
|
||||
'extraDemands' => $extraDemands,
|
||||
)
|
||||
);
|
||||
$extraDemandsTpl .= $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order_booking_demands.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
die($extraDemandsTpl);
|
||||
} elseif ($method == 'submitRefundRequest') { // room cancellation ajax
|
||||
$hasError = 0;
|
||||
if (!$refundReason = Tools::getValue('cancellation_reason')) {
|
||||
$hasError = 1;
|
||||
}
|
||||
if ($bookingRefunds = Tools::getValue('bookings_to_refund')) {
|
||||
if (!count($bookingRefunds = Tools::jsonDecode($bookingRefunds, true))) {
|
||||
$hasError = 1;
|
||||
} else {
|
||||
foreach ($bookingRefunds as $idHtlBooking) {
|
||||
if (OrderReturn::getOrdersReturnDetail($order->id, 0, $idHtlBooking)) {
|
||||
$hasError = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$hasError = 1;
|
||||
}
|
||||
if (!$hasError) {
|
||||
$objOrderReturn = new OrderReturn();
|
||||
$objOrderReturn->id_customer = $order->id_customer;
|
||||
$objOrderReturn->id_order = $order->id;
|
||||
$objOrderReturn->state = 0;
|
||||
$objOrderReturn->by_admin = 0;
|
||||
$objOrderReturn->question = $refundReason;
|
||||
$objOrderReturn->save();
|
||||
if ($objOrderReturn->id) {
|
||||
foreach ($bookingRefunds as $idHtlBooking) {
|
||||
$objHtlBooking = new HotelBookingDetail($idHtlBooking);
|
||||
$numDays = $objHtlBooking->getNumberOfDays(
|
||||
$objHtlBooking->date_from,
|
||||
$objHtlBooking->date_to
|
||||
);
|
||||
|
||||
$objOrderReturnDetail = new OrderReturnDetail();
|
||||
$objOrderReturnDetail->id_order_return = $objOrderReturn->id;
|
||||
$objOrderReturnDetail->id_order_detail = $objHtlBooking->id_order_detail;
|
||||
$objOrderReturnDetail->product_quantity = $numDays;
|
||||
$objOrderReturnDetail->id_htl_booking = $idHtlBooking;
|
||||
$objOrderReturnDetail->save();
|
||||
}
|
||||
}
|
||||
// Emails to customer, admin on refund request state change
|
||||
$objOrderReturn->changeIdOrderReturnState(OrderReturnState::ORDER_RETRUN_FIRST_STATUS, $objOrderReturn->id);
|
||||
|
||||
die(Tools::jsonEncode(array('status' => 1)));
|
||||
}
|
||||
die(Tools::jsonEncode(array('status' => 0)));
|
||||
}
|
||||
// END ajax request handle
|
||||
|
||||
if (Validate::isLoadedObject($order) && $order->id_customer == $this->context->customer->id) {
|
||||
$id_order_state = (int)$order->getCurrentState();
|
||||
$carrier = new Carrier((int)$order->id_carrier, (int)$order->id_lang);
|
||||
@@ -355,36 +269,26 @@ class OrderDetailControllerCore extends FrontController
|
||||
}
|
||||
$products = $order->getProducts();
|
||||
|
||||
/* DEPRECATED: customizedDatas @since 1.5 */
|
||||
$customizedDatas = Product::getAllCustomizedDatas((int)$order->id_cart);
|
||||
Product::addCustomizationPrice($products, $customizedDatas);
|
||||
|
||||
OrderReturn::addReturnedQuantity($products, $order->id);
|
||||
$order_status = new OrderState((int)$id_order_state, (int)$order->id_lang);
|
||||
|
||||
$customer = new Customer($order->id_customer);
|
||||
|
||||
//by webkul to show order details properly on order history page
|
||||
|
||||
if ($hotelresInstalled = Module::isInstalled('hotelreservationsystem')) {
|
||||
if (Module::isInstalled('hotelreservationsystem')) {
|
||||
include_once _PS_MODULE_DIR_.'hotelreservationsystem/define.php';
|
||||
$objHtlBranchInfo = new HotelBranchInformation();
|
||||
$objBookingDetail = new HotelBookingDetail();
|
||||
$objRoomType = new HotelRoomType();
|
||||
$objCustomerAdv = new HotelCustomerAdvancedPayment();
|
||||
$objOrdRefundInfo = new HotelOrderRefundInfo();
|
||||
$objRefundStages = new HotelOrderRefundStages();
|
||||
$objBookingDemand = new HotelBookingDemands();
|
||||
$nonRequestedRooms = 0;
|
||||
$nonRequestedRooms = 1;
|
||||
$anyBackOrder = 0;
|
||||
$processedProducts = array();
|
||||
$cartHotelData = array();
|
||||
}
|
||||
$total_demands_price_te = 0;
|
||||
$total_demands_price_ti = 0;
|
||||
|
||||
if ($hotelresInstalled) {
|
||||
if (!empty($products)) {
|
||||
$total_demands_price_te = 0;
|
||||
$total_demands_price_ti = 0;
|
||||
foreach ($products as $type_key => $type_value) {
|
||||
if (in_array($type_value['product_id'], $processedProducts)) {
|
||||
continue;
|
||||
@@ -407,7 +311,6 @@ class OrderDetailControllerCore extends FrontController
|
||||
$order_bk_data = $objBookingDetail->getOnlyOrderBookingData($order->id, $customer->id_guest, $type_value['product_id']);
|
||||
}
|
||||
$rm_dtl = $objRoomType->getRoomTypeInfoByIdProduct($type_value['product_id']);
|
||||
|
||||
$cartHotelData[$type_key]['id_product'] = $type_value['product_id'];
|
||||
$cartHotelData[$type_key]['cover_img'] = $cover_img;
|
||||
$cartHotelData[$type_key]['adult'] = $rm_dtl['adult'];
|
||||
@@ -419,20 +322,10 @@ class OrderDetailControllerCore extends FrontController
|
||||
|
||||
/*Product price when order was created*/
|
||||
$order_details_obj = new OrderDetail($data_v['id_order_detail']);
|
||||
$prod_ord_dtl_name = $order_details_obj->product_name;
|
||||
$cartHotelData[$type_key]['name'] = $prod_ord_dtl_name;
|
||||
|
||||
$cartHotelData[$type_key]['name'] = $order_details_obj->product_name;
|
||||
$cartHotelData[$type_key]['paid_unit_price_tax_excl'] = ($order_details_obj->total_price_tax_excl)/$order_details_obj->product_quantity;
|
||||
$cartHotelData[$type_key]['paid_unit_price_tax_incl'] = ($order_details_obj->total_price_tax_incl)/$order_details_obj->product_quantity;
|
||||
|
||||
//work on entring refund data
|
||||
$ord_refnd_info = $objOrdRefundInfo->getOderRefundInfoByIdOrderIdProductByDate($id_order, $type_value['product_id'], $data_v['date_from'], $data_v['date_to']);
|
||||
if ($ord_refnd_info) {
|
||||
$stage_name = $objRefundStages->getNameById($ord_refnd_info['refund_stage_id']);
|
||||
} else {
|
||||
$stage_name = '';
|
||||
$nonRequestedRooms = 1;
|
||||
}
|
||||
if (isset($cartHotelData[$type_key]['date_diff'][$date_join])) {
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['num_rm'] += 1;
|
||||
|
||||
@@ -447,8 +340,6 @@ class OrderDetailControllerCore extends FrontController
|
||||
if ($data_v['is_back_order']) {
|
||||
$anyBackOrder = 1;
|
||||
}
|
||||
//refund_stage
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['stage_name'] = $stage_name;
|
||||
} else {
|
||||
$num_days = $objBookingDetail->getNumberOfDays($data_v['date_from'], $data_v['date_to']);
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['num_rm'] = 1;
|
||||
@@ -464,9 +355,10 @@ class OrderDetailControllerCore extends FrontController
|
||||
if ($data_v['is_back_order']) {
|
||||
$anyBackOrder = 1;
|
||||
}
|
||||
//refund_stage
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['stage_name'] = $stage_name;
|
||||
}
|
||||
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['ids_htl_booking_detail'][] = $data_v['id'];
|
||||
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$id_order,
|
||||
$type_value['product_id'],
|
||||
@@ -510,43 +402,47 @@ class OrderDetailControllerCore extends FrontController
|
||||
$feature_price_diff = (float)($cartHotelData[$type_key]['date_diff'][$date_join]['product_price_without_reduction_tax_incl'] - $cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl']);
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['feature_price_diff'] = $feature_price_diff;
|
||||
|
||||
//enter hotel name
|
||||
$hotelInfo = $objHtlBranchInfo->hotelBranchesInfo(
|
||||
Configuration::get('PS_LANG_DEFAULT'),
|
||||
2,
|
||||
0,
|
||||
$data_v['id_hotel']
|
||||
);
|
||||
$cartHotelData[$type_key]['hotel_name'] = $hotelInfo['hotel_name'];
|
||||
$cartHotelData[$type_key]['hotel_name'] = $data_v['hotel_name'];
|
||||
}
|
||||
}
|
||||
$redirectTermsLink = $this->context->link->getCMSLink(new CMS(3, $this->context->language->id), null, $this->context->language->id);
|
||||
|
||||
//For Advanced Payment
|
||||
$orderAdvDetail = $objCustomerAdv->getCstAdvPaymentDtlByIdOrder($order->id);
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'total_demands_price_ti' => $total_demands_price_ti,
|
||||
'total_demands_price_te' => $total_demands_price_te,
|
||||
'any_back_order' => $anyBackOrder,
|
||||
'shw_bo_msg' => Configuration::get('WK_SHOW_MSG_ON_BO'),
|
||||
'back_ord_msg' => Configuration::get('WK_BO_MESSAGE'),
|
||||
'order_has_invoice' => $order->hasInvoice(),
|
||||
'redirect_link_terms' => $redirectTermsLink,
|
||||
'cart_htl_data' => $cartHotelData,
|
||||
'non_requested_rooms' => $nonRequestedRooms,
|
||||
'order_adv_dtl' => $orderAdvDetail
|
||||
)
|
||||
);
|
||||
$redirectTermsLink = $this->context->link->getCMSLink(new CMS(3, $this->context->language->id), null, $this->context->language->id);
|
||||
}
|
||||
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'id_cms_refund_policy' => Configuration::get('WK_GLOBAL_REFUND_POLICY_CMS'),
|
||||
'THEME_DIR' => _THEME_DIR_,
|
||||
'total_demands_price_ti' => $total_demands_price_ti,
|
||||
'total_demands_price_te' => $total_demands_price_te,
|
||||
'any_back_order' => $anyBackOrder,
|
||||
'shw_bo_msg' => Configuration::get('WK_SHOW_MSG_ON_BO'),
|
||||
'back_ord_msg' => Configuration::get('WK_BO_MESSAGE'),
|
||||
'order_has_invoice' => $order->hasInvoice(),
|
||||
'cart_htl_data' => $cartHotelData,
|
||||
'non_requested_rooms' => $nonRequestedRooms,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$objOrderReturn = new OrderReturn();
|
||||
$refundedAmount = 0;
|
||||
if ($refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($order->id, 0, 1)) {
|
||||
$refundedAmount = $objOrderReturn->getRefundedAmount($order->id);
|
||||
}
|
||||
//end
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'hasOrderPaid' => $order->hasBeenPaid(),
|
||||
// refund info
|
||||
'refund_allowed' => (int) $order->isReturnable(),
|
||||
'returns' => OrderReturn::getOrdersReturn($order->id_customer, $order->id),
|
||||
'refundReqBookings' => $refundReqBookings,
|
||||
'hasCompletelyRefunded' => $order->hasCompletelyRefunded(),
|
||||
'refundedAmount' => $refundedAmount,
|
||||
|
||||
'shop_name' => strval(Configuration::get('PS_SHOP_NAME')),
|
||||
'order' => $order,
|
||||
'guestInformations' => (array)new Customer($order->id_customer),
|
||||
'return_allowed' => (int) $order->isReturnable(),
|
||||
'currency' => new Currency($order->id_currency),
|
||||
'order_state' => (int) $id_order_state,
|
||||
'invoiceAllowed' => (int) Configuration::get('PS_INVOICE'),
|
||||
@@ -571,9 +467,6 @@ class OrderDetailControllerCore extends FrontController
|
||||
'isRecyclable' => Configuration::get('PS_RECYCLABLE_PACK'),
|
||||
'use_tax' => Configuration::get('PS_TAX'),
|
||||
'group_use_tax' => (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC),
|
||||
/* DEPRECATED: customizedDatas @since 1.5 */
|
||||
'customizedDatas' => $customizedDatas,
|
||||
/* DEPRECATED: customizedDatas @since 1.5 */
|
||||
'reorderingAllowed' => !(bool) Configuration::get('PS_DISALLOW_HISTORY_REORDERING'),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -31,59 +31,6 @@ class OrderFollowControllerCore extends FrontController
|
||||
public $authRedirection = 'order-follow';
|
||||
public $ssl = true;
|
||||
|
||||
/**
|
||||
* Start forms process
|
||||
* @see FrontController::postProcess()
|
||||
*/
|
||||
public function postProcess()
|
||||
{
|
||||
if (Tools::isSubmit('submitReturnMerchandise')) {
|
||||
$customizationQtyInput = Tools::getValue('customization_qty_input');
|
||||
$order_qte_input = Tools::getValue('order_qte_input');
|
||||
$customizationIds = Tools::getValue('customization_ids');
|
||||
|
||||
if (!$id_order = (int)Tools::getValue('id_order')) {
|
||||
Tools::redirect('index.php?controller=history');
|
||||
}
|
||||
if (!$order_qte_input && !$customizationQtyInput && !$customizationIds) {
|
||||
Tools::redirect('index.php?controller=order-follow&errorDetail1');
|
||||
}
|
||||
if (!$customizationIds && !$ids_order_detail = Tools::getValue('ids_order_detail')) {
|
||||
Tools::redirect('index.php?controller=order-follow&errorDetail2');
|
||||
}
|
||||
|
||||
$order = new Order((int)$id_order);
|
||||
if (!$order->isReturnable()) {
|
||||
Tools::redirect('index.php?controller=order-follow&errorNotReturnable');
|
||||
}
|
||||
if ($order->id_customer != $this->context->customer->id) {
|
||||
die(Tools::displayError());
|
||||
}
|
||||
$orderReturn = new OrderReturn();
|
||||
$orderReturn->id_customer = (int)$this->context->customer->id;
|
||||
$orderReturn->id_order = $id_order;
|
||||
$orderReturn->question = htmlspecialchars(Tools::getValue('returnText'));
|
||||
if (empty($orderReturn->question)) {
|
||||
Tools::redirect('index.php?controller=order-follow&errorMsg&'.
|
||||
http_build_query(array(
|
||||
'ids_order_detail' => $ids_order_detail,
|
||||
'order_qte_input' => $order_qte_input,
|
||||
'id_order' => Tools::getValue('id_order'),
|
||||
)));
|
||||
}
|
||||
|
||||
if (!$orderReturn->checkEnoughProduct($ids_order_detail, $order_qte_input, $customizationIds, $customizationQtyInput)) {
|
||||
Tools::redirect('index.php?controller=order-follow&errorQuantity');
|
||||
}
|
||||
|
||||
$orderReturn->state = 1;
|
||||
$orderReturn->add();
|
||||
$orderReturn->addReturnDetail($ids_order_detail, $order_qte_input, $customizationIds, $customizationQtyInput);
|
||||
Hook::exec('actionOrderReturn', array('orderReturn' => $orderReturn));
|
||||
Tools::redirect('index.php?controller=order-follow');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign template vars related to page content
|
||||
* @see FrontController::initContent()
|
||||
@@ -91,42 +38,16 @@ class OrderFollowControllerCore extends FrontController
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
$this->show_breadcrump = true;
|
||||
if (isset($this->context->customer->id) && $this->context->customer->id) {
|
||||
$ordersReturns = OrderReturn::getOrdersReturn($this->context->customer->id, Tools::getValue('id_order'));
|
||||
$this->context->smarty->assign('ordersReturns', $ordersReturns);
|
||||
|
||||
$ordersReturn = OrderReturn::getOrdersReturn($this->context->customer->id);
|
||||
if (Tools::isSubmit('errorQuantity')) {
|
||||
$this->context->smarty->assign('errorQuantity', true);
|
||||
} elseif (Tools::isSubmit('errorMsg')) {
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'errorMsg' => true,
|
||||
'ids_order_detail' => Tools::getValue('ids_order_detail', array()),
|
||||
'order_qte_input' => Tools::getValue('order_qte_input', array()),
|
||||
'id_order' => (int)Tools::getValue('id_order'),
|
||||
)
|
||||
$this->setTemplate(_PS_THEME_DIR_.'order-follow.tpl');
|
||||
} else {
|
||||
Tools::redirect(
|
||||
'index.php?controller=authentication&back='.urlencode($this->context->link->getpageLink('my-account'))
|
||||
);
|
||||
} elseif (Tools::isSubmit('errorDetail1')) {
|
||||
$this->context->smarty->assign('errorDetail1', true);
|
||||
} elseif (Tools::isSubmit('errorDetail2')) {
|
||||
$this->context->smarty->assign('errorDetail2', true);
|
||||
} elseif (Tools::isSubmit('errorNotReturnable')) {
|
||||
$this->context->smarty->assign('errorNotReturnable', true);
|
||||
}
|
||||
|
||||
$this->context->smarty->assign('ordersReturn', $ordersReturn);
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'order-follow.tpl');
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
$this->addCSS(array(_THEME_CSS_DIR_.'history.css', _THEME_CSS_DIR_.'addresses.css'));
|
||||
$this->addJqueryPlugin('scrollTo');
|
||||
$this->addJS(array(
|
||||
_THEME_JS_DIR_.'history.js',
|
||||
_THEME_JS_DIR_.'tools.js') // retro compat themes 1.5
|
||||
);
|
||||
$this->addjqueryPlugin('footable');
|
||||
$this->addJqueryPlugin('footable-sort');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -360,6 +360,9 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
// check ORDER RESTRICT condition before payment by the customer
|
||||
$orderRestrictErr = HotelOrderRestrictDate::validateOrderRestrictDateOnPayment($this);
|
||||
|
||||
/* id_carrier is not defined in database before choosing a carrier, set it to a default one to match a potential cart _rule */
|
||||
if (empty($this->context->cart->id_carrier)) {
|
||||
$checked = $this->context->cart->simulateCarrierSelectedOutput();
|
||||
@@ -403,6 +406,11 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
}
|
||||
}
|
||||
|
||||
// if any error is there in the checkout process the reset the steps of checkout
|
||||
if (count($this->errors)) {
|
||||
CheckoutProcess::refreshCheckoutProcess();
|
||||
}
|
||||
|
||||
// assign checkout process steps
|
||||
$this->setCheckoutProcess();
|
||||
|
||||
@@ -422,6 +430,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
$totalFacilityCostTE = $objCartBookingData->getCartExtraDemands($this->context->cart->id, 0, 0, 0, 0, 1, 0, 0);
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'orderRestrictErr' => $orderRestrictErr,
|
||||
'additional_facilities_tax' => ($totalFacilityCostTI - $totalFacilityCostTE),
|
||||
'totalFacilityCostTE' => $totalFacilityCostTE,
|
||||
'allDemands' => $allDemands,
|
||||
@@ -500,135 +509,46 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
$this->addJS(_THEME_JS_DIR_ . 'advanced-payment-api.js');
|
||||
$this->setTemplate(_PS_THEME_DIR_ . 'order-opc-advanced.tpl');
|
||||
} else {
|
||||
if (Module::isInstalled('hotelreservationsystem')) {
|
||||
require_once _PS_MODULE_DIR_.'hotelreservationsystem/define.php';
|
||||
$obj_htl_bk_dtl = new HotelBookingDetail();
|
||||
$obj_rm_type = new HotelRoomType();
|
||||
// set used objects in the below code
|
||||
$objBookingDetail = new HotelBookingDetail();
|
||||
$objHtlRoomType = new HotelRoomType();
|
||||
|
||||
$htl_rm_types = $this->context->cart->getProducts();
|
||||
if (!empty($htl_rm_types)) {
|
||||
// For Cart Lock
|
||||
$cartChanged = false;
|
||||
foreach ($htl_rm_types as $t_key => $t_value) {
|
||||
$rm_dtl = $obj_rm_type->getRoomTypeInfoByIdProduct($t_value['id_product']);
|
||||
$cart_bk_data = $objCartBookingData->getOnlyCartBookingData($this->context->cart->id, $this->context->cart->id_guest, $t_value['id_product']);
|
||||
$roomTypeList = $this->context->cart->getProducts();
|
||||
if (!empty($roomTypeList)) {
|
||||
|
||||
$cart_data = array();
|
||||
foreach ($cart_bk_data as $cd_key => $cd_val) {
|
||||
$date_join = strtotime($cd_val['date_from']).strtotime($cd_val['date_to']);
|
||||
if ($cartBookingInfo = HotelCartBookingData::getHotelCartBookingData()) {
|
||||
$this->context->smarty->assign('cart_htl_data', $cartBookingInfo);
|
||||
}
|
||||
|
||||
$cart_data[$date_join]['date_from'] = $cd_val['date_from'];
|
||||
$cart_data[$date_join]['date_to'] = $cd_val['date_to'];
|
||||
$cart_data[$date_join]['id_rms'][] = $cd_val['id_room'];
|
||||
// For Advanced Payment work
|
||||
$objAdvPayment = new HotelAdvancedPayment();
|
||||
if ($objAdvPayment->isAdvancePaymentAvailableForCurrentCart()) {
|
||||
if (Tools::isSubmit('submitAdvPayment')) {
|
||||
if (Tools::getValue('payment_type') == Order::ORDER_PAYMENT_TYPE_ADVANCE) {
|
||||
$this->context->cart->is_advance_payment = 1;
|
||||
} else {
|
||||
$this->context->cart->is_advance_payment = 0;
|
||||
}
|
||||
$this->context->cart->save();
|
||||
|
||||
foreach ($cart_data as $cl_key => $cl_val) {
|
||||
$avai_rm = $obj_htl_bk_dtl->DataForFrontSearch($cl_val['date_from'], $cl_val['date_to'], $rm_dtl['id_hotel'], $t_value['id_product'], 1);
|
||||
|
||||
if (count($avai_rm['rm_data'][0]['data']['available']) < count($cl_val['id_rms'])) {
|
||||
$cartChanged = true;
|
||||
|
||||
foreach ($cl_val['id_rms'] as $cr_key => $cr_val) {
|
||||
$isRmBooked = $obj_htl_bk_dtl->chechRoomBooked($cr_val, $cl_val['date_from'], $cl_val['date_to']);
|
||||
if ($isRmBooked) {
|
||||
$cartData = array(
|
||||
'id_cart' => $this->context->cart->id,
|
||||
'id_product' => $t_value['id_product'],
|
||||
'id_order' => 0,
|
||||
'id_room' => $cr_val,
|
||||
'date_from' => $cl_val['date_from'],
|
||||
'date_to' => $cl_val['date_to'],
|
||||
);
|
||||
$iscartdlt = $objCartBookingData->deleteRowByCartBookingData($cartData);
|
||||
if ($iscartdlt) {
|
||||
$nbDays = $obj_htl_bk_dtl->getNumberOfDays($cl_val['date_from'], $cl_val['date_to']);
|
||||
$this->context->cart->updateQty($nbDays, $t_value['id_product'], null, false, 'down');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->context->smarty->assign('cartChanged', $cartChanged);
|
||||
if ($cartBookingInfo = HotelCartBookingData::getHotelCartBookingData()) {
|
||||
$this->context->smarty->assign('cart_htl_data', $cartBookingInfo);
|
||||
Tools::redirect($this->context->link->getPageLink('order-opc'));
|
||||
}
|
||||
|
||||
// For Advanced Payment
|
||||
$objAdvPayment = new HotelAdvancedPayment();
|
||||
if ($advance_payment_active = $objAdvPayment->isAdvancePaymentAvailableForCurrentCart()) {
|
||||
|
||||
// $adv_amount = Tools::ps_round($objAdvPayment->getMinAdvPaymentAmount(), 2);
|
||||
$adv_amount = $objAdvPayment->getMinAdvPaymentAmount();
|
||||
if (Tools::isSubmit('submitAdvPayment')) {
|
||||
$id_customer_adv = Tools::getValue('id_customer_adv');
|
||||
if ($id_customer_adv) {
|
||||
$obj_customer_adv = new HotelCustomerAdvancedPayment($id_customer_adv);
|
||||
} else {
|
||||
$obj_customer_adv = new HotelCustomerAdvancedPayment();
|
||||
}
|
||||
|
||||
$payment_type = Tools::getValue('payment_type');
|
||||
if ($payment_type == 2) {
|
||||
$obj_customer_adv->id_cart = $this->context->cart->id;
|
||||
$obj_customer_adv->id_guest = $this->context->cart->id_guest;
|
||||
$obj_customer_adv->id_customer = $this->context->customer->id ? $this->context->customer->id : '';
|
||||
$obj_customer_adv->id_currency = $this->context->cart->id_currency;
|
||||
$obj_customer_adv->total_paid_amount = $adv_amount;
|
||||
$obj_customer_adv->total_order_amount = $this->context->cart->getOrderTotal(true, Cart::ONLY_PRODUCTS);
|
||||
$obj_customer_adv->save();
|
||||
} else {
|
||||
if ($id_customer_adv) {
|
||||
$obj_customer_adv->delete();
|
||||
}
|
||||
}
|
||||
|
||||
Tools::redirect($this->context->link->getPageLink('order-opc'));
|
||||
}
|
||||
|
||||
$obj_customer_adv = new HotelCustomerAdvancedPayment();
|
||||
$customer_adv_dtl = $obj_customer_adv->getClientAdvPaymentDtl($this->context->cart->id, $this->context->cart->id_guest, 1);
|
||||
if ($customer_adv_dtl) {
|
||||
if (Tools::ps_round($customer_adv_dtl['total_paid_amount'], 2) != Tools::ps_round($adv_amount, 2)) {
|
||||
// If More rooms are added in cart after selecting Advanced payment
|
||||
|
||||
$obj_customer_adv = new HotelCustomerAdvancedPayment($customer_adv_dtl['id']);
|
||||
$obj_customer_adv->id_currency = $this->context->cart->id_currency;
|
||||
$obj_customer_adv->total_paid_amount = $adv_amount;
|
||||
$obj_customer_adv->total_order_amount = $this->context->cart->getOrderTotal(true, Cart::BOTH);
|
||||
$obj_customer_adv->save();
|
||||
|
||||
Tools::redirect($this->context->link->getPageLink('order-opc'));
|
||||
}
|
||||
$due_amount = $this->context->cart->getOrderTotal(true, Cart::BOTH) - $customer_adv_dtl['total_paid_amount'];
|
||||
$customer_adv_dtl['due_amount'] = $due_amount;
|
||||
|
||||
$cart_rules = $this->context->cart->getCartRules();
|
||||
$total_discount = 0;
|
||||
if ($cart_rules) {
|
||||
foreach ($cart_rules as $discount) {
|
||||
if ($discount['reduction_currency'] != $this->context->cart->id_currency) {
|
||||
$discount['reduction_amount'] = Tools::convertPriceFull($discount['reduction_amount'], new Currency($discount['reduction_currency']), $this->context->currency);
|
||||
}
|
||||
$total_discount += $discount['reduction_amount'];
|
||||
}
|
||||
}
|
||||
$customer_adv_dtl['total_to_be_paid'] = ($customer_adv_dtl['total_paid_amount'] - $total_discount) > 0 ? ($customer_adv_dtl['total_paid_amount'] - $total_discount) : 0;
|
||||
$this->context->smarty->assign('customer_adv_dtl', $customer_adv_dtl);
|
||||
}
|
||||
$this->context->smarty->assign('adv_amount', $adv_amount);
|
||||
$this->context->smarty->assign('advance_payment_active', $advance_payment_active);
|
||||
// set if advance payment is selected by the customer
|
||||
if ($this->context->cart->is_advance_payment) {
|
||||
$this->context->smarty->assign('is_advance_payment', 1);
|
||||
}
|
||||
|
||||
// get advance payment amount and send data to the template
|
||||
$advPaymentAmount = $this->context->cart->getOrderTotal(true, Cart::ADVANCE_PAYMENT);
|
||||
$this->context->smarty->assign(array(
|
||||
'advance_payment_active'=> 1,
|
||||
'advPaymentAmount'=> $advPaymentAmount,
|
||||
'dueAmount'=> ($this->context->cart->getOrderTotal() - $advPaymentAmount),
|
||||
));
|
||||
}
|
||||
}
|
||||
/*Check Order restrict condition before Payment by the customer*/
|
||||
if (Module::isInstalled('hotelreservationsystem') && Module::isEnabled('hotelreservationsystem')) {
|
||||
$error = false;
|
||||
require_once _PS_MODULE_DIR_.'hotelreservationsystem/define.php';
|
||||
$cart_products = $this->context->cart->getProducts();
|
||||
$order_restrict_error = HotelOrderRestrictDate::validateOrderRestrictDateOnPayment($this);
|
||||
}
|
||||
/*END*/
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'order-opc.tpl');
|
||||
}
|
||||
}
|
||||
@@ -813,22 +733,15 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
}
|
||||
|
||||
|
||||
// For Advanced Payment (when advance paid amount will be zero when voucher will be applied)
|
||||
$freeAdvancePaymentOrder = false;
|
||||
if (Module::isInstalled('hotelreservationsystem')) {
|
||||
require_once(_PS_MODULE_DIR_.'hotelreservationsystem/define.php');
|
||||
$objCustomerAdvPay = new HotelCustomerAdvancedPayment();
|
||||
if ($objCustomerAdvPay->getClientAdvPaymentDtl(
|
||||
$this->context->cart->id,
|
||||
$this->context->cart->id_guest,
|
||||
1
|
||||
)) {
|
||||
$objAdvPayment = new HotelAdvancedPayment();
|
||||
$freeAdvancePaymentOrder = $objAdvPayment->_checkFreeAdvancePaymentOrder();
|
||||
}
|
||||
// check if customer has chosen advance payment option for this cart
|
||||
if ($this->context->cart->is_advance_payment) {
|
||||
$orderTotal = $this->context->cart->getOrderTotal(true, CART::ADVANCE_PAYMENT);
|
||||
} else {
|
||||
$orderTotal = $this->context->cart->getOrderTotal();
|
||||
}
|
||||
|
||||
/* Bypass payment step if total is 0 */
|
||||
if ($this->context->cart->getOrderTotal() <= 0 || $freeAdvancePaymentOrder) {
|
||||
if ($orderTotal <= 0) {
|
||||
return '<p class="center"><button class="button btn btn-default button-medium" name="confirmOrder" id="confirmOrder" onclick="confirmFreeOrder();" type="submit"> <span>'.Tools::displayError('I confirm my order.').'</span></button></p>';
|
||||
}
|
||||
|
||||
|
||||
@@ -31,62 +31,51 @@ class OrderReturnControllerCore extends FrontController
|
||||
public $authRedirection = 'order-follow';
|
||||
public $ssl = true;
|
||||
|
||||
/**
|
||||
* Initialize order return controller
|
||||
* @see FrontController::init()
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
|
||||
header('Cache-Control: no-cache, must-revalidate');
|
||||
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
|
||||
|
||||
$id_order_return = (int)Tools::getValue('id_order_return');
|
||||
|
||||
if (!isset($id_order_return) || !Validate::isUnsignedId($id_order_return)) {
|
||||
$this->errors[] = Tools::displayError('Order ID required');
|
||||
} else {
|
||||
$order_return = new OrderReturn((int)$id_order_return);
|
||||
if (Validate::isLoadedObject($order_return) && $order_return->id_customer == $this->context->cookie->id_customer) {
|
||||
$order = new Order((int)($order_return->id_order));
|
||||
if (Validate::isLoadedObject($order)) {
|
||||
$state = new OrderReturnState((int)$order_return->state);
|
||||
$this->context->smarty->assign(array(
|
||||
'orderRet' => $order_return,
|
||||
'order' => $order,
|
||||
'state_name' => $state->name[(int)$this->context->language->id],
|
||||
'return_allowed' => false,
|
||||
'products' => OrderReturn::getOrdersReturnProducts((int)$order_return->id, $order),
|
||||
'returnedCustomizations' => OrderReturn::getReturnedCustomizedProducts((int)$order_return->id_order),
|
||||
'customizedDatas' => Product::getAllCustomizedDatas((int)$order->id_cart)
|
||||
));
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('Cannot find the order return.');
|
||||
}
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('Cannot find the order return.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign template vars related to page content
|
||||
* @see FrontController::initContent()
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
$this->show_breadcrump = true;
|
||||
$this->display_column_left = false;
|
||||
$this->display_column_right = false;
|
||||
|
||||
parent::initContent();
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'errors' => $this->errors,
|
||||
'nbdaysreturn' => (int)Configuration::get('PS_ORDER_RETURN_NB_DAYS')
|
||||
));
|
||||
$this->setTemplate(_PS_THEME_DIR_.'order-return.tpl');
|
||||
}
|
||||
if (isset($this->context->customer->id) && $this->context->customer->id) {
|
||||
if (Validate::isLoadedObject($objOrderReturn = new OrderReturn(Tools::getValue('id_order_return')))) {
|
||||
if ($this->context->customer->id == $objOrderReturn->id_customer) {
|
||||
$refundStatuses = OrderReturnStateCore::getOrderReturnStates($this->context->language->id);
|
||||
$objOrder = new Order($objOrderReturn->id_order);
|
||||
$orderCurrency = new Currency($objOrder->id_currency);
|
||||
|
||||
public function displayAjax()
|
||||
{
|
||||
$this->smartyOutputContent($this->template);
|
||||
$refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($objOrderReturn->id_order, $objOrderReturn->id, 0, 1);
|
||||
|
||||
$this->context->smarty->assign(
|
||||
array (
|
||||
'orderReturnInfo' => (array)$objOrderReturn,
|
||||
'refundReqBookings' => $refundReqBookings,
|
||||
'orderInfo' => (array) $objOrder,
|
||||
'orderCurrency' => (array) $orderCurrency,
|
||||
'currentStateInfo' => (array) new OrderReturnState($objOrderReturn->state,
|
||||
$this->context->language->id),
|
||||
'isRefundCompleted' => $objOrderReturn->hasBeenCompleted(),
|
||||
)
|
||||
);
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'order-return.tpl');
|
||||
} else {
|
||||
Tools::redirect($this->context->link->getpagelink('my-account'));
|
||||
}
|
||||
} else {
|
||||
Tools::redirect($this->context->link->getpagelink('my-account'));
|
||||
}
|
||||
} else {
|
||||
Tools::redirect(
|
||||
'index.php?controller=authentication&back='.urlencode($this->context->link->getpageLink('my-account'))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -167,18 +167,27 @@ class ParentOrderControllerCore extends FrontController
|
||||
*/
|
||||
protected function _checkFreeOrder()
|
||||
{
|
||||
// For Advanced Payment (when advance paid amount will be zero when voucher will be applied)
|
||||
$freeAdvancePaymentOrder = false;
|
||||
if (Module::isInstalled('hotelreservationsystem'))
|
||||
{
|
||||
require_once (_PS_MODULE_DIR_.'hotelreservationsystem/define.php');
|
||||
$obj_adv_pmt = new HotelAdvancedPayment();
|
||||
$freeAdvancePaymentOrder = $obj_adv_pmt->_checkFreeAdvancePaymentOrder();
|
||||
// let see if any due amount for order status
|
||||
$dueAmount = 0;
|
||||
// check if customer has chosen advance payment option for this cart
|
||||
if ($this->context->cart->is_advance_payment) {
|
||||
$orderTotal = $this->context->cart->getOrderTotal(true, CART::ADVANCE_PAYMENT);
|
||||
$dueAmount = ($this->context->cart->getOrderTotal() - $orderTotal);
|
||||
} else {
|
||||
$orderTotal = $this->context->cart->getOrderTotal();
|
||||
}
|
||||
if (($this->context->cart->getOrderTotal() <= 0) || $freeAdvancePaymentOrder) {
|
||||
if ($orderTotal <= 0) {
|
||||
$order = new FreeOrder();
|
||||
$order->free_order_class = true;
|
||||
$order->validateOrder($this->context->cart->id, Configuration::get('PS_OS_PAYMENT'), 0, Tools::displayError('Free order', false), null, array(), null, false, $this->context->cart->secure_key);
|
||||
|
||||
// order status payment accepted if no amount is pending for the booking
|
||||
if ($dueAmount > 0) {
|
||||
$orderStatus = Configuration::get('PS_OS_AWAITING_REMOTE_PAYMENT');
|
||||
} else {
|
||||
$orderStatus = Configuration::get('PS_OS_PAYMENT');
|
||||
}
|
||||
|
||||
$order->validateOrder($this->context->cart->id, $orderStatus, 0, Tools::displayError('Free order', false), null, array(), null, false, $this->context->cart->secure_key);
|
||||
return (int)Order::getOrderByCartId($this->context->cart->id);
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -48,8 +48,6 @@ class ProductControllerCore extends FrontController
|
||||
$this->addJqueryPlugin(array('fancybox', 'idTabs', 'scrollTo', 'serialScroll', 'bxslider'));
|
||||
// for the search block By webkul
|
||||
$this->addCSS(_PS_MODULE_DIR_.'hotelreservationsystem/views/css/datepickerCustom.css');
|
||||
$this->context->controller->addJS(_PS_MODULE_DIR_.'hotelreservationsystem/views/js/roomSearchBlock.js');
|
||||
$this->context->controller->addCSS(_PS_MODULE_DIR_.'hotelreservationsystem/views/css/searchblock.css');
|
||||
$this->addJS(array(
|
||||
_THEME_JS_DIR_.'tools.js', // retro compat themes 1.5
|
||||
_THEME_JS_DIR_.'product.js'
|
||||
@@ -85,53 +83,6 @@ class ProductControllerCore extends FrontController
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
//by webkul for product page searching
|
||||
if (Tools::isSubmit('product_page_search_submit')) {
|
||||
$hotel_cat_id = Tools::getValue('hotel_cat_id');
|
||||
$check_in = Tools::getValue('check_in_time');
|
||||
$check_out = Tools::getValue('check_out_time');
|
||||
|
||||
$check_in = date('Y-m-d', strtotime($check_in));
|
||||
$check_out = date('Y-m-d', strtotime($check_out));
|
||||
|
||||
$curr_date = date('Y-m-d');
|
||||
$max_order_date = Tools::getValue('max_order_date');
|
||||
$error = false;
|
||||
|
||||
if ($hotel_cat_id == '') {
|
||||
$error = 1;
|
||||
} elseif ($check_in == '' || !Validate::isDate($check_in)) {
|
||||
$error = 2;
|
||||
} elseif ($check_out == '' || !Validate::isDate($check_out)) {
|
||||
$error = 3;
|
||||
} elseif ($check_in < $curr_date) {
|
||||
$error = 5;
|
||||
} elseif ($check_out <= $check_in) {
|
||||
$error = 4;
|
||||
}
|
||||
if ($max_order_date) {
|
||||
if ($max_order_date < $check_in || $max_order_date < $check_out) {
|
||||
$error = 6;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
if (Configuration::get('PS_REWRITING_SETTINGS')) {
|
||||
$redirect_link = $this->context->link->getCategoryLink(new Category($hotel_cat_id, $this->context->language->id), null, $this->context->language->id).'?date_from='.$check_in.'&date_to='.$check_out;
|
||||
} else {
|
||||
$redirect_link = $this->context->link->getCategoryLink(new Category($hotel_cat_id, $this->context->language->id), null, $this->context->language->id).'&date_from='.$check_in.'&date_to='.$check_out;
|
||||
}
|
||||
} else {
|
||||
$id_product = Tools::getValue('id_product');
|
||||
if (Configuration::get('PS_REWRITING_SETTINGS')) {
|
||||
$redirect_link = $this->context->link->getCategoryLink(new Category($hotel_cat_id, $this->context->language->id), null, $this->context->language->id).'?error='.$error;
|
||||
} else {
|
||||
$redirect_link = $this->context->link->getProductLink(new Product($id_product, false, $this->context->language->id), null, null, null, $this->context->language->id).'&error='.$error;
|
||||
}
|
||||
}
|
||||
|
||||
Tools::redirect($redirect_link);
|
||||
}
|
||||
|
||||
if ($id_product = (int) Tools::getValue('id_product')) {
|
||||
$this->product = new Product($id_product, true, $this->context->language->id, $this->context->shop->id);
|
||||
@@ -344,10 +295,10 @@ class ProductControllerCore extends FrontController
|
||||
|
||||
if (!($date_from = Tools::getValue('date_from'))) {
|
||||
$date_from = date('Y-m-d');
|
||||
$date_to = date('Y-m-d', strtotime($date_from) + 86400);
|
||||
$date_to = date('Y-m-d', strtotime('+1 day', strtotime($date_from)));
|
||||
}
|
||||
if (!($date_to = Tools::getValue('date_to'))) {
|
||||
$date_to = date('Y-m-d', strtotime($date_from) + 86400);
|
||||
$date_to = date('Y-m-d', strtotime('+1 day', strtotime($date_from)));
|
||||
}
|
||||
|
||||
$obj_htl_cart_booking_data = new HotelCartBookingData();
|
||||
@@ -366,45 +317,26 @@ class ProductControllerCore extends FrontController
|
||||
$obj_booking_dtl = new HotelBookingDetail();
|
||||
$hotel_room_data = $obj_booking_dtl->DataForFrontSearch($date_from, $date_to, $hotel_id, $this->product->id, 1);
|
||||
|
||||
|
||||
if ($hotel_room_data) {
|
||||
$total_available_rooms = $hotel_room_data['stats']['num_avail'];
|
||||
}
|
||||
|
||||
$hotel_branch_obj = new HotelBranchInformation($hotel_id);
|
||||
if (isset($this->context->cart->id)) {
|
||||
$num_cart_rooms = $obj_htl_cart_booking_data->getCountRoomsByIdCartIdProduct($this->context->cart->id, $this->product->id, $date_from, $date_to);
|
||||
if ($num_cart_rooms) {
|
||||
$total_available_rooms = $total_available_rooms - $num_cart_rooms;
|
||||
}
|
||||
}
|
||||
$locationEnabled = Configuration::get('WK_HOTEL_LOCATION_ENABLE');
|
||||
$hotel_branch_obj = new HotelBranchInformation($hotel_id);
|
||||
if ($locationEnabled) {
|
||||
$hotel_info = $hotel_branch_obj->hotelBranchesInfo(0, 1);
|
||||
$totalActiveHotels = count($hotel_info);
|
||||
$hotel_info = $hotel_branch_obj->hotelBranchInfoByCategoryId($hotel_branch_obj->id_category);
|
||||
} else {
|
||||
$hotel_info = $hotel_branch_obj->hotelBranchesInfo(0, 1);
|
||||
$totalActiveHotels = count($hotel_info);
|
||||
}
|
||||
foreach ($hotel_info as &$hotel) {
|
||||
$maxOrderDate = HotelOrderRestrictDate::getMaxOrderDate($hotel['id']);
|
||||
$hotel['max_order_date'] = date('Y-m-d', strtotime($maxOrderDate));
|
||||
}
|
||||
|
||||
$search_data['date_from'] = date('d-m-Y', strtotime($date_from));
|
||||
$search_data['date_to'] = date('d-m-Y', strtotime($date_to));
|
||||
$search_data['htl_dtl'] = $hotel_branch_obj->hotelBranchesInfo(0, 1, 1, $hotel_id);
|
||||
$search_data['location'] = $search_data['htl_dtl']['city'];
|
||||
if (isset($search_data['htl_dtl']['state_name'])) {
|
||||
$search_data['location'] .= ', '.$search_data['htl_dtl']['state_name'];
|
||||
}
|
||||
$search_data['location'] .= ', '.$search_data['htl_dtl']['country_name'];
|
||||
|
||||
/*Max date of ordering for order restrict*/
|
||||
$order_date_restrict = false;
|
||||
$max_order_date = HotelOrderRestrictDate::getMaxOrderDate($hotel_id);
|
||||
if ($max_order_date) {
|
||||
$max_order_date = date('Y-m-d', strtotime($max_order_date));
|
||||
if (strtotime('-1 day', strtotime($max_order_date)) < strtotime($date_from)
|
||||
|| strtotime($max_order_date) < strtotime($date_to)
|
||||
) {
|
||||
$order_date_restrict = true;
|
||||
}
|
||||
}
|
||||
/*End*/
|
||||
|
||||
@@ -419,16 +351,14 @@ class ProductControllerCore extends FrontController
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'totalActiveHotels' => $totalActiveHotels,
|
||||
'isHotelRefundable' => $hotel_branch_obj->isRefundable(),
|
||||
'max_order_date' => $max_order_date,
|
||||
'warning_num' => Configuration::get('WK_ROOM_LEFT_WARNING_NUMBER'),
|
||||
'ratting_img_path' => _MODULE_DIR_.'hotelreservationsystem/views/img/Slices/icons-sprite.png',
|
||||
'total_available_rooms' => $total_available_rooms,
|
||||
'all_hotels_info' => $hotel_info,
|
||||
'show_only_active_htl' => Configuration::get('WK_HOTEL_NAME_ENABLE'),
|
||||
'location_enable' => $locationEnabled,
|
||||
'total_price' => $total_price,
|
||||
'product_controller_url' => $this->context->link->getPageLink('product'),
|
||||
'num_days' => $num_days,
|
||||
@@ -439,7 +369,7 @@ class ProductControllerCore extends FrontController
|
||||
'hotel_policies' => $hotel_policies,
|
||||
'hotel_features' => $htl_features,
|
||||
'ftr_img_src' => _PS_IMG_.'rf/',
|
||||
'search_data' => $search_data,
|
||||
'order_date_restrict' => $order_date_restrict
|
||||
)
|
||||
);
|
||||
// product price after imposing feature prices...
|
||||
@@ -454,7 +384,14 @@ class ProductControllerCore extends FrontController
|
||||
$feature_price_diff = (float)($productPriceWithoutReduction - $feature_price);
|
||||
$this->context->smarty->assign('feature_price', $feature_price);
|
||||
$this->context->smarty->assign('feature_price_diff', $feature_price_diff);
|
||||
//END
|
||||
|
||||
// send hotel refund rules
|
||||
if ($hotel_branch_obj->active_refund) {
|
||||
$objBranchRefundRules = new HotelBranchRefundRules();
|
||||
if ($hotelRefundRules = $objBranchRefundRules->getHotelRefundRules($hotel_id, 0, 1, 0, 1)) {
|
||||
$this->context->smarty->assign('hotelRefundRules', $hotelRefundRules);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// get room type additional demands
|
||||
@@ -467,6 +404,8 @@ class ProductControllerCore extends FrontController
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'room_type_demands' => $roomTypeDemands,
|
||||
@@ -792,7 +731,8 @@ class ProductControllerCore extends FrontController
|
||||
} else {
|
||||
$attributes_combinations = array();
|
||||
}
|
||||
$this->context->smarty->assign(array(
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'attributesCombinations' => $attributes_combinations,
|
||||
'attribute_anchor_separator' => Configuration::get('PS_ATTRIBUTE_ANCHOR_SEPARATOR')
|
||||
)
|
||||
@@ -951,11 +891,11 @@ class ProductControllerCore extends FrontController
|
||||
$row['real_value'] = $row['base_price'] > 0 ? $row['base_price'] - $cur_price : $cur_price;
|
||||
} else {
|
||||
if ($row['reduction_type'] == 'amount') {
|
||||
if (Product::$_taxCalculationMethod == PS_TAX_INC) {
|
||||
$row['real_value'] = $row['reduction_tax'] == 1 ? $row['reduction'] : $row['reduction'] * (1 + $tax_rate / 100);
|
||||
} else {
|
||||
$row['real_value'] = $row['reduction_tax'] == 0 ? $row['reduction'] : $row['reduction'] / (1 + $tax_rate / 100);
|
||||
}
|
||||
if (Product::$_taxCalculationMethod == PS_TAX_INC) {
|
||||
$row['real_value'] = $row['reduction_tax'] == 1 ? $row['reduction'] : $row['reduction'] * (1 + $tax_rate / 100);
|
||||
} else {
|
||||
$row['real_value'] = $row['reduction_tax'] == 0 ? $row['reduction'] : $row['reduction'] / (1 + $tax_rate / 100);
|
||||
}
|
||||
$row['reduction_with_tax'] = $row['reduction_tax'] ? $row['reduction'] : $row['reduction'] + ($row['reduction'] *$tax_rate) / 100;
|
||||
} else {
|
||||
$row['real_value'] = $row['reduction'] * 100;
|
||||
@@ -985,7 +925,6 @@ class ProductControllerCore extends FrontController
|
||||
$dateFrom = Tools::getValue('date_from');
|
||||
$dateTo = Tools::getValue('date_to');
|
||||
$quantity = Tools::getValue('qty');
|
||||
$roomDemands = Tools::getValue('room_demands');
|
||||
if ($idHotel = $roomTypeInfo['id_hotel']) {
|
||||
$objBookingDetail = new HotelBookingDetail();
|
||||
if ($hotelRoomData = $objBookingDetail->DataForFrontSearch(
|
||||
|
||||
@@ -108,7 +108,7 @@ class StoresControllerCore extends FrontController
|
||||
|
||||
$addresses_formated[$store['id_store']] = AddressFormat::getFormattedLayoutData($address);
|
||||
|
||||
$store['has_picture'] = file_exists(_PS_STORE_IMG_DIR_.(int)$store['id_store'].'.jpg');
|
||||
$store['has_picture'] = Tools::file_get_contents($this->context->link->getMediaLink(_THEME_STORE_DIR_.(int)$store['id_store'].'.jpg')); // by webkul to get media link.
|
||||
if ($working_hours = $this->renderStoreWorkingHours($store)) {
|
||||
$store['working_hours'] = $working_hours;
|
||||
}
|
||||
@@ -208,7 +208,7 @@ class StoresControllerCore extends FrontController
|
||||
*/
|
||||
protected function assignStores()
|
||||
{
|
||||
$this->context->smarty->assign('hasStoreIcon', file_exists(_PS_IMG_DIR_.Configuration::get('PS_STORES_ICON')));
|
||||
$this->context->smarty->assign('hasStoreIcon', Tools::file_get_contents($this->context->link->getMediaLink(_PS_IMG_DIR_.Configuration::get('PS_STORES_ICON')))); // by webkul to get media link.
|
||||
|
||||
$distance_unit = Configuration::get('PS_DISTANCE_UNIT');
|
||||
if (!in_array($distance_unit, array('km', 'mi'))) {
|
||||
|
||||
BIN
img/rf/0.jpg
|
Before Width: | Height: | Size: 20 KiB |
BIN
img/rf/1.jpg
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 384 B |
BIN
img/rf/10.png
|
Before Width: | Height: | Size: 524 B |
BIN
img/rf/11.png
|
Before Width: | Height: | Size: 148 B |
BIN
img/rf/12.png
|
Before Width: | Height: | Size: 333 B |
BIN
img/rf/2.jpg
|
Before Width: | Height: | Size: 428 KiB After Width: | Height: | Size: 328 B |
BIN
img/rf/3.jpg
|
Before Width: | Height: | Size: 428 KiB After Width: | Height: | Size: 524 B |
BIN
img/rf/4.jpg
|
Before Width: | Height: | Size: 988 KiB After Width: | Height: | Size: 148 B |
BIN
img/rf/5.jpg
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 333 B |
|
Before Width: | Height: | Size: 322 B After Width: | Height: | Size: 322 B |
|
Before Width: | Height: | Size: 184 B After Width: | Height: | Size: 184 B |
BIN
img/rf/8.png
|
Before Width: | Height: | Size: 384 B |
BIN
img/rf/9.png
|
Before Width: | Height: | Size: 328 B |
@@ -186,6 +186,7 @@ CREATE TABLE `PREFIX_cart` (
|
||||
`gift_message` text,
|
||||
`mobile_theme` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`allow_seperated_package` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`is_advance_payment` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_cart`),
|
||||
@@ -1133,6 +1134,8 @@ CREATE TABLE `PREFIX_orders` (
|
||||
`delivery_date` datetime NOT NULL,
|
||||
`source` varchar(255) DEFAULT NULL,
|
||||
`valid` int(1) unsigned NOT NULL DEFAULT '0',
|
||||
`is_advance_payment` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`advance_paid_amount` decimal(20,6) NOT NULL DEFAULT '0.00',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_order`),
|
||||
@@ -1291,8 +1294,12 @@ CREATE TABLE `PREFIX_order_return` (
|
||||
`id_order_return` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_customer` int(10) unsigned NOT NULL,
|
||||
`id_order` int(10) unsigned NOT NULL,
|
||||
`state` tinyint(1) unsigned NOT NULL DEFAULT '1',
|
||||
`state` int(10) unsigned NOT NULL DEFAULT '1',
|
||||
`id_transaction` varchar(100) NOT NULL DEFAULT '',
|
||||
`payment_mode` varchar(255) NOT NULL DEFAULT '',
|
||||
`refunded_amount` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`question` text NOT NULL,
|
||||
`by_admin` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_order_return`),
|
||||
@@ -1301,16 +1308,27 @@ CREATE TABLE `PREFIX_order_return` (
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
|
||||
|
||||
CREATE TABLE `PREFIX_order_return_detail` (
|
||||
`id_order_return_detail` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_order_return` int(10) unsigned NOT NULL,
|
||||
`id_order_detail` int(10) unsigned NOT NULL,
|
||||
`id_htl_booking` int(11) NOT NULL,
|
||||
`refunded_amount` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`id_order_detail` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`id_customization` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`product_quantity` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id_order_return`,`id_order_detail`,`id_customization`)
|
||||
KEY `id_htl_booking` (`id_htl_booking`),
|
||||
PRIMARY KEY (`id_order_return_detail`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
|
||||
|
||||
CREATE TABLE `PREFIX_order_return_state` (
|
||||
`id_order_return_state` int(10) unsigned NOT NULL auto_increment,
|
||||
`color` varchar(32) DEFAULT NULL,
|
||||
`send_email_to_customer` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`send_email_to_superadmin` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`send_email_to_employee` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`send_email_to_hotelier` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`denied` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`refunded` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`module_name` VARCHAR(255) NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id_order_return_state`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
|
||||
|
||||
@@ -1318,10 +1336,11 @@ CREATE TABLE `PREFIX_order_return_state_lang` (
|
||||
`id_order_return_state` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`name` varchar(64) NOT NULL,
|
||||
`customer_template` varchar(64) NOT NULL,
|
||||
`admin_template` varchar(64) NOT NULL,
|
||||
PRIMARY KEY (`id_order_return_state`,`id_lang`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
|
||||
|
||||
|
||||
CREATE TABLE `PREFIX_order_slip` (
|
||||
`id_order_slip` int(10) unsigned NOT NULL auto_increment,
|
||||
`conversion_rate` decimal(13,6) NOT NULL DEFAULT 1,
|
||||
@@ -1346,6 +1365,7 @@ CREATE TABLE `PREFIX_order_slip` (
|
||||
CREATE TABLE `PREFIX_order_slip_detail` (
|
||||
`id_order_slip` int(10) unsigned NOT NULL,
|
||||
`id_order_detail` int(10) unsigned NOT NULL,
|
||||
`id_htl_booking` int(10) unsigned NOT NULL,
|
||||
`product_quantity` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`unit_price_tax_excl` DECIMAL(20, 6) NULL,
|
||||
`unit_price_tax_incl` DECIMAL(20, 6) NULL,
|
||||
@@ -1353,7 +1373,7 @@ CREATE TABLE `PREFIX_order_slip_detail` (
|
||||
`total_price_tax_incl` DECIMAL(20, 6),
|
||||
`amount_tax_excl` DECIMAL(20, 6) DEFAULT NULL,
|
||||
`amount_tax_incl` DECIMAL(20, 6) DEFAULT NULL,
|
||||
PRIMARY KEY (`id_order_slip`,`id_order_detail`)
|
||||
PRIMARY KEY (`id_order_slip`,`id_htl_booking`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
|
||||
|
||||
CREATE TABLE `PREFIX_order_state` (
|
||||
|
||||
BIN
install/data/img/os/Awaiting_remote_payment.gif
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<entity_carrier>
|
||||
<fields id="name" class="Carrier" sql="a.id_carrier = 1">
|
||||
<field name="id_reference"/>
|
||||
<field name="id_tax_rules_group"/>
|
||||
<field name="name"/>
|
||||
<field name="url"/>
|
||||
<field name="active"/>
|
||||
<field name="shipping_handling"/>
|
||||
<field name="range_behavior"/>
|
||||
<field name="is_free"/>
|
||||
<field name="shipping_external"/>
|
||||
<field name="need_range"/>
|
||||
<field name="shipping_method"/>
|
||||
<field name="max_width"/>
|
||||
<field name="max_height"/>
|
||||
<field name="max_depth"/>
|
||||
<field name="max_weight"/>
|
||||
<field name="grade"/>
|
||||
</fields>
|
||||
<entities>
|
||||
<carrier id="carrier_1" id_reference="1" id_tax_rules_group="0" active="1" shipping_handling="0" range_behavior="0" is_free="1" shipping_external="0" need_range="0" shipping_method="0" max_width="0" max_height="0" max_depth="0" max_weight="0" grade="0">
|
||||
<name>0</name>
|
||||
<url/>
|
||||
</carrier>
|
||||
</entities>
|
||||
</entity_carrier>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<entity_carrier_group>
|
||||
<fields primary="id_carrier, id_group" sql="a.id_carrier = 1">
|
||||
<field name="id_carrier" relation="carrier"/>
|
||||
<field name="id_group" relation="group"/>
|
||||
</fields>
|
||||
<entities>
|
||||
<carrier_group id="carrier_group_1_1" id_carrier="carrier_1" id_group="Visitor"/>
|
||||
<carrier_group id="carrier_group_1_2" id_carrier="carrier_1" id_group="Guest"/>
|
||||
<carrier_group id="carrier_group_1_3" id_carrier="carrier_1" id_group="Customer"/>
|
||||
</entities>
|
||||
</entity_carrier_group>
|
||||
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<entity_carrier_tax_rules_group_shop>
|
||||
<fields primary="id_carrier,id_tax_rules_group,id_shop">
|
||||
<field name="id_carrier" relation="carrier"/>
|
||||
<field name="id_tax_rules_group"/>
|
||||
<field name="id_shop"/>
|
||||
</fields>
|
||||
<entities>
|
||||
<carrier_tax_rules_group_shop id="carrier_tax_rules_group_shop_1_1_1" id_carrier="carrier_1" id_tax_rules_group="1" id_shop="1"/>
|
||||
</entities>
|
||||
</entity_carrier_tax_rules_group_shop>
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<entity_carrier_zone>
|
||||
<fields primary="id_carrier, id_zone" sql="a.id_carrier = 1">
|
||||
<field name="id_carrier" relation="carrier"/>
|
||||
<field name="id_zone" relation="zone"/>
|
||||
</fields>
|
||||
<entities>
|
||||
<carrier_zone id="carrier_zone_1_1" id_carrier="carrier_1" id_zone="Europe"/>
|
||||
</entities>
|
||||
</entity_carrier_zone>
|
||||
@@ -380,41 +380,35 @@
|
||||
<configuration id="PS_OS_PREPARATION" name="PS_OS_PREPARATION">
|
||||
<value>3</value>
|
||||
</configuration>
|
||||
<configuration id="PS_OS_SHIPPING" name="PS_OS_SHIPPING">
|
||||
<configuration id="PS_OS_CANCELED" name="PS_OS_CANCELED">
|
||||
<value>4</value>
|
||||
</configuration>
|
||||
<configuration id="PS_OS_DELIVERED" name="PS_OS_DELIVERED">
|
||||
<configuration id="PS_OS_REFUND" name="PS_OS_REFUND">
|
||||
<value>5</value>
|
||||
</configuration>
|
||||
<configuration id="PS_OS_CANCELED" name="PS_OS_CANCELED">
|
||||
<configuration id="PS_OS_ERROR" name="PS_OS_ERROR">
|
||||
<value>6</value>
|
||||
</configuration>
|
||||
<configuration id="PS_OS_REFUND" name="PS_OS_REFUND">
|
||||
<configuration id="PS_OS_OUTOFSTOCK" name="PS_OS_OUTOFSTOCK">
|
||||
<value>7</value>
|
||||
</configuration>
|
||||
<configuration id="PS_OS_ERROR" name="PS_OS_ERROR">
|
||||
<configuration id="PS_OS_BANKWIRE" name="PS_OS_BANKWIRE">
|
||||
<value>8</value>
|
||||
</configuration>
|
||||
<configuration id="PS_OS_OUTOFSTOCK" name="PS_OS_OUTOFSTOCK">
|
||||
<value>9</value>
|
||||
</configuration>
|
||||
<configuration id="PS_OS_BANKWIRE" name="PS_OS_BANKWIRE">
|
||||
<value>10</value>
|
||||
</configuration>
|
||||
<configuration id="PS_OS_PAYPAL" name="PS_OS_PAYPAL">
|
||||
<value>11</value>
|
||||
<value>9</value>
|
||||
</configuration>
|
||||
<configuration id="PS_OS_WS_PAYMENT" name="PS_OS_WS_PAYMENT">
|
||||
<value>12</value>
|
||||
<value>10</value>
|
||||
</configuration>
|
||||
<configuration id="PS_OS_OUTOFSTOCK_PAID" name="PS_OS_OUTOFSTOCK_PAID">
|
||||
<value>9</value>
|
||||
<value>7</value>
|
||||
</configuration>
|
||||
<configuration id="PS_OS_OUTOFSTOCK_UNPAID" name="PS_OS_OUTOFSTOCK_UNPAID">
|
||||
<value>13</value>
|
||||
<value>11</value>
|
||||
</configuration>
|
||||
<configuration id="PS_OS_COD_VALIDATION" name="PS_OS_COD_VALIDATION">
|
||||
<value>14</value>
|
||||
<configuration id="PS_OS_AWAITING_REMOTE_PAYMENT" name="PS_OS_AWAITING_REMOTE_PAYMENT">
|
||||
<value>12</value>
|
||||
</configuration>
|
||||
<configuration id="PS_LEGACY_IMAGES" name="PS_LEGACY_IMAGES">
|
||||
<value>0</value>
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<entity_delivery>
|
||||
<fields class="Delivery" sql="a.id_carrier = 1">
|
||||
<field name="id_shop"/>
|
||||
<field name="id_shop_group"/>
|
||||
<field name="id_carrier" relation="carrier"/>
|
||||
<field name="id_range_price" relation="range_price"/>
|
||||
<field name="id_range_weight" relation="range_weight"/>
|
||||
<field name="id_zone" relation="zone"/>
|
||||
<field name="price"/>
|
||||
</fields>
|
||||
<entities/>
|
||||
</entity_delivery>
|
||||
@@ -4,10 +4,9 @@
|
||||
<field name="color"/>
|
||||
</fields>
|
||||
<entities>
|
||||
<order_return_state id="Waiting_for_confirmation" color="#4169E1"/>
|
||||
<order_return_state id="Waiting_for_package" color="#8A2BE2"/>
|
||||
<order_return_state id="Package_received" color="#32CD32"/>
|
||||
<order_return_state id="Return_denied" color="#DC143C"/>
|
||||
<order_return_state id="Return_completed" color="#108510"/>
|
||||
<order_return_state id="Waiting_for_confirmation" color="#4169E1" send_email_to_customer="1" send_email_to_superadmin="1" send_email_to_employee="1" send_email_to_hotelier="1" denied="0" refunded="0"/>
|
||||
<order_return_state id="Request_received" color="#32CD32" send_email_to_customer="1" send_email_to_superadmin="1" send_email_to_employee="1" send_email_to_hotelier="1" denied="0" refunded="0"/>
|
||||
<order_return_state id="Refund_denied" color="#DC143C" send_email_to_customer="1" send_email_to_superadmin="1" send_email_to_employee="1" send_email_to_hotelier="1" denied="1" refunded="0"/>
|
||||
<order_return_state id="Refund_completed" color="#108510" send_email_to_customer="1" send_email_to_superadmin="1" send_email_to_employee="1" send_email_to_hotelier="1" denied="0" refunded="1"/>
|
||||
</entities>
|
||||
</entity_order_return_state>
|
||||
</entity_order_return_state>
|
||||
@@ -24,12 +24,6 @@
|
||||
<order_state id="Preparation_in_progress" invoice="1" send_email="1" color="#FF8C00" unremovable="1" hidden="0" logable="1" delivery="1" shipped="0" paid="1" pdf_delivery="0" pdf_invoice="0">
|
||||
<module_name/>
|
||||
</order_state>
|
||||
<order_state id="Shipped" invoice="1" send_email="1" color="#8A2BE2" unremovable="1" hidden="0" logable="1" delivery="1" shipped="1" paid="1" pdf_delivery="0" pdf_invoice="0">
|
||||
<module_name/>
|
||||
</order_state>
|
||||
<order_state id="Delivered" invoice="1" send_email="0" color="#108510" unremovable="1" hidden="0" logable="1" delivery="1" shipped="1" paid="1" pdf_delivery="0" pdf_invoice="0">
|
||||
<module_name/>
|
||||
</order_state>
|
||||
<order_state id="Canceled" invoice="0" send_email="1" color="#DC143C" unremovable="1" hidden="0" logable="0" delivery="0" shipped="0" paid="0" pdf_delivery="0" pdf_invoice="0">
|
||||
<module_name/>
|
||||
</order_state>
|
||||
@@ -54,8 +48,8 @@
|
||||
<order_state id="On_backorder_unpaid" invoice="0" send_email="1" color="#FF69B4" unremovable="1" hidden="0" logable="0" delivery="0" shipped="0" paid="0" pdf_delivery="0" pdf_invoice="0">
|
||||
<module_name/>
|
||||
</order_state>
|
||||
<order_state id="Awaiting_cod_validation" invoice="0" send_email="0" color="#4169E1" unremovable="1" hidden="0" logable="0" delivery="0" shipped="0" paid="0">
|
||||
<module_name>cashondelivery</module_name>
|
||||
<order_state id="Awaiting_remote_payment" invoice="0" send_email="0" color="#4169E1" unremovable="1" hidden="0" logable="0" delivery="0" shipped="0" paid="0" pdf_delivery="0" pdf_invoice="0">
|
||||
<module_name/>
|
||||
</order_state>
|
||||
</entities>
|
||||
</entity_order_state>
|
||||
|
||||
@@ -99,9 +99,9 @@
|
||||
<tab id="Invoices" id_parent="Orders" active="1" hide_host_mode="0">
|
||||
<class_name>AdminInvoices</class_name>
|
||||
</tab>
|
||||
<tab id="Merchandise_Returns" id_parent="Orders" active="1" hide_host_mode="0">
|
||||
<!-- <tab id="Merchandise_Returns" id_parent="Orders" active="1" hide_host_mode="0">
|
||||
<class_name>AdminReturn</class_name>
|
||||
</tab>
|
||||
</tab> -->
|
||||
<!-- <tab id="Delivery_Slips" id_parent="Orders" active="1" hide_host_mode="0">
|
||||
<class_name>AdminDeliverySlip</class_name>
|
||||
</tab> -->
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<field name="id_country" relation="country"/>
|
||||
<field name="id_state" relation="state"/>
|
||||
<field name="id_customer" relation="customer"/>
|
||||
<field name="id_manufacturer" relation="manufacturer"/>
|
||||
<field name="id_supplier" relation="supplier"/>
|
||||
<field name="id_manufacturer"/>
|
||||
<field name="id_supplier"/>
|
||||
<field name="id_warehouse"/>
|
||||
<field name="alias"/>
|
||||
<field name="company"/>
|
||||
@@ -30,20 +30,6 @@
|
||||
<city>Paris </city>
|
||||
<other/>
|
||||
</address>
|
||||
<address id="supplier" id_country="US" id_state="NY" id_customer="" id_manufacturer="" id_supplier="Fashion_Supplier" id_warehouse="0" alias="supplier" lastname="supplier" firstname="supplier" postcode="10153" phone="(212) 336-1440" phone_mobile="" vat_number="" dni="" active="1">
|
||||
<company>Fashion</company>
|
||||
<address1>767 Fifth Ave.</address1>
|
||||
<address2/>
|
||||
<city>New York</city>
|
||||
<other/>
|
||||
</address>
|
||||
<address id="supplier" id_country="US" id_state="NY" id_customer="" id_manufacturer="Fashion_Manufacturer" id_supplier="" id_warehouse="0" alias="manufacturer" lastname="manufacturer" firstname="manufacturer" postcode="10154" phone="(212) 336-1666" phone_mobile="" vat_number="" dni="" active="1">
|
||||
<company>Fashion</company>
|
||||
<address1>767 Fifth Ave.</address1>
|
||||
<address2/>
|
||||
<city>New York</city>
|
||||
<other/>
|
||||
</address>
|
||||
<address id="My_address" id_country="US" id_state="FL" id_customer="John" id_manufacturer="" id_supplier="" id_warehouse="0" alias="My address" lastname="DOE" firstname="John" postcode="33133" phone="0102030405" phone_mobile="" vat_number="" dni="" active="1">
|
||||
<company>My Company</company>
|
||||
<address1>16, Main street</address1>
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<entity_attribute>
|
||||
<fields id="name" class="Attribute">
|
||||
<field name="id_attribute_group" relation="attribute_group"/>
|
||||
<field name="color"/>
|
||||
</fields>
|
||||
<entities>
|
||||
<attribute id="S" id_attribute_group="Size" color=""/>
|
||||
<attribute id="M" id_attribute_group="Size" color=""/>
|
||||
<attribute id="L" id_attribute_group="Size" color=""/>
|
||||
<attribute id="One_size" id_attribute_group="Size" color=""/>
|
||||
<attribute id="Grey" id_attribute_group="Color" color="#AAB2BD"/>
|
||||
<attribute id="Taupe" id_attribute_group="Color" color="#CFC4A6"/>
|
||||
<attribute id="Beige" id_attribute_group="Color" color="#f5f5dc"/>
|
||||
<attribute id="White" id_attribute_group="Color" color="#ffffff"/>
|
||||
<attribute id="Off_White" id_attribute_group="Color" color="#faebd7"/>
|
||||
<attribute id="Red" id_attribute_group="Color" color="#E84C3D"/>
|
||||
<attribute id="Black" id_attribute_group="Color" color="#434A54"/>
|
||||
<attribute id="Camel" id_attribute_group="Color" color="#C19A6B"/>
|
||||
<attribute id="Orange" id_attribute_group="Color" color="#F39C11"/>
|
||||
<attribute id="Blue" id_attribute_group="Color" color="#5D9CEC"/>
|
||||
<attribute id="Green" id_attribute_group="Color" color="#A0D468"/>
|
||||
<attribute id="Yellow" id_attribute_group="Color" color="#F1C40F"/>
|
||||
<attribute id="Brown" id_attribute_group="Color" color="#964B00"/>
|
||||
<attribute id="35" id_attribute_group="Shoes_Size" color=""/>
|
||||
<attribute id="36" id_attribute_group="Shoes_Size" color=""/>
|
||||
<attribute id="37" id_attribute_group="Shoes_Size" color=""/>
|
||||
<attribute id="38" id_attribute_group="Shoes_Size" color=""/>
|
||||
<attribute id="39" id_attribute_group="Shoes_Size" color=""/>
|
||||
<attribute id="40" id_attribute_group="Shoes_Size" color=""/>
|
||||
<attribute id="Pink" id_attribute_group="Color" color="#FCCACD"/>
|
||||
</entities>
|
||||
</entity_attribute>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<entity_attribute_group>
|
||||
<fields id="name" class="AttributeGroup">
|
||||
<field name="is_color_group"/>
|
||||
<field name="group_type"/>
|
||||
</fields>
|
||||
<entities>
|
||||
<attribute_group id="Size" is_color_group="0" group_type="select"/>
|
||||
<attribute_group id="Shoes_Size" is_color_group="0" group_type="select"/>
|
||||
<attribute_group id="Color" is_color_group="1" group_type="color"/>
|
||||
</entities>
|
||||
</entity_attribute_group>
|
||||
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<entity_carrier>
|
||||
<fields id="name" class="Carrier" sql="a.id_carrier > 1">
|
||||
<field name="id_reference"/>
|
||||
<field name="name"/>
|
||||
<field name="url"/>
|
||||
<field name="active"/>
|
||||
<field name="shipping_handling"/>
|
||||
<field name="range_behavior"/>
|
||||
<field name="is_free"/>
|
||||
<field name="shipping_external"/>
|
||||
<field name="need_range"/>
|
||||
<field name="shipping_method"/>
|
||||
<field name="max_width"/>
|
||||
<field name="max_height"/>
|
||||
<field name="max_depth"/>
|
||||
<field name="max_weight"/>
|
||||
<field name="grade"/>
|
||||
</fields>
|
||||
<entities>
|
||||
<carrier id="My_carrier" id_reference="2" active="1" shipping_handling="1" range_behavior="0" is_free="0" shipping_external="0" need_range="0" shipping_method="0" max_width="0" max_height="0" max_depth="0" max_weight="0" grade="0">
|
||||
<name>My carrier</name>
|
||||
<url/>
|
||||
</carrier>
|
||||
</entities>
|
||||
</entity_carrier>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<entity_carrier_group>
|
||||
<fields primary="id_carrier, id_group" sql="a.id_carrier > 1">
|
||||
<field name="id_carrier" relation="carrier"/>
|
||||
<field name="id_group" relation="group"/>
|
||||
</fields>
|
||||
<entities>
|
||||
<carrier_group id="carrier_group_2_1" id_carrier="My_carrier" id_group="Visitor"/>
|
||||
<carrier_group id="carrier_group_2_2" id_carrier="My_carrier" id_group="Guest"/>
|
||||
<carrier_group id="carrier_group_2_3" id_carrier="My_carrier" id_group="Customer"/>
|
||||
</entities>
|
||||
</entity_carrier_group>
|
||||
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<entity_carrier_tax_rules_group_shop>
|
||||
<fields primary="id_carrier,id_tax_rules_group,id_shop">
|
||||
<field name="id_carrier" relation="carrier"/>
|
||||
<field name="id_tax_rules_group"/>
|
||||
<field name="id_shop"/>
|
||||
</fields>
|
||||
<entities>
|
||||
<carrier_tax_rules_group_shop id="carrier_tax_rules_group_shop_2_1_1" id_carrier="My_carrier" id_tax_rules_group="1" id_shop="1"/>
|
||||
</entities>
|
||||
</entity_carrier_tax_rules_group_shop>
|
||||
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<entity_carrier_zone>
|
||||
<fields primary="id_carrier, id_zone" sql="a.id_carrier > 1">
|
||||
<field name="id_carrier" relation="carrier"/>
|
||||
<field name="id_zone" relation="zone"/>
|
||||
</fields>
|
||||
<entities>
|
||||
<carrier_zone id="carrier_zone_2_1" id_carrier="My_carrier" id_zone="Europe"/>
|
||||
<carrier_zone id="carrier_zone_2_2" id_carrier="My_carrier" id_zone="North_America"/>
|
||||
</entities>
|
||||
</entity_carrier_zone>
|
||||
@@ -1,41 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<entity_cart>
|
||||
<fields class="Cart">
|
||||
<field name="id_carrier" relation="carrier"/>
|
||||
<field name="delivery_option"/>
|
||||
<field name="id_address_delivery" relation="address"/>
|
||||
<field name="id_address_invoice" relation="address"/>
|
||||
<field name="id_currency"/>
|
||||
<field name="id_customer" relation="customer"/>
|
||||
<field name="id_guest" relation="guest"/>
|
||||
<field name="secure_key"/>
|
||||
<field name="recyclable"/>
|
||||
<field name="gift"/>
|
||||
<field name="gift_message"/>
|
||||
<field name="allow_seperated_package"/>
|
||||
<field name="id_shop"/>
|
||||
<field name="id_shop_group"/>
|
||||
</fields>
|
||||
<entities>
|
||||
<cart id="cart_1" id_carrier="My_carrier" id_address_delivery="My_address" id_address_invoice="My_address" id_currency="1" id_customer="John" id_guest="guest_1" secure_key="b44a6d9efd7a0076a0fbce6b15eaf3b1" recyclable="0" gift="0" allow_seperated_package="0" id_shop="1" id_shop_group="1">
|
||||
<delivery_option>{"3":"2,"}</delivery_option>
|
||||
<gift_message/>
|
||||
</cart>
|
||||
<cart id="cart_2" id_carrier="My_carrier" id_address_delivery="My_address" id_address_invoice="My_address" id_currency="1" id_customer="John" id_guest="guest_1" secure_key="b44a6d9efd7a0076a0fbce6b15eaf3b1" recyclable="0" gift="0" allow_seperated_package="0" id_shop="1" id_shop_group="1">
|
||||
<delivery_option>{"3":"2,"}</delivery_option>
|
||||
<gift_message/>
|
||||
</cart>
|
||||
<cart id="cart_3" id_carrier="My_carrier" id_address_delivery="My_address" id_address_invoice="My_address" id_currency="1" id_customer="John" id_guest="guest_1" secure_key="b44a6d9efd7a0076a0fbce6b15eaf3b1" recyclable="0" gift="0" allow_seperated_package="0" id_shop="1" id_shop_group="1">
|
||||
<delivery_option>{"3":"2,"}</delivery_option>
|
||||
<gift_message/>
|
||||
</cart>
|
||||
<cart id="cart_4" id_carrier="My_carrier" id_address_delivery="My_address" id_address_invoice="My_address" id_currency="1" id_customer="John" id_guest="guest_1" secure_key="b44a6d9efd7a0076a0fbce6b15eaf3b1" recyclable="0" gift="0" allow_seperated_package="0" id_shop="1" id_shop_group="1">
|
||||
<delivery_option>{"3":"2,"}</delivery_option>
|
||||
<gift_message/>
|
||||
</cart>
|
||||
<cart id="cart_5" id_carrier="My_carrier" id_address_delivery="My_address" id_address_invoice="My_address" id_currency="1" id_customer="John" id_guest="guest_1" secure_key="b44a6d9efd7a0076a0fbce6b15eaf3b1" recyclable="0" gift="0" allow_seperated_package="0" id_shop="1" id_shop_group="1">
|
||||
<delivery_option>{"3":"2,"}</delivery_option>
|
||||
<gift_message/>
|
||||
</cart>
|
||||
</entities>
|
||||
</entity_cart>
|
||||
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<entity_cart_product>
|
||||
<fields primary="id_cart, id_product, id_product_attribute">
|
||||
<field name="id_cart" relation="cart"/>
|
||||
<field name="id_product" relation="product"/>
|
||||
<field name="id_address_delivery"/>
|
||||
<field name="id_product_attribute" relation="product_attribute"/>
|
||||
<field name="quantity"/>
|
||||
</fields>
|
||||
<entities>
|
||||
<cart_product id="cart_product_1_2_10" id_cart="cart_1" id_product="Blouse" id_address_delivery="3" id_product_attribute="product_attribute_10" quantity="1"/>
|
||||
<cart_product id="cart_product_1_3_13" id_cart="cart_1" id_product="Printed_Dress" id_address_delivery="3" id_product_attribute="product_attribute_13" quantity="1"/>
|
||||
<cart_product id="cart_product_2_2_10" id_cart="cart_2" id_product="Blouse" id_address_delivery="3" id_product_attribute="product_attribute_10" quantity="1"/>
|
||||
<cart_product id="cart_product_2_6_32" id_cart="cart_2" id_product="Printed_Summer_Dress_1" id_address_delivery="3" id_product_attribute="product_attribute_32" quantity="1"/>
|
||||
<cart_product id="cart_product_2_7_34" id_cart="cart_2" id_product="Printed_Chiffon_Dress" id_address_delivery="3" id_product_attribute="product_attribute_34" quantity="1"/>
|
||||
<cart_product id="cart_product_3_2_10" id_cart="cart_3" id_product="Blouse" id_address_delivery="3" id_product_attribute="product_attribute_10" quantity="1"/>
|
||||
<cart_product id="cart_product_3_6_32" id_cart="cart_3" id_product="Printed_Summer_Dress_1" id_address_delivery="3" id_product_attribute="product_attribute_32" quantity="1"/>
|
||||
<cart_product id="cart_product_3_1_1" id_cart="cart_3" id_product="Faded_Short_Sleeve_T-shirts" id_address_delivery="3" id_product_attribute="product_attribute_1" quantity="1"/>
|
||||
<cart_product id="cart_product_4_1_1" id_cart="cart_4" id_product="Faded_Short_Sleeve_T-shirts" id_address_delivery="3" id_product_attribute="product_attribute_1" quantity="1"/>
|
||||
<cart_product id="cart_product_4_3_13" id_cart="cart_4" id_product="Printed_Dress" id_address_delivery="3" id_product_attribute="product_attribute_13" quantity="1"/>
|
||||
<cart_product id="cart_product_4_7_34" id_cart="cart_4" id_product="Printed_Chiffon_Dress" id_address_delivery="3" id_product_attribute="product_attribute_34" quantity="1"/>
|
||||
<cart_product id="cart_product_4_5_19" id_cart="cart_4" id_product="Printed_Summer_Dress" id_address_delivery="3" id_product_attribute="product_attribute_19" quantity="1"/>
|
||||
<cart_product id="cart_product_5_1_1" id_cart="cart_5" id_product="Faded_Short_Sleeve_T-shirts" id_address_delivery="3" id_product_attribute="product_attribute_1" quantity="1"/>
|
||||
<cart_product id="cart_product_5_2_7" id_cart="cart_5" id_product="Blouse" id_address_delivery="3" id_product_attribute="product_attribute_7" quantity="1"/>
|
||||
<cart_product id="cart_product_5_3_13" id_cart="cart_5" id_product="Printed_Dress" id_address_delivery="3" id_product_attribute="product_attribute_13" quantity="1"/>
|
||||
</entities>
|
||||
</entity_cart_product>
|
||||
@@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<entity_category>
|
||||
<fields id="name" class="Category" sql="a.id_category > 2" image="c">
|
||||
<field name="id_parent" relation="category"/>
|
||||
<field name="active"/>
|
||||
</fields>
|
||||
<entities>
|
||||
<category id="Women" id_parent="Home" active="1"/>
|
||||
<category id="Tops" id_parent="Women" active="1"/>
|
||||
<category id="T-shirts" id_parent="Tops" active="1"/>
|
||||
<category id="Tops_1" id_parent="Tops" active="0"/>
|
||||
<category id="Blouses" id_parent="Tops" active="1"/>
|
||||
<category id="Dresses" id_parent="Women" active="1"/>
|
||||
<category id="Casual_Dresses" id_parent="Dresses" active="1"/>
|
||||
<category id="Evening_Dresses" id_parent="Dresses" active="1"/>
|
||||
<category id="Summer_Dresses" id_parent="Dresses" active="1"/>
|
||||
</entities>
|
||||
</entity_category>
|
||||