Added feature for adding standard product in cart
This commit is contained in:
@@ -79,8 +79,9 @@
|
||||
var product_type_virtual = {Product::PTYPE_VIRTUAL|intval};
|
||||
var product_type_simple = {Product::PTYPE_SIMPLE|intval};
|
||||
|
||||
var with_room_type = {Product::SERVICE_PRODUCT_WITH_ROOMTYPE|intval};
|
||||
var without_room_type = {Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE|intval};
|
||||
var SERVICE_PRODUCT_WITH_ROOMTYPE = {Product::SERVICE_PRODUCT_WITH_ROOMTYPE|intval};
|
||||
var SERVICE_PRODUCT_STANDALONE = {Product::SERVICE_PRODUCT_STANDALONE|intval};
|
||||
var SERVICE_PRODUCT_lINKED_WITH_HOTEL = {Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL|intval};
|
||||
|
||||
var price_addition_type_with_room = {Product::PRICE_ADDITION_TYPE_WITH_ROOM|intval};
|
||||
var price_addition_type_independent = {Product::PRICE_ADDITION_TYPE_INDEPENDENT|intval};
|
||||
|
||||
@@ -232,20 +232,47 @@
|
||||
var product_name_redirected = '{$product_name_redirected|escape:'html':'UTF-8'}';
|
||||
</script>
|
||||
</div>
|
||||
<div class="form-group" id="associated_hotel_rooms_tree" {if $product->service_product_type == Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE}style="display:none;"{/if}>
|
||||
<div class="form-group" id="global_product_type_container">
|
||||
<label class="control-label col-lg-3" for="service_product_type">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select whether this product will be sold with room type or as an standalone product'}">
|
||||
{l s='Product selling preference'}
|
||||
<span>
|
||||
</label>
|
||||
<div class="col-lg-4">
|
||||
<select name="service_product_type" id="service_product_type">
|
||||
<option value="{Product::SERVICE_PRODUCT_WITH_ROOMTYPE}" {if $product->service_product_type == Product::SERVICE_PRODUCT_WITH_ROOMTYPE}selected="selected"{/if} >{l s='sell with room type'}</option>
|
||||
<option value="{Product::SERVICE_PRODUCT_STANDALONE}" {if $product->service_product_type == Product::SERVICE_PRODUCT_STANDALONE}selected="selected"{/if} >{l s='Sell as standalone product'}</option>
|
||||
<option value="{Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL}" {if $product->service_product_type == Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL}selected="selected"{/if} >{l s='Sell as independert product linked with hotel'}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="associated_hotel_rooms_tree" {if $product->service_product_type != Product::SERVICE_PRODUCT_WITH_ROOMTYPE && $product->service_product_type != 0}style="display:none;"{/if}>
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="category_box" type="category_box"}</span></div>
|
||||
<label class="control-label col-lg-2" for="hotel_block">
|
||||
<label class="control-label col-lg-2" for="hotel_room_block">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select room type and hotels for which this service will be available.'}">
|
||||
{l s='Associated Hotels and Room Types'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<div id="hotel_room_block">
|
||||
{$hotel_room_tree}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="associated_hotel_tree" {if $product->service_product_type != Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL}style="display:none;"{/if}>
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="category_box" type="category_box"}</span></div>
|
||||
<label class="control-label col-lg-2" for="hotel_block">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select hotels for which this service will be available.'}">
|
||||
{l s='Associated Hotels'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<div id="hotel_block">
|
||||
{$hotel_tree}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="auto_add_to_cart_container">
|
||||
<div class="form-group" id="auto_add_to_cart_container" {if $product->service_product_type != Product::SERVICE_PRODUCT_WITH_ROOMTYPE && $product->service_product_type != 0}style="display:none;"{/if}>
|
||||
<label class="control-label col-lg-3" for="">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='When enabled, this service will be added in cart for each associated Room type or Hotel when they are added in cart. Also auto added services will not be visible to customers.'}">
|
||||
{l s='Auto add to cart this product'}
|
||||
@@ -294,27 +321,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* <div class="form-group" id="global_product_type_container">
|
||||
<label class="control-label col-lg-3" for="service_product_type">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select whether this product will be sold with room type or as an independent product'}">
|
||||
{l s='Product selling preference'}
|
||||
<span>
|
||||
</label>
|
||||
<div class="col-lg-4">
|
||||
<select name="service_product_type" id="service_product_type">
|
||||
<option value="{Product::SERVICE_PRODUCT_WITH_ROOMTYPE}" {if $product->service_product_type == Product::SERVICE_PRODUCT_WITH_ROOMTYPE}selected="selected"{/if} >{l s='sell with room type'}</option>
|
||||
<option value="{Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE}" {if $product->service_product_type == Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE}selected="selected"{/if} >{l s='Sell as independent product'}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> *}
|
||||
{* <div class="form-group" id="independent_product_info" {if $product->service_product_type != Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE}style="display:none"{/if}>
|
||||
<div class="col-lg-6 col-lg-offset-3">
|
||||
<div class="alert alert-info">
|
||||
{l s='Independent products can only be bought from backoffice.'}
|
||||
</div>
|
||||
</div>
|
||||
</div> *}
|
||||
<div class="form-group" id="show_at_front_container" {if $product->auto_add_to_cart}style="display:none;"{/if}>
|
||||
<label class="control-label col-lg-3" for="">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Enable if you want this product to be visible at front office of your website.'}">
|
||||
|
||||
@@ -0,0 +1,301 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
{if isset($product->id)}
|
||||
<div id="product-quantities" class="panel product-tab">
|
||||
<input type="hidden" name="submitted_tabs[]" value="Quantities" />
|
||||
<h3>{l s='Available quantities for sale'}</h3>
|
||||
{if !$ps_stock_management}
|
||||
<div class="alert alert-info">{l s='The stock management is disabled'}</div>
|
||||
{else}
|
||||
{include file="controllers/products/multishop/check_fields.tpl" product_tab="Quantities"}
|
||||
{* <div class="alert alert-info">
|
||||
{l s='This interface allows you to manage available quantities for sale for products. It also allows you to manage product combinations in the current shop.'}<br/>
|
||||
{l s='You can choose whether or not to use the advanced stock management system for this product.'}<br/>
|
||||
{l s='You can manually specify the quantities for the product/each product combination, or you can choose to automatically determine these quantities based on your stock (if advanced stock management is activated).'}<br/>
|
||||
{l s='In this case, quantities correspond to the real-stock quantities in the warehouses connected with the current shop, or current group of shops.'}<br/>
|
||||
{l s='For packs: If it has products that use advanced stock management, you have to specify a common warehouse for these products in the pack.'}<br/>
|
||||
{l s='Also, please note that when a product has combinations, its default combination will be used in stock movements.'}
|
||||
</div> *}
|
||||
|
||||
{if $show_quantities == true}
|
||||
<div class="form-group" {if $product->is_virtual}style="display:none;"{/if} class="row stockForVirtualProduct">
|
||||
<div class="col-lg-9 col-lg-offset-3">
|
||||
<p class="checkbox">
|
||||
<label for="advanced_stock_management">
|
||||
<input type="checkbox" id="advanced_stock_management" name="advanced_stock_management" class="advanced_stock_management"
|
||||
{if $product->advanced_stock_management == 1 && $stock_management_active == 1}
|
||||
value="1" checked="checked"
|
||||
{else}
|
||||
value="0"
|
||||
{/if}
|
||||
{if $stock_management_active == 0}
|
||||
disabled="disabled"
|
||||
{/if}
|
||||
/>
|
||||
{l s='I want to use the advanced stock management system for this product.'}
|
||||
</label>
|
||||
</p>
|
||||
{if $stock_management_active == 0 && !$product->cache_is_pack}
|
||||
<p class="help-block"><i class="icon-warning-sign"></i> {l s='This requires you to enable advanced stock management.'}</p>
|
||||
{elseif $product->cache_is_pack}
|
||||
<p class="help-block">{l s='When enabling advanced stock management for a pack, please make sure it is also enabled for its product(s) – if you choose to decrement product quantities.'}</p>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div {if $product->is_virtual}style="display:none;"{/if} class="form-group stockForVirtualProduct">
|
||||
<label class="control-label col-lg-3" for="depends_on_stock_1">{l s='Available quantities'}</label>
|
||||
<div class="col-lg-9">
|
||||
<p class="radio">
|
||||
<label for="depends_on_stock_1">
|
||||
<input type="radio" id="depends_on_stock_1" name="depends_on_stock" class="depends_on_stock" value="1"
|
||||
{if $product->depends_on_stock == 1 && $stock_management_active == 1}
|
||||
checked="checked"
|
||||
{/if}
|
||||
{if $stock_management_active == 0 || $product->advanced_stock_management == 0}
|
||||
disabled="disabled"
|
||||
{/if}
|
||||
/>
|
||||
{l s='The available quantities for the current product and its combinations are based on the stock in your warehouse (using the advanced stock management system). '}
|
||||
{if ($stock_management_active == 0 || $product->advanced_stock_management == 0) && !$product->cache_is_pack} - {l s='This requires you to enable advanced stock management globally or for this product.'}
|
||||
{/if}
|
||||
</label>
|
||||
</p>
|
||||
{if $product->cache_is_pack}
|
||||
<p class="help-block">
|
||||
{l s='You cannot use advanced stock management for this pack if'}<br />
|
||||
{l s='- advanced stock management is not enabled for these products'}<br />
|
||||
{l s='- you have chosen to decrement products quantities.'}
|
||||
</p>
|
||||
{/if}
|
||||
<p class="radio">
|
||||
<label for="depends_on_stock_0" for="depends_on_stock_0">
|
||||
<input type="radio" id="depends_on_stock_0" name="depends_on_stock" class="depends_on_stock" value="0"
|
||||
{if $product->depends_on_stock == 0 || $stock_management_active == 0}
|
||||
checked="checked"
|
||||
{/if}
|
||||
/>
|
||||
{l s='I want to specify available quantities manually.'}
|
||||
</label>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" {if !$product->cache_is_pack}style="display:none"{/if}>
|
||||
<label class="control-label col-lg-3">{l s='Pack quantities'}</label>
|
||||
<div class="col-lg-9">
|
||||
<p class="radio">
|
||||
<label id="label_pack_stock_1" for="pack_stock_type_1">
|
||||
<input type="radio" class="pack_stock_type" value="0" name="pack_stock_type" id="pack_stock_type_1" {if isset($product->pack_stock_type) && $product->pack_stock_type == 0} checked="checked" {/if}/>
|
||||
{l s='Decrement pack only.'}
|
||||
</label>
|
||||
</p>
|
||||
<p class="radio">
|
||||
<label id="label_pack_stock_2" for="pack_stock_type_2">
|
||||
<input type="radio" class="pack_stock_type" value="1" name="pack_stock_type" id="pack_stock_type_2" {if isset($product->pack_stock_type) && $product->pack_stock_type == 1} checked="checked" {/if}/>
|
||||
{l s='Decrement products in pack only.'}
|
||||
</label>
|
||||
</p>
|
||||
<p class="radio">
|
||||
<label id="label_pack_stock_3" for="pack_stock_type_3">
|
||||
<input type="radio" class="pack_stock_type" value="2" name="pack_stock_type" id="pack_stock_type_3" {if isset($product->pack_stock_type) && $product->pack_stock_type == 2} checked="checked" {/if}/>
|
||||
{l s='Decrement both.'}
|
||||
</label>
|
||||
</p>
|
||||
<p class="radio">
|
||||
<label id="label_pack_stock_4" for="pack_stock_type_4">
|
||||
<input type="radio" class="pack_stock_type" value="3" name="pack_stock_type" id="pack_stock_type_4" {if !isset($product->pack_stock_type) || $product->pack_stock_type == 3} checked="checked" {/if}/>
|
||||
{l s='Default'}:
|
||||
{if $pack_stock_type == 0}
|
||||
{l s='Decrement pack only.'}
|
||||
{elseif $pack_stock_type == 1}
|
||||
{l s='Decrement products in pack only.'}
|
||||
{else}
|
||||
{l s='Decrement both.'}
|
||||
{/if}
|
||||
<a class="confirm_leave" href="index.php?tab=AdminPPreferences&token={$token_preferences}">
|
||||
{l s='as set in the Products Preferences page'}
|
||||
</a>
|
||||
</label>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{if isset($pack_quantity)}
|
||||
<div class="alert alert-info">
|
||||
<p>{l s='When a product has combinations, quantities will be based on the default combination.'}</p>
|
||||
<p>{l s='Given the quantities of the products in this pack, the maximum quantity should be:'} {$pack_quantity}</p>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-9 col-lg-offset-3">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><span class="title_box">{l s='Quantity'}</span></th>
|
||||
<th><span class="title_box">{l s='Designation'}</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
{foreach from=$attributes item=attribute}
|
||||
<tr{if isset($attribute['default_on']) && $attribute['default_on']} class="highlighted"{/if}>
|
||||
<td class="available_quantity" id="qty_{$attribute['id_product_attribute']}">
|
||||
<span>{$available_quantity[$attribute['id_product_attribute']]}</span>
|
||||
<input type="text" name="qty_{$attribute['id_product_attribute']}" class="fixed-width-sm" value="{$available_quantity[$attribute['id_product_attribute']]|htmlentities}"/>
|
||||
</td>
|
||||
<td>{$product_designation[$attribute['id_product_attribute']]}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div id="when_out_of_stock" class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='When out of stock'}</label>
|
||||
<div class="col-lg-9">
|
||||
<p class="radio">
|
||||
<label id="label_out_of_stock_1" for="out_of_stock_1">
|
||||
<input type="radio" id="out_of_stock_1" name="out_of_stock" checked="checked" value="0" class="out_of_stock" {if $product->out_of_stock == 0} checked="checked" {/if}>
|
||||
{l s='Deny orders'}
|
||||
</label>
|
||||
</p>
|
||||
<p class="radio">
|
||||
<label id="label_out_of_stock_2" for="out_of_stock_2">
|
||||
<input type="radio" id="out_of_stock_2" name="out_of_stock" value="1" class="out_of_stock" {if $product->out_of_stock == 1} checked="checked" {/if}>
|
||||
{l s='Allow orders'}
|
||||
</label>
|
||||
</p>
|
||||
<p class="radio">
|
||||
<label id="label_out_of_stock_3" for="out_of_stock_3">
|
||||
<input type="radio" id="out_of_stock_3" name="out_of_stock" value="2" class="out_of_stock" {if $product->out_of_stock == 2} checked="checked" {/if}>
|
||||
{l s='Default'}:
|
||||
{if $order_out_of_stock == 1}
|
||||
{l s='Allow orders'}
|
||||
{else}
|
||||
{l s='Deny orders'}
|
||||
{/if}
|
||||
<a class="confirm_leave" href="index.php?tab=AdminPPreferences&token={$token_preferences}">
|
||||
{l s='as set in the Products Preferences page'}
|
||||
</a>
|
||||
</label>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{else}
|
||||
<div class="alert alert-warning">
|
||||
<p>{l s='It is not possible to manage quantities when:'}</p>
|
||||
<ul>
|
||||
<li>{l s='You are currently managing all of your shops.'}</li>
|
||||
<li>{l s='You are currently managing a group of shops where quantities are not shared between every shop in this group.'}</li>
|
||||
<li>{l s='You are currently managing a shop that is in a group where quantities are shared between every shop in this group.'}</li>
|
||||
</ul>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
<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" disabled="disabled"><i class="process-icon-loading"></i></i> {l s='Save'}</button>
|
||||
<button type="submit" name="submitAddproductAndStay" class="btn btn-default pull-right" disabled="disabled"><i class="process-icon-loading"></i> {l s='Save and stay'}</button>
|
||||
</div>
|
||||
</div>
|
||||
{* <div class="panel">
|
||||
<h3>{l s='Availability settings'}</h3>
|
||||
|
||||
{if !$has_attribute}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="minimal_quantity" type="default"}</span></div>
|
||||
<label class="control-label col-lg-2" for="minimal_quantity">
|
||||
{l s='Minimum quantity'}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<input type="text" id="minimal_quantity" name="minimal_quantity" class="form-control fixed-width-sm" maxlength="6" value="{$product->minimal_quantity|default:1}" />
|
||||
<p class="help-block">{l s='The minimum quantity to buy this product (set to 1 to disable this feature)'}</p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if $ps_stock_management}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="available_now" type="default" multilang="true"}</span></div>
|
||||
<label class="control-label col-lg-2" for="available_now_{$default_language}">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Forbidden characters:'} <>;=#{}">
|
||||
{l s='Displayed text when in-stock'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
{include file="controllers/products/input_text_lang.tpl"
|
||||
languages=$languages
|
||||
input_value=$product->available_now
|
||||
input_name='available_now'}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="available_later" type="default" multilang="true"}</span></div>
|
||||
<label class="control-label col-lg-2" for="available_later_{$default_language}">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='If empty, the message "in stock" will be displayed.'} {l s='Forbidden characters:'} <>;=#{}">
|
||||
{l s='Displayed text when backordering is allowed'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
{include file="controllers/products/input_text_lang.tpl"
|
||||
languages=$languages
|
||||
input_value=$product->available_later
|
||||
input_name='available_later'}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{if !$countAttributes}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="available_date" type="default"}</span></div>
|
||||
<label class="control-label col-lg-2" for="available_date">
|
||||
{l s='Availability date:'}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="input-group fixed-width-md">
|
||||
<input id="available_date" name="available_date" value="{$product->available_date}" class="datepicker" type="text" />
|
||||
<div class="input-group-addon">
|
||||
<i class="icon-calendar-empty"></i>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<p class="help-block">{l s='The next date of availability for this product when it is out of stock.'}</p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
<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" disabled="disabled"><i class="process-icon-loading"></i> {l s='Save'}</button>
|
||||
<button type="submit" name="submitAddproductAndStay" class="btn btn-default pull-right" disabled="disabled"><i class="process-icon-loading"></i> {l s='Save and stay'}</button>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var quantities_ajax_success = '{l s='Data saved' js=1}';
|
||||
var quantities_ajax_waiting = '{l s='Saving data...' js=1}';
|
||||
</script>
|
||||
</div> *}
|
||||
<script type="text/javascript">
|
||||
if (tabs_manager.allow_hide_other_languages)
|
||||
hideOtherLanguage({$default_form_language});
|
||||
</script>
|
||||
{/if}
|
||||
@@ -154,7 +154,7 @@
|
||||
{/foreach}
|
||||
</tbody>
|
||||
{/if}
|
||||
{if isset($cart_normal_data) && $cart_normal_data}
|
||||
{if isset($cart_hotel_product_data) && $cart_hotel_product_data}
|
||||
<thead>
|
||||
<tr>
|
||||
<th><span class="title_box">{l s='Image'}</th>
|
||||
@@ -167,13 +167,20 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $cart_normal_data as $product}
|
||||
<tr>
|
||||
{foreach $cart_hotel_product_data as $product}
|
||||
<tr data-id-product="{$product.id_product}" data-id_hotel_service_product_cart_detail="{$product.id_hotel_service_product_cart_detail}" >
|
||||
<td><img src="{$product['cover_img']|escape:'html':'UTF-8'}" class="img-responsive" /></td>
|
||||
<td><p>{$product['name']|escape:'html':'UTF-8'}</p></td>
|
||||
<td><p>{$product['name']|escape:'html':'UTF-8'}{if $product.option_name} : {$product.option_name|escape:'html':'UTF-8'}{/if}</p></td>
|
||||
<td colspan="2">{$product['hotel_name']}</td>
|
||||
<td colspan="2">{displayPrice price=$product['unit_price_tax_incl']}</td>
|
||||
<td>{$product['quantity']|escape:'htmlall':'UTF-8'}</td>
|
||||
<td colspan="2">{displayPrice price=$product['unit_price_tax_excl']}</td>
|
||||
<td>
|
||||
{if $product.allow_multiple_quantity}
|
||||
<input type="number" value="{$product['quantity']}" class="product_quantity form-control" min="1" {if $product.max_quantity > 0}max="{$product.max_quantity}"{/if}>
|
||||
<input type="hidden" value="{$product['quantity']}" class="product_quantity_hidden form-control">
|
||||
{else}
|
||||
--
|
||||
{/if}
|
||||
</td>
|
||||
<td>{displayPrice price=$product['total_price_tax_incl']}</td>
|
||||
<td>
|
||||
<button class="delete_service_product btn btn-danger" data-id-hotel="{$product['id_hotel']|escape:'htmlall':'UTF-8'}" data-id_product={$product['id_product']|escape:'html':'UTF-8'} data-id_cart = {$cart->id|escape:'html':'UTF-8'}>
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
{*
|
||||
* Since 2010 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<table class="table" id="customer_products_details" {if !$hotel_service_products}style="display:none"{/if}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><span class="title_box">{l s='Image'}</th>
|
||||
<th class="text-center"><span class="title_box">{l s='Name'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Quantity'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Price (Tax excl.)'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Total Tax'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Total Price (Tax incl.)'}</span></th>
|
||||
{if isset($refundReqProducts) && $refundReqProducts}
|
||||
<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}
|
||||
{if ($can_edit && !$order->hasBeenDelivered())}
|
||||
<th class="text-right"><span class="title_box">{l s='Edit Order'}</th>
|
||||
{/if}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if $hotel_service_products}
|
||||
{foreach from=$hotel_service_products item=product}
|
||||
{* Include product line partial *}
|
||||
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
|
||||
{assign var=product_price value=($product['unit_price_tax_excl'])}
|
||||
{else}
|
||||
{assign var=product_price value=$product['unit_price_tax_incl']}
|
||||
{/if}
|
||||
<tr class="product-line-row" data-id_product="{$product.id_product}" data-id_order_detail="{$product.id_order_detail}" data-id_room_type_service_product_order_detail="{$product.id_room_type_service_product_order_detail}" data-id_hotel="{$product.id_hotel}">
|
||||
<td class="text-center">
|
||||
{if isset($product.image) && $product.image->id}{$product.image_tag}{/if}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a href="{hook h='displayOrderDetailProductLink' id_product=$product.id_product}">
|
||||
<span class="productName">{$product['name']}{if isset($product['option_name']) && $product['option_name']} : {$product['option_name']}{/if}</span><br />
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span class="">{(int)$product['quantity']}</span>
|
||||
</td>
|
||||
<td class="text-center unit_price_tax_excl">
|
||||
<p>{displayPrice price=$product.total_price_tax_excl currency=$currency->id}</p>
|
||||
<p class="help-block">{l s='Unit price'} : {displayPrice price=$product.unit_price_tax_excl currency=$currency->id}</p>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span>{displayPrice price=($product.total_price_tax_incl - $product.total_price_tax_excl) currency=$currency->id}</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span>{displayPrice price=$product.total_price_tax_incl currency=$currency->id}</span>
|
||||
</td>
|
||||
{if (isset($refundReqProducts) && $refundReqProducts)}
|
||||
<td class="text-center">
|
||||
{if $product.id_room_type_service_product_order_detail|in_array:$refundReqProducts}
|
||||
{if $product.is_cancelled}
|
||||
<span class="badge badge-danger">{l s='Cancelled'}</span>
|
||||
{elseif isset($product.refund_info) && (!$product.refund_info.refunded || $product.refund_info.id_customization)}
|
||||
<span class="badge" style="background-color:{$product.refund_info.color|escape:'html':'UTF-8'}">{$product.refund_info.name|escape:'html':'UTF-8'}</span>
|
||||
{else}
|
||||
<span>--</span>
|
||||
{/if}
|
||||
{else}
|
||||
<span>--</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{if $product.is_refunded && isset($product.refund_info) && $product.refund_info}
|
||||
{convertPriceWithCurrency price=$product.refund_info.refunded_amount currency=$currency->id}
|
||||
{else}
|
||||
--
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
{if ($can_edit && !$order->hasBeenDelivered())}
|
||||
<td class="room_invoice" style="display: none;">
|
||||
{if sizeof($invoices_collection)}
|
||||
<select name="product_invoice" class="edit_product_invoice">
|
||||
{foreach from=$invoices_collection item=invoice}
|
||||
<option value="{$invoice->id}" {*{if $invoice->id == $product['id_order_invoice']}selected="selected"{/if}*}>
|
||||
#{Configuration::get('PS_INVOICE_PREFIX', $current_id_lang, null, $order->id_shop)}{'%06d'|sprintf:$invoice->number}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
{else}
|
||||
|
||||
{/if}
|
||||
</td>
|
||||
<td class="product_action text-right">
|
||||
{* edit/delete controls *}
|
||||
<div class="btn-group">
|
||||
{* <button type="button" class="btn btn-default delete_product_line">
|
||||
<i class="icon-trash"></i>
|
||||
{l s='Delete'}
|
||||
</button> *}
|
||||
<button type="button" class="btn btn-default edit_product_change_link" data-product_line_data="{$product|json_encode|escape}">
|
||||
<i class="icon-pencil"></i>
|
||||
{l s='Edit'}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="#" class="delete_product_line">
|
||||
<i class="icon-trash"></i>
|
||||
{l s='Delete'}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{* Update controls *}
|
||||
{* <button type="button" class="btn btn-default submitProductChange" style="display: none;">
|
||||
<i class="icon-ok"></i>
|
||||
{l s='Update'}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default cancel_product_change_link" style="display: none;">
|
||||
<i class="icon-remove"></i>
|
||||
{l s='Cancel'}
|
||||
</button> *}
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td>{l s='No Data Found.'}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{* Include product line partial *}
|
||||
{* {include file='controllers/orders/_new_service_product.tpl'} *}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,139 +0,0 @@
|
||||
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
|
||||
{assign var=product_price value=($product['unit_price_tax_excl'] + $product['ecotax'])}
|
||||
{else}
|
||||
{assign var=product_price value=$product['unit_price_tax_incl']}
|
||||
{/if}
|
||||
<tr class="product-line-row" data-id_product="{$product.id_product}" data-id_order_detail="{$product.id_order_detail}">
|
||||
{if $refund_allowed}
|
||||
<td class="standard_refund_fields" style="display:none">
|
||||
<input type="checkbox" name="id_htl_booking[]" value="{$product.id|escape:'html':'UTF-8'}" {if isset($refundReqBookings) && ($product.id|in_array:$refundReqBookings)}disabled{/if}/>
|
||||
</td>
|
||||
{/if}
|
||||
{* <td class="text-center">
|
||||
{$data.room_num}
|
||||
</td> *}
|
||||
<td class="text-center">
|
||||
{if isset($product.image) && $product.image->id}{$product.image_tag}{/if}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&id_product={$product['product_id']|intval}&updateproduct&token={getAdminToken tab='AdminProducts'}">
|
||||
<span class="productName">{$product['product_name']}</span><br />
|
||||
{if $product.product_reference}{l s='Reference number:'} {$product.product_reference}<br />{/if}
|
||||
{if $product.product_supplier_reference}{l s='Supplier reference:'} {$product.product_supplier_reference}{/if}
|
||||
</a>
|
||||
{* <div class="row-editing-warning" style="display:none;">
|
||||
<div class="alert alert-warning">
|
||||
<strong>{l s='Editing this product line will remove the reduction and base price.'}</strong>
|
||||
</div>
|
||||
</div> *}
|
||||
</td>
|
||||
<td class="text-center unit_price_tax_excl">
|
||||
<span>{displayPrice price=$product.unit_price_tax_excl currency=$currency->id}</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span class="product_quantity_show{if (int)$product['product_quantity'] - (int)$product['customized_product_quantity'] > 1} badge{/if}">{(int)$product['product_quantity'] - (int)$product['customized_product_quantity']}</span>
|
||||
{if $can_edit}
|
||||
<span class="product_quantity_edit" style="display:none;">
|
||||
<input type="text" name="product_quantity" class="edit_product_quantity" value="{$product['product_quantity']|htmlentities}"/>
|
||||
</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span class="room_price_show">{displayPrice price=$product_price * ($product['product_quantity'] - $product['customizationQuantityTotal']) currency=$currency->id}</span>
|
||||
{* {if $can_edit}
|
||||
<div class="room_price_edit" style="display:none;">
|
||||
<input type="hidden" name="product_id_order_detail" class="edit_product_id_order_detail" value="{$product['id_order_detail']}" />
|
||||
<div class="form-group">
|
||||
<div class="fixed-width-xl">
|
||||
<div class="input-group">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
|
||||
<input type="text" name="product_price_tax_excl" class="edit_product_price_tax_excl edit_product_price" value="{Tools::ps_round($product['unit_price_tax_excl'], 2)}"/>
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="fixed-width-xl">
|
||||
<div class="input-group">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
|
||||
<input type="text" name="product_price_tax_incl" class="edit_product_price_tax_incl edit_product_price" value="{Tools::ps_round($product['unit_price_tax_incl'], 2)}"/>
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if} *}
|
||||
</td>
|
||||
|
||||
{* {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}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{if isset($data.refund_info) && $data.refund_info}
|
||||
{convertPriceWithCurrency price=$data.refund_info.refunded_amount currency=$currency->id}
|
||||
{/if}
|
||||
</td>
|
||||
{/if} *}
|
||||
|
||||
{* {if $data.booking_type == 1}
|
||||
<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="room_invoice" style="display: none;">
|
||||
{if sizeof($invoices_collection)}
|
||||
<select name="product_invoice" class="edit_product_invoice">
|
||||
{foreach from=$invoices_collection item=invoice}
|
||||
<option value="{$invoice->id}" {*{if $invoice->id == $product['id_order_invoice']}selected="selected"{/if}*}>
|
||||
#{Configuration::get('PS_INVOICE_PREFIX', $current_id_lang, null, $order->id_shop)}{'%06d'|sprintf:$invoice->number}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
{else}
|
||||
|
||||
{/if}
|
||||
</td>
|
||||
<td class="product_action text-right">
|
||||
{* edit/delete controls *}
|
||||
<div class="btn-group">
|
||||
{* <button type="button" class="btn btn-default delete_product_line">
|
||||
<i class="icon-trash"></i>
|
||||
{l s='Delete'}
|
||||
</button> *}
|
||||
<button type="button" class="btn btn-default edit_product_change_link">
|
||||
<i class="icon-pencil"></i>
|
||||
{l s='Edit'}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="#" class="delete_product_line">
|
||||
<i class="icon-trash"></i>
|
||||
{l s='Delete'}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{* Update controls *}
|
||||
<button type="button" class="btn btn-default submitProductChange" style="display: none;">
|
||||
<i class="icon-ok"></i>
|
||||
{l s='Update'}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default cancel_product_change_link" style="display: none;">
|
||||
<i class="icon-remove"></i>
|
||||
{l s='Cancel'}
|
||||
</button>
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
@@ -1,60 +0,0 @@
|
||||
{*
|
||||
* Since 2010 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<table class="table" id="customer_products_details" {if !$order_service_products}style="display:none"{/if}>
|
||||
<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='Image'}</th>
|
||||
<th class="text-center"><span class="title_box">{l s='Name'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Unit Price (Tax excl.)'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Quantity'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Total Price (Tax incl.)'}</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-right"><span class="title_box">{l s='Edit Order'}</th>
|
||||
{/if}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if $order_service_products}
|
||||
{foreach from=$order_service_products item=product}
|
||||
{* Include product line partial *}
|
||||
{include file='controllers/orders/_service_product_line.tpl'}
|
||||
{/foreach}
|
||||
{else}
|
||||
{* <tr>
|
||||
<td>{l s='No Data Found.'}</td>
|
||||
</tr> *}
|
||||
{/if}
|
||||
{* Include product line partial *}
|
||||
{include file='controllers/orders/_new_service_product.tpl'}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,153 @@
|
||||
{*
|
||||
* Since 2010 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<table class="table" id="customer_products_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><span class="title_box">{l s='Image'}</th>
|
||||
<th class="text-center"><span class="title_box">{l s='Name'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Quantity'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Price (Tax excl.)'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Total Tax'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Total Price (Tax incl.)'}</span></th>
|
||||
{if isset($refundReqProducts) && $refundReqProducts}
|
||||
<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}
|
||||
{if ($can_edit && !$order->hasBeenDelivered())}
|
||||
<th class="text-right"><span class="title_box">{l s='Edit Order'}</th>
|
||||
{/if}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if $standalone_service_products}
|
||||
{foreach from=$standalone_service_products item=product}
|
||||
{* Include product line partial *}
|
||||
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
|
||||
{assign var=product_price value=($product['unit_price_tax_excl'])}
|
||||
{else}
|
||||
{assign var=product_price value=$product['unit_price_tax_incl']}
|
||||
{/if}
|
||||
<tr class="product-line-row" data-id_product="{$product.id_product}" data-id_order_detail="{$product.id_order_detail}" data-id_room_type_service_product_order_detail="{$product.id_room_type_service_product_order_detail}">
|
||||
<td class="text-center">
|
||||
{if isset($product.image) && $product.image->id}{$product.image_tag}{/if}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&id_product={$product['id_product']|intval}&updateproduct&token={getAdminToken tab='AdminProducts'}">
|
||||
<span class="productName">{$product['name']}{if $product['option_name']} : {$product['option_name']}{/if}</span><br />
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span class="">{(int)$product['quantity']}</span>
|
||||
</td>
|
||||
<td class="text-center unit_price_tax_excl">
|
||||
<p>{displayPrice price=$product.total_price_tax_excl currency=$currency->id}</p>
|
||||
<p class="help-block">{l s='Unit price'} : {displayPrice price=$product.unit_price_tax_excl currency=$currency->id}</p>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span>{displayPrice price=($product.total_price_tax_incl - $product.total_price_tax_excl) currency=$currency->id}</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span>{displayPrice price=$product.total_price_tax_incl currency=$currency->id}</span>
|
||||
</td>
|
||||
{if (isset($refundReqProducts) && $refundReqProducts)}
|
||||
<td class="text-center">
|
||||
{if $product.id_room_type_service_product_order_detail|in_array:$refundReqProducts}
|
||||
{if $product.is_cancelled}
|
||||
<span class="badge badge-danger">{l s='Cancelled'}</span>
|
||||
{elseif isset($product.refund_info) && (!$product.refund_info.refunded || $product.refund_info.id_customization)}
|
||||
<span class="badge" style="background-color:{$product.refund_info.color|escape:'html':'UTF-8'}">{$product.refund_info.name|escape:'html':'UTF-8'}</span>
|
||||
{else}
|
||||
<span>--</span>
|
||||
{/if}
|
||||
{else}
|
||||
<span>--</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{if $product.is_refunded && isset($product.refund_info) && $product.refund_info}
|
||||
{convertPriceWithCurrency price=$product.refund_info.refunded_amount currency=$currency->id}
|
||||
{else}
|
||||
--
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
{if ($can_edit && !$order->hasBeenDelivered())}
|
||||
<td class="room_invoice" style="display: none;">
|
||||
{if sizeof($invoices_collection)}
|
||||
<select name="product_invoice" class="edit_product_invoice">
|
||||
{foreach from=$invoices_collection item=invoice}
|
||||
<option value="{$invoice->id}" {*{if $invoice->id == $product['id_order_invoice']}selected="selected"{/if}*}>
|
||||
#{Configuration::get('PS_INVOICE_PREFIX', $current_id_lang, null, $order->id_shop)}{'%06d'|sprintf:$invoice->number}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
{else}
|
||||
|
||||
{/if}
|
||||
</td>
|
||||
<td class="product_action text-right">
|
||||
{* edit/delete controls *}
|
||||
<div class="btn-group">
|
||||
{* <button type="button" class="btn btn-default delete_product_line">
|
||||
<i class="icon-trash"></i>
|
||||
{l s='Delete'}
|
||||
</button> *}
|
||||
<button type="button" class="btn btn-default edit_product_change_link" data-product_line_data="{$product|json_encode|escape}">
|
||||
<i class="icon-pencil"></i>
|
||||
{l s='Edit'}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="#" class="delete_product_line">
|
||||
<i class="icon-trash"></i>
|
||||
{l s='Delete'}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{* Update controls *}
|
||||
{* <button type="button" class="btn btn-default submitProductChange" style="display: none;">
|
||||
<i class="icon-ok"></i>
|
||||
{l s='Update'}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default cancel_product_change_link" style="display: none;">
|
||||
<i class="icon-remove"></i>
|
||||
{l s='Cancel'}
|
||||
</button> *}
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td>{l s='No Data Found.'}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{* Include product line partial *}
|
||||
{* {include file='controllers/orders/_new_service_product.tpl'} *}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -280,6 +280,28 @@
|
||||
};
|
||||
updateProductPrice(params, cart_row);
|
||||
})
|
||||
$(document).on('change', '.product_quantity', function(e) {
|
||||
var cart_row = $(this).closest('tr');
|
||||
var qty = parseInt($(this).val());
|
||||
var qtyhidden= parseInt($(this).siblings('.product_quantity_hidden').val());
|
||||
var qty_to_update = qty - qtyhidden;
|
||||
if ((qty_to_update) > 0) {
|
||||
var opt = 'up';
|
||||
} else {
|
||||
var opt = 'down';
|
||||
}
|
||||
|
||||
var params = {
|
||||
id_product: parseInt($(cart_row).attr('data-id-product')),
|
||||
id_hotel_service_product_cart_detail: parseInt($(cart_row).attr('data-id_hotel_service_product_cart_detail')),
|
||||
qty: qty_to_update,
|
||||
opt: opt,
|
||||
id_cart: id_cart
|
||||
};
|
||||
|
||||
updateQuantity(params, cart_row);
|
||||
$(this).siblings('.product_quantity_hidden').val($(this).val())
|
||||
});
|
||||
$('#order_message').live('change', function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
@@ -697,6 +719,26 @@
|
||||
});
|
||||
}
|
||||
|
||||
function updateQuantity(params, cart_row)
|
||||
{
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
|
||||
async: true,
|
||||
dataType: "JSON",
|
||||
data: {
|
||||
ajax: "1",
|
||||
token: "{getAdminToken tab='AdminCarts'}",
|
||||
tab: "AdminCarts",
|
||||
action: "updateProductQuantity",
|
||||
params: params,
|
||||
},
|
||||
success : function(response) {
|
||||
// updateCartLine(response.curr_booking_info, cart_row);
|
||||
// updateCartSummaryData(response.cart_info);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateCartLine(data, cart_row) {
|
||||
$(cart_row).find('.cart_line_total_rooms_price').html(data.amt_with_qty);
|
||||
|
||||
@@ -88,89 +88,90 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-7">
|
||||
<div class="panel">
|
||||
<div class="panel-heading order_status_heading">
|
||||
<i class="icon-bed"></i> {l s='Rooms Status'}
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 table-responsive" id="room_status_info_wrapper">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{l s='Room'}</th>
|
||||
<th>{l s='Duration'}</th>
|
||||
<th>{l s='Check-In'}</th>
|
||||
<th>{l s='Check-Out'}</th>
|
||||
<th>{l s='Allotment'}</th>
|
||||
<th>{l s='Action'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if isset($htl_booking_order_data) && $htl_booking_order_data}
|
||||
{foreach from=$htl_booking_order_data item=data}
|
||||
<tr>
|
||||
<td>
|
||||
{$data['room_num']}<br>
|
||||
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&id_product={$data['id_product']}&updateproduct" target="_blank">{$data['room_type_name']|escape:'html':'UTF-8'}</a>
|
||||
</td>
|
||||
<td>
|
||||
{assign var="is_full_date" value=($show_full_date && ($data['date_from']|date_format:'%D' == $data['date_to']|date_format:'%D'))}
|
||||
{dateFormat date=$data['date_from'] full=$is_full_date} - {dateFormat date=$data['date_to'] full=$is_full_date}
|
||||
</td>
|
||||
<td>
|
||||
{if ($data['id_status'] == $hotel_order_status['STATUS_CHECKED_IN']['id_status']) || ($data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status'])}
|
||||
<span class="text-danger room_status">{l s='Checked in on'}<br>{dateFormat date=$data['check_in'] full=1}</span>
|
||||
{else}
|
||||
--
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{if $data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status']}
|
||||
<span class="text-success room_status">{l s='Checked out on'}<br>{dateFormat date=$data['check_out'] full=1}</span>
|
||||
{else}
|
||||
--
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{if $data['booking_type'] == $ALLOTMENT_MANUAL}
|
||||
{l s='Manual'} {if $data['comment'] != ''}<a class="manual_allotment_comment" href="#" data-id_hotel_booking_detail="{$data['id']}"><i class="icon-info-circle"></i></a>{/if}
|
||||
{else}
|
||||
{l s='Auto'}
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
<a title="{l s='Upload/Check guest documents'}" class="btn btn-default" href="#" onclick="BookingDocumentsModal.init({$data.id|intval}, this); return false;">
|
||||
<span class="badge badge-info">{if $data.num_checkin_documents > 0}{$data.num_checkin_documents}{else}0{/if}</span> <i class="icon-file-text"></i>
|
||||
</a>
|
||||
|
||||
{if isset($refundReqBookings) && $refundReqBookings && $data.id|in_array:$refundReqBookings && $data.is_refunded}
|
||||
<span class="badge badge-danger">{if $data.is_cancelled}{l s='Cancelled'}{else}{l s='Refunded'}{/if}</span>
|
||||
{elseif $can_edit}
|
||||
<a class="open_room_status_form btn btn-default" href="#" data-id_hotel_booking_detail="{$data['id']}" data-id_order="{$data['id_order']}" data-id_status="{$data['id_status']}" data-id_room="{$data['id_room']}" data-date_from="{$data['date_from']|date_format:"%Y-%m-%d"}" data-date_to="{$data['date_to']|date_format:"%Y-%m-%d"}" data-check_in_time="{$data['check_in_time']}" data-check_out_time="{$data['check_out_time']}">
|
||||
<i class="icon-pencil"></i> {l s='Edit'}
|
||||
{if isset($htl_booking_order_data) && $htl_booking_order_data}
|
||||
<div class="panel">
|
||||
<div class="panel-heading order_status_heading">
|
||||
<i class="icon-bed"></i> {l s='Rooms Status'}
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 table-responsive" id="room_status_info_wrapper">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{l s='Room'}</th>
|
||||
<th>{l s='Duration'}</th>
|
||||
<th>{l s='Check-In'}</th>
|
||||
<th>{l s='Check-Out'}</th>
|
||||
<th>{l s='Allotment'}</th>
|
||||
<th>{l s='Action'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if isset($htl_booking_order_data) && $htl_booking_order_data}
|
||||
{foreach from=$htl_booking_order_data item=data}
|
||||
<tr>
|
||||
<td>
|
||||
{$data['room_num']}<br>
|
||||
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&id_product={$data['id_product']}&updateproduct" target="_blank">{$data['room_type_name']|escape:'html':'UTF-8'}</a>
|
||||
</td>
|
||||
<td>
|
||||
{assign var="is_full_date" value=($show_full_date && ($data['date_from']|date_format:'%D' == $data['date_to']|date_format:'%D'))}
|
||||
{dateFormat date=$data['date_from'] full=$is_full_date} - {dateFormat date=$data['date_to'] full=$is_full_date}
|
||||
</td>
|
||||
<td>
|
||||
{if ($data['id_status'] == $hotel_order_status['STATUS_CHECKED_IN']['id_status']) || ($data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status'])}
|
||||
<span class="text-danger room_status">{l s='Checked in on'}<br>{dateFormat date=$data['check_in'] full=1}</span>
|
||||
{else}
|
||||
--
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{if $data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status']}
|
||||
<span class="text-success room_status">{l s='Checked out on'}<br>{dateFormat date=$data['check_out'] full=1}</span>
|
||||
{else}
|
||||
--
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{if $data['booking_type'] == $ALLOTMENT_MANUAL}
|
||||
{l s='Manual'} {if $data['comment'] != ''}<a class="manual_allotment_comment" href="#" data-id_hotel_booking_detail="{$data['id']}"><i class="icon-info-circle"></i></a>{/if}
|
||||
{else}
|
||||
{l s='Auto'}
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
<a title="{l s='Upload/Check guest documents'}" class="btn btn-default" href="#" onclick="BookingDocumentsModal.init({$data.id|intval}, this); return false;">
|
||||
<span class="badge badge-info">{if $data.num_checkin_documents > 0}{$data.num_checkin_documents}{else}0{/if}</span> <i class="icon-file-text"></i>
|
||||
</a>
|
||||
{/if}
|
||||
|
||||
{if isset($refundReqBookings) && $refundReqBookings && $data.id|in_array:$refundReqBookings && $data.is_refunded}
|
||||
<span class="badge badge-danger">{if $data.is_cancelled}{l s='Cancelled'}{else}{l s='Refunded'}{/if}</span>
|
||||
{elseif $can_edit}
|
||||
<a class="open_room_status_form btn btn-default" href="#" data-id_hotel_booking_detail="{$data['id']}" data-id_order="{$data['id_order']}" data-id_status="{$data['id_status']}" data-id_room="{$data['id_room']}" data-date_from="{$data['date_from']|date_format:"%Y-%m-%d"}" data-date_to="{$data['date_to']|date_format:"%Y-%m-%d"}" data-check_in_time="{$data['check_in_time']}" data-check_out_time="{$data['check_out_time']}">
|
||||
<i class="icon-pencil"></i> {l s='Edit'}
|
||||
</a>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td class="list-empty hidden-print" colspan="6">
|
||||
<div class="list-empty-msg">
|
||||
<i class="icon-warning-sign list-empty-icon"></i>
|
||||
{l s='No rooms found'}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td class="list-empty hidden-print" colspan="6">
|
||||
<div class="list-empty-msg">
|
||||
<i class="icon-warning-sign list-empty-icon"></i>
|
||||
{l s='No rooms found'}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/if}
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-file"></i> {l s='Order'}
|
||||
@@ -785,31 +786,33 @@
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-remove-sign"></i> {l s='Cancellation Policies'}
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
{if is_array($applicable_refund_policies) && count($applicable_refund_policies)}
|
||||
<ul>
|
||||
{foreach from=$applicable_refund_policies item=$applicable_refund_policy}
|
||||
<li class="form-group">
|
||||
<a href="{$link->getAdminLink('AdminOrderRefundRules')|escape:'html':'UTF-8'}&id_refund_rule={$applicable_refund_policy.id_refund_rule}&updatehtl_order_refund_rules" target="_blank">
|
||||
{$applicable_refund_policy.name|escape:'html':'UTF-8'} <i class="icon icon-external-link-square"></i>
|
||||
</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{else}
|
||||
<div class="list-empty">
|
||||
<div class="list-empty-msg">
|
||||
<i class="icon-warning-sign list-empty-icon"></i>
|
||||
{l s='No cancellation policies applicable.'}
|
||||
{if is_array($applicable_refund_policies) && count($applicable_refund_policies)}
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-remove-sign"></i> {l s='Cancellation Policies'}
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
{if is_array($applicable_refund_policies) && count($applicable_refund_policies)}
|
||||
<ul>
|
||||
{foreach from=$applicable_refund_policies item=$applicable_refund_policy}
|
||||
<li class="form-group">
|
||||
<a href="{$link->getAdminLink('AdminOrderRefundRules')|escape:'html':'UTF-8'}&id_refund_rule={$applicable_refund_policy.id_refund_rule}&updatehtl_order_refund_rules" target="_blank">
|
||||
{$applicable_refund_policy.name|escape:'html':'UTF-8'} <i class="icon icon-external-link-square"></i>
|
||||
</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{else}
|
||||
<div class="list-empty">
|
||||
<div class="list-empty-msg">
|
||||
<i class="icon-warning-sign list-empty-icon"></i>
|
||||
{l s='No cancellation policies applicable.'}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{hook h="displayAdminOrderRight" id_order=$order->id}
|
||||
</div>
|
||||
</div>
|
||||
@@ -821,26 +824,61 @@
|
||||
<div style="display: none">
|
||||
<input type="hidden" value="{$order->getWarehouseList()|implode}" id="warehouse_list" />
|
||||
</div>
|
||||
<div class="panel" id="refundForm">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-bed"></i> {l s='Rooms Booking Detail'} <span class="badge">{$order_detail_data|@count}</span>
|
||||
{if $can_edit && (!$order->hasBeenDelivered() && $currentState->id != Configuration::get('PS_OS_REFUND') && $currentState->id != Configuration::get('PS_OS_CANCELED'))}
|
||||
<button type="button" id="add_room" class="btn btn-primary pull-right">
|
||||
<i class="icon-plus-sign"></i> {l s='Add Rooms'}
|
||||
</button>
|
||||
{if $hotel_booking}
|
||||
<div class="panel" id="refundForm">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-bed"></i> {l s='Rooms Booking Detail'} <span class="badge">{$order_detail_data|@count}</span>
|
||||
{if $can_edit && (!$order->hasBeenDelivered() && $currentState->id != Configuration::get('PS_OS_REFUND') && $currentState->id != Configuration::get('PS_OS_CANCELED'))}
|
||||
<button type="button" id="add_room" class="btn btn-primary pull-right">
|
||||
<i class="icon-plus-sign"></i> {l s='Add Rooms'}
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
{* by webkul this code is added for showing rooms information on the order detail page *}
|
||||
{include file='controllers/orders/_rooms_informaion_table.tpl'}
|
||||
|
||||
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
|
||||
<input type="hidden" name="TaxMethod" value="0">
|
||||
{else}
|
||||
<input type="hidden" name="TaxMethod" value="1">
|
||||
{/if}
|
||||
</div>
|
||||
{* by webkul this code is added for showing rooms information on the order detail page *}
|
||||
{include file='controllers/orders/_rooms_informaion_table.tpl'}
|
||||
<br>
|
||||
{include file='controllers/orders/_service_products_table.tpl'}
|
||||
<div class="panel" id="refundForm">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-bed"></i> {l s='Product Detail'} <span class="badge">{$hotel_service_products|count}</span>
|
||||
{if $can_edit && (!$order->hasBeenDelivered() && $currentState->id != Configuration::get('PS_OS_REFUND') && $currentState->id != Configuration::get('PS_OS_CANCELED'))}
|
||||
<button type="button" id="add_product" class="btn btn-primary pull-right">
|
||||
<i class="icon-plus-sign"></i> {l s='Add Product'}
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
{include file='controllers/orders/_hotel_service_products_table.tpl'}
|
||||
|
||||
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
|
||||
<input type="hidden" name="TaxMethod" value="0">
|
||||
{else}
|
||||
<input type="hidden" name="TaxMethod" value="1">
|
||||
{/if}
|
||||
</div>
|
||||
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
|
||||
<input type="hidden" name="TaxMethod" value="0">
|
||||
{else}
|
||||
<input type="hidden" name="TaxMethod" value="1">
|
||||
{/if}
|
||||
</div>
|
||||
{else}
|
||||
<div class="panel" id="refundForm">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-bed"></i> {l s='Booking Detail'} <span class="badge">{$standalone_service_products|count}</span>
|
||||
{if $can_edit && (!$order->hasBeenDelivered() && $currentState->id != Configuration::get('PS_OS_REFUND') && $currentState->id != Configuration::get('PS_OS_CANCELED'))}
|
||||
<button type="button" id="add_product" class="btn btn-primary pull-right">
|
||||
<i class="icon-plus-sign"></i> {l s='Add Product'}
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
{include file='controllers/orders/_standalone_service_products_table.tpl'}
|
||||
|
||||
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
|
||||
<input type="hidden" name="TaxMethod" value="0">
|
||||
{else}
|
||||
<input type="hidden" name="TaxMethod" value="1">
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -872,8 +910,8 @@
|
||||
{assign var=total_rooms_price_tax_incl value=$order->getTotalProductsWithTaxes(false, true)}
|
||||
|
||||
{* Get total extra services including convenience fees prices *}
|
||||
{assign var=total_services_price_tax_excl value=$order->getTotalProductsWithoutTaxes(false, false)}
|
||||
{assign var=total_services_price_tax_incl value=$order->getTotalProductsWithTaxes(false, false)}
|
||||
{assign var=total_products_price_tax_excl value=($order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL) + $order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_STANDALONE))}
|
||||
{assign var=total_products_price_tax_incl value=($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL) + $order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_STANDALONE))}
|
||||
|
||||
{* Get total of extra services and extra demands prices(excluding convenience fee) *}
|
||||
{assign var=total_room_services_and_demands_tax_excl value=($order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $totalDemandsPriceTE)}
|
||||
@@ -883,8 +921,8 @@
|
||||
{assign var=total_convenience_fee_tax_excl value=$order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT)}
|
||||
{assign var=total_convenience_fee_tax_incl value=$order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT)}
|
||||
|
||||
{assign var=order_total_price_tax_excl value=($total_rooms_price_tax_excl + $total_services_price_tax_excl + $totalDemandsPriceTE)}
|
||||
{assign var=order_total_price_tax_incl value=($total_rooms_price_tax_incl + $total_services_price_tax_incl + $totalDemandsPriceTI)}
|
||||
{assign var=order_total_price_tax_excl value=($total_rooms_price_tax_excl + $total_room_services_and_demands_tax_excl + $total_convenience_fee_tax_excl)}
|
||||
{assign var=order_total_price_tax_incl value=($total_rooms_price_tax_incl + $total_room_services_and_demands_tax_incl + $total_convenience_fee_tax_incl)}
|
||||
|
||||
{if $total_rooms_price_tax_excl}
|
||||
<tr id="total_products">
|
||||
@@ -895,6 +933,15 @@
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $total_products_price_tax_excl > 0}
|
||||
<tr id="total_products">
|
||||
<td class="text-right">{l s='Total products (Tax excl.)'}</td>
|
||||
<td class="amount text-right nowrap">
|
||||
{displayPrice price=$total_products_price_tax_excl currency=$currency->id}
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if isset($total_room_services_and_demands_tax_excl) && $total_room_services_and_demands_tax_excl > 0}
|
||||
<tr id="total_products">
|
||||
<td class="text-right">{l s='Total Extra services (Tax excl.)'}</td>
|
||||
@@ -968,6 +1015,15 @@
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if ($total_products_price_tax_incl - $total_products_price_tax_excl) > 0}
|
||||
<tr id="total_products">
|
||||
<td class="text-left">{l s='Products Tax'}</td>
|
||||
<td class="amount text-right nowrap">
|
||||
{displayPrice price=($total_products_price_tax_incl - $total_products_price_tax_excl) currency=$currency->id}
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if isset($total_convenience_fee_tax_excl) && $total_convenience_fee_tax_excl > 0}
|
||||
<tr id="total_products">
|
||||
<td class="text-left">{l s='Convenience Fee Tax'}</td>
|
||||
@@ -1012,7 +1068,7 @@
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
|
||||
{if isset($refundReqBookings) && $refundReqBookings}
|
||||
{if (isset($refundReqBookings) && $refundReqBookings) || (isset($refundReqProducts) && $refundReqProducts)}
|
||||
<tr id="total_order">
|
||||
<td class="text-right"><strong>* {l s='Refunded Amount'}</strong></td>
|
||||
<td class="amount text-right nowrap">
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
{*
|
||||
* Since 2010 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="modal-body">
|
||||
<div id="new_product">
|
||||
<input type="hidden" id="add_product_product_id" name="add_product[product_id]" value="0" />
|
||||
<div class="form-group">
|
||||
<label class="control-label">{l s='Product:'}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" id="add_product_product_name" class="form-control" value="" placeholder="{l s='Enter the name of the product'}" />
|
||||
<div class="input-group-addon">
|
||||
<i class="icon-search"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="add_product_fields" style="display:none;">
|
||||
{hook h='displayAdminOrderAddRoomFormFieldsBefore'}
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Price (tax excl.)'}</label>
|
||||
<div class="input-group">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign}</div>{/if}
|
||||
<input class="form-control" type="text" name="add_product[product_price_tax_excl]" id="add_product_product_price_tax_excl" value="" disabled="disabled"/>
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Price (tax incl.)'}</label>
|
||||
<div class="input-group">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign}</div>{/if}
|
||||
<input class="form-control" type="text" name="add_product[product_price_tax_incl]" id="add_product_product_price_tax_incl" value="" disabled="disabled"/>
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="">
|
||||
<div class="row">
|
||||
<div class="productQuantity form-group col-sm-6">
|
||||
<label class="control-label">{l s='Quantity'}</label>
|
||||
<input type="number" class="form-control" name="add_product[product_quantity]" id="add_product_product_quantity" value="1" disabled="disabled" min="1"/>
|
||||
</div>
|
||||
|
||||
<div class="productOptions form-group col-sm-6" style="display: none;">
|
||||
<label class="control-label">{l s='Variant'}</label>
|
||||
<select name="add_product[product_option]" id="add_product_product_option">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{if sizeof($invoices_collection)}
|
||||
<div class="form-group">
|
||||
<label class="control-label">{l s='Invoice'}</label>
|
||||
<select class="form-control" name="add_product[invoice]" id="add_product_product_invoice" disabled="disabled">
|
||||
<optgroup class="existing" label="{l s='Existing'}">
|
||||
{foreach from=$invoices_collection item=invoice}
|
||||
<option value="{$invoice->id}">{$invoice->getInvoiceNumberFormatted($current_id_lang)}</option>
|
||||
{/foreach}
|
||||
</optgroup>
|
||||
<optgroup label="{l s='New'}">
|
||||
<option value="0">{l s='Create a new invoice'}</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<button type="button" class="btn btn-default" id="submitAddProduct" disabled="disabled" style="display:none;"></button>
|
||||
</div>
|
||||
|
||||
{if isset($loaderImg) && $loaderImg}
|
||||
<div class="loading_overlay">
|
||||
<img src='{$loaderImg}' class="loading-img"/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -18,7 +18,7 @@
|
||||
*}
|
||||
|
||||
<div class="modal-body">
|
||||
<div id="new_product">
|
||||
<div id="new_room">
|
||||
<input type="hidden" id="add_product_product_id" name="add_product[product_id]" value="0" />
|
||||
<div class="form-group">
|
||||
<label class="control-label">{l s='Room Type:'}</label>
|
||||
@@ -142,7 +142,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<button type="button" class="btn btn-default" id="submitAddProduct" disabled="disabled" style="display:none;"></button>
|
||||
<button type="button" class="btn btn-default" id="submitAddRoom" disabled="disabled" style="display:none;"></button>
|
||||
</div>
|
||||
|
||||
{if isset($loaderImg) && $loaderImg}
|
||||
|
||||
@@ -18,39 +18,71 @@
|
||||
*}
|
||||
|
||||
<div class="modal-body">
|
||||
{if $bookingOrderInfo|count > 0}
|
||||
{if $bookingOrderInfo|count > 0 || $serviceProducts|count > 0}
|
||||
<form id="order_discount_form" action="{$current_index}&vieworder&token={$smarty.get.token|escape:'html':'UTF-8'}&id_order={$order->id|intval}" method="post">
|
||||
<div class="form-group">
|
||||
<div class="table-responsive">
|
||||
<table class="table" id="customer_cart_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>{l s='Room No.'}</th>
|
||||
<th>{l s='Room Type'}</th>
|
||||
<th>{l s='Hotel Name'}</th>
|
||||
<th>{l s='Duration'}</th>
|
||||
<th>{l s='Total Price (Tax incl.)'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$bookingOrderInfo item=bookingInfo}
|
||||
{if $bookingOrderInfo|count}
|
||||
<h3>{l s='Rooms'}</h3>
|
||||
<div class="form-group">
|
||||
<div class="table-responsive">
|
||||
<table class="table" id="customer_cart_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" name="id_htl_booking[]" value="{$bookingInfo.id|escape:'html':'UTF-8'}"/>
|
||||
</td>
|
||||
<td><b>{$bookingInfo.room_num|escape:'html':'UTF-8'}</b></td>
|
||||
<td>{$bookingInfo.room_type_name|escape:'html':'UTF-8'}</td>
|
||||
<td>{$bookingInfo.hotel_name|escape:'html':'UTF-8'}</td>
|
||||
{assign var="is_full_date" value=($show_full_date && ($bookingInfo['date_from']|date_format:'%D' == $bookingInfo['date_to']|date_format:'%D'))}
|
||||
<td>{dateFormat date=$bookingInfo.date_from full=$is_full_date} - {dateFormat date=$bookingInfo.date_to full=$is_full_date}</span></td>
|
||||
<td>{convertPriceWithCurrency price=$bookingInfo.total_price_tax_incl currency=$currency->id}</td>
|
||||
<th></th>
|
||||
<th>{l s='Room No.'}</th>
|
||||
<th>{l s='Room Type'}</th>
|
||||
<th>{l s='Hotel Name'}</th>
|
||||
<th>{l s='Duration'}</th>
|
||||
<th>{l s='Total Price (Tax incl.)'}</th>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$bookingOrderInfo item=bookingInfo}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" name="id_htl_booking[]" value="{$bookingInfo.id|escape:'html':'UTF-8'}"/>
|
||||
</td>
|
||||
<td><b>{$bookingInfo.room_num|escape:'html':'UTF-8'}</b></td>
|
||||
<td>{$bookingInfo.room_type_name|escape:'html':'UTF-8'}</td>
|
||||
<td>{$bookingInfo.hotel_name|escape:'html':'UTF-8'}</td>
|
||||
{assign var="is_full_date" value=($show_full_date && ($bookingInfo['date_from']|date_format:'%D' == $bookingInfo['date_to']|date_format:'%D'))}
|
||||
<td>{dateFormat date=$bookingInfo.date_from full=$is_full_date} - {dateFormat date=$bookingInfo.date_to full=$is_full_date}</span></td>
|
||||
<td>{convertPriceWithCurrency price=$bookingInfo.total_price_tax_incl currency=$currency->id}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if $serviceProducts|count}
|
||||
<h3>{l s='Products'}</h3>
|
||||
<div class="form-group">
|
||||
<div class="table-responsive">
|
||||
<table class="table" id="customer_cart_product_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>{l s='Name'}</th>
|
||||
<th>{l s='Quantity'}</th>
|
||||
<th>{l s='Total Price (Tax incl.)'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$serviceProducts item=product}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" name="id_room_type_service_product_order_detail[]" value="{$product.id_room_type_service_product_order_detail|escape:'html':'UTF-8'}"/>
|
||||
</td>
|
||||
<td>{$product.name|escape:'html':'UTF-8'}{if $product.option_name} : {$product.option_name|escape:'html':'UTF-8'}{/if}</td>
|
||||
<td>{$product.quantity|escape:'html':'UTF-8'}</td>
|
||||
<td>{convertPriceWithCurrency price=$product.total_price_tax_incl currency=$currency->id}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">{l s='Reason to Cancel'}</label>
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
{*
|
||||
* Since 2010 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="modal-body">
|
||||
<div id="edit_product">
|
||||
<input type="hidden" id="edit_product_product_id" name="edit_product[product_id]" value="{$RoomTypeServiceProductOrderDetail->id_product}" />
|
||||
<input type="hidden" id="edit_product_id_room_type_service_product_order_detail" name="edit_product[id_room_type_service_product_order_detail]" value="{$RoomTypeServiceProductOrderDetail->id}" />
|
||||
<input type="hidden" id="edit_product_id_order" name="id_order" value="{$order->id}" />
|
||||
{* <div class="form-group">
|
||||
<label class="control-label">{l s='Product:'}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" id="edit_product_product_name" class="form-control" value="" placeholder="{l s='Enter the name of the product'}" />
|
||||
<div class="input-group-addon">
|
||||
<i class="icon-search"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div> *}
|
||||
<div class="edit_product_fields">
|
||||
{hook h='displayAdminOrderEditProductFieldsBefore'}
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Unit Price (tax excl.)'}</label>
|
||||
<div class="input-group">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign}</div>{/if}
|
||||
<input class="form-control" type="text" name="edit_product[product_price_tax_excl]" id="edit_product_product_price_tax_excl" value="{$RoomTypeServiceProductOrderDetail->unit_price_tax_excl}"/>
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
{* <div class="col-sm-6">
|
||||
<label class="control-label">{l s='Unit Price (tax incl.)'}</label>
|
||||
<div class="input-group">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign}</div>{/if}
|
||||
<input class="form-control" type="text" name="edit_product[product_price_tax_incl]" id="edit_product_product_price_tax_incl" value="{$RoomTypeServiceProductOrderDetail->unit_price_tax_incl}"/>
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign}</div>{/if}
|
||||
</div>
|
||||
</div> *}
|
||||
</div>
|
||||
|
||||
<div class="">
|
||||
<div class="row">
|
||||
<div class="productQuantity form-group col-sm-6">
|
||||
<label class="control-label">{l s='Quantity'}</label>
|
||||
<input type="number" class="form-control" name="edit_product[product_quantity]" id="edit_product_product_quantity" value="{$RoomTypeServiceProductOrderDetail->quantity}" min="1"/>
|
||||
</div>
|
||||
|
||||
<div class="productOptions form-group col-sm-6" style="display: none;">
|
||||
<label class="control-label">{l s='Variant'}</label>
|
||||
<select name="edit_product[product_option]" id="edit_product_product_option">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-default" id="submitAddProduct" disabled="disabled" style="display:none;"></button>
|
||||
</div>
|
||||
|
||||
{if isset($loaderImg) && $loaderImg}
|
||||
<div class="loading_overlay">
|
||||
<img src='{$loaderImg}' class="loading-img"/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
194
classes/Cart.php
194
classes/Cart.php
@@ -179,7 +179,7 @@ class CartCore extends ObjectModel
|
||||
const ADVANCE_PAYMENT_ONLY_PRODUCTS = 10;
|
||||
const ONLY_ROOMS = 11;
|
||||
const ONLY_ROOM_SERVICES = 12;
|
||||
const ONLY_SERVICE_PRODUCTS = 13;
|
||||
const ONLY_STANDALONE_PRODUCTS = 13;
|
||||
|
||||
const ONLY_ROOM_SERVICES_WITHOUT_CONVENIENCE_FEE = 14;
|
||||
const ONLY_ROOM_SERVICES_WITHOUT_AUTO_ADD = 16;
|
||||
@@ -776,14 +776,26 @@ class CartCore extends ObjectModel
|
||||
$row['total_wt'] += Tools::processPriceRounding($service['unit_price_tax_incl'], $service['quantity']);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$objHotelServiceProductCartDetail = new HotelServiceProductCartDetail();
|
||||
$unitPriceByProductTaxIncl = $objHotelServiceProductCartDetail->getHotelProductUnitPrice($this->id, (int)$row['id_product'], 0, true);
|
||||
$unitPriceByProductTaxExcl = $objHotelServiceProductCartDetail->getHotelProductUnitPrice($this->id, (int)$row['id_product'], 0, false);
|
||||
|
||||
} else if (ProductCore::SERVICE_PRODUCT_lINKED_WITH_HOTEL == $row['service_product_type']) {
|
||||
$row['total'] = 0;
|
||||
$row['total_wt'] = 0;
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
$price_tax_excl = $objRoomTypeServiceProductCartDetail->getProducts($this->id, $row['id_product'], 0, null, 0, null, 0, 1, false);
|
||||
$price_tax_incl = $objRoomTypeServiceProductCartDetail->getProducts($this->id, $row['id_product'], 0, null, 0, null, 0, 1, true);
|
||||
// Rounding as per configurations
|
||||
$row['total'] += Tools::processPriceRounding($unitPriceByProductTaxExcl, $row['cart_quantity']);
|
||||
$row['total_wt'] += Tools::processPriceRounding($unitPriceByProductTaxIncl, $row['cart_quantity']);
|
||||
$row['total'] += Tools::processPriceRounding($price_tax_excl, $row['cart_quantity']);
|
||||
$row['total_wt'] += Tools::processPriceRounding($price_tax_incl, $row['cart_quantity']);
|
||||
|
||||
$row['price_wt'] = $row['price_with_reduction'];
|
||||
} else {
|
||||
$row['total'] = 0;
|
||||
$row['total_wt'] = 0;
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
$price_tax_excl = $objRoomTypeServiceProductCartDetail->getProducts($this->id, $row['id_product'], 0, null, 0, null, 0, 1, false);
|
||||
$price_tax_incl = $objRoomTypeServiceProductCartDetail->getProducts($this->id, $row['id_product'], 0, null, 0, null, 0, 1, true);
|
||||
// Rounding as per configurations
|
||||
$row['total'] += Tools::processPriceRounding($price_tax_excl, $row['cart_quantity']);
|
||||
$row['total_wt'] += Tools::processPriceRounding($price_tax_incl, $row['cart_quantity']);
|
||||
|
||||
$row['price_wt'] = $row['price_with_reduction'];
|
||||
}
|
||||
@@ -826,7 +838,7 @@ class CartCore extends ObjectModel
|
||||
$serviceProducts = array();
|
||||
$context = Context::getContext();
|
||||
foreach ($productList as $key => $product) {
|
||||
if (!$product['booking_product'] && (Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE == $product['service_product_type'])) {
|
||||
if (!$product['booking_product'] && (Product::SERVICE_PRODUCT_STANDALONE == $product['service_product_type'])) {
|
||||
if (Validate::isLoadedObject(
|
||||
$objProduct = new Product($product['id_product'], false, $this->id_lang)
|
||||
)) {
|
||||
@@ -1560,7 +1572,7 @@ class CartCore extends ObjectModel
|
||||
Cart::ONLY_ROOM_SERVICES_WITHOUT_AUTO_ADD,
|
||||
Cart::ONLY_ROOM_SERVICES_WITH_AUTO_ADD_WITHOUT_CONVENIENCE_FEE,
|
||||
Cart::ONLY_CONVENIENCE_FEE,
|
||||
Cart::ONLY_SERVICE_PRODUCTS,
|
||||
Cart::ONLY_STANDALONE_PRODUCTS,
|
||||
Cart::ONLY_DISCOUNTS,
|
||||
Cart::BOTH,
|
||||
Cart::BOTH_WITHOUT_SHIPPING,
|
||||
@@ -1635,7 +1647,6 @@ class CartCore extends ObjectModel
|
||||
if (Tax::excludeTaxeOption()) {
|
||||
$with_taxes = false;
|
||||
}
|
||||
|
||||
$products_total = array();
|
||||
$ecotax_total = 0;
|
||||
$totalDemandsPrice = 0;
|
||||
@@ -1644,7 +1655,7 @@ class CartCore extends ObjectModel
|
||||
// skip products if selection os for only room or only normal products
|
||||
if ($product['booking_product']) {
|
||||
if ($type == Cart::ONLY_ROOM_SERVICES
|
||||
|| $type == Cart::ONLY_SERVICE_PRODUCTS
|
||||
|| $type == Cart::ONLY_STANDALONE_PRODUCTS
|
||||
|| $type == Cart::ONLY_CONVENIENCE_FEE
|
||||
|| $type == Cart::ONLY_ROOM_SERVICES_WITHOUT_AUTO_ADD
|
||||
|| $type == Cart::ONLY_ROOM_SERVICES_WITHOUT_CONVENIENCE_FEE
|
||||
@@ -1658,7 +1669,7 @@ class CartCore extends ObjectModel
|
||||
}
|
||||
|
||||
if (Product::SERVICE_PRODUCT_WITH_ROOMTYPE == $product['service_product_type']) {
|
||||
if ($type == Cart::ONLY_SERVICE_PRODUCTS) {
|
||||
if ($type == Cart::ONLY_STANDALONE_PRODUCTS) {
|
||||
continue;
|
||||
}
|
||||
if ($product['auto_add_to_cart']) {
|
||||
@@ -1685,8 +1696,13 @@ class CartCore extends ObjectModel
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($type == Cart::ONLY_ROOM_SERVICES) {
|
||||
} elseif (Product::SERVICE_PRODUCT_STANDALONE == $product['service_product_type'] || Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL == $product['service_product_type']) {
|
||||
if ($type == Cart::ONLY_ROOM_SERVICES
|
||||
|| $type == Cart::ONLY_CONVENIENCE_FEE
|
||||
|| $type == Cart::ONLY_ROOM_SERVICES_WITHOUT_AUTO_ADD
|
||||
|| $type == Cart::ONLY_ROOM_SERVICES_WITHOUT_CONVENIENCE_FEE
|
||||
|| $type == Cart::ONLY_ROOM_SERVICES_WITH_AUTO_ADD_WITHOUT_CONVENIENCE_FEE
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -1742,10 +1758,48 @@ class CartCore extends ObjectModel
|
||||
} elseif (!isset($products_total[$id_tax_rules_group.'_'.$id_address])) {
|
||||
$products_total[$id_tax_rules_group.'_'.$id_address] = 0;
|
||||
}
|
||||
if (!$product['booking_product'] && Product::SERVICE_PRODUCT_STANDALONE == $product['service_product_type']) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
if ($servicePorducts = $objRoomTypeServiceProductCartDetail->getProducts(
|
||||
$this->id,
|
||||
(int)$product['id_product']
|
||||
)) {
|
||||
foreach ($servicePorducts as $servicePorduct) {
|
||||
if ($with_taxes) {
|
||||
$priceAdd = $servicePorduct['unit_price_tax_incl'];
|
||||
} else {
|
||||
$priceAdd = $servicePorduct['unit_price_tax_excl'];
|
||||
}
|
||||
if ($ps_round_type == Order::ROUND_TOTAL) {
|
||||
$products_total[$id_tax_rules_group.'_'.$id_address] += Tools::processPriceRounding($priceAdd, (int)$servicePorduct['quantity']);
|
||||
} else {
|
||||
$products_total[$id_tax_rules_group] += Tools::processPriceRounding($priceAdd, (int)$servicePorduct['quantity']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$product['booking_product'] && Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE == $product['service_product_type']) {
|
||||
$objHotelServiceProductCartDetail = new HotelServiceProductCartDetail();
|
||||
$price = $objHotelServiceProductCartDetail->getHotelProductUnitPrice($this->id, (int)$product['id_product'], 0, $with_taxes);
|
||||
} else if (!$product['booking_product'] && Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL == $product['service_product_type']) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
if ($servicePorducts = $objRoomTypeServiceProductCartDetail->getProducts(
|
||||
$this->id,
|
||||
(int)$product['id_product'],
|
||||
0,
|
||||
isset($product['id_hotel']) ? $product['id_hotel'] : 0
|
||||
)) {
|
||||
foreach ($servicePorducts as $servicePorduct) {
|
||||
if ($with_taxes) {
|
||||
$priceAdd = $servicePorduct['unit_price_tax_incl'];
|
||||
} else {
|
||||
$priceAdd = $servicePorduct['unit_price_tax_excl'];
|
||||
}
|
||||
|
||||
if ($ps_round_type == Order::ROUND_TOTAL) {
|
||||
$products_total[$id_tax_rules_group.'_'.$id_address] += Tools::processPriceRounding($priceAdd, (int)$servicePorduct['quantity']);
|
||||
} else {
|
||||
$products_total[$id_tax_rules_group] += Tools::processPriceRounding($priceAdd, (int)$servicePorduct['quantity']);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (!$product['booking_product'] && Product::SERVICE_PRODUCT_WITH_ROOMTYPE == $product['service_product_type']) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
if ($servicesWithRoom = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
|
||||
@@ -1871,7 +1925,7 @@ class CartCore extends ObjectModel
|
||||
Cart::ONLY_ROOMS,
|
||||
Cart::ADVANCE_PAYMENT_ONLY_PRODUCTS,
|
||||
Cart::ONLY_ROOM_SERVICES,
|
||||
Cart::ONLY_SERVICE_PRODUCTS,
|
||||
Cart::ONLY_STANDALONE_PRODUCTS,
|
||||
Cart::ONLY_CONVENIENCE_FEE,
|
||||
Cart::ONLY_ROOM_SERVICES_WITHOUT_AUTO_ADD,
|
||||
Cart::ONLY_ROOM_SERVICES_WITHOUT_CONVENIENCE_FEE,
|
||||
@@ -2295,10 +2349,10 @@ class CartCore extends ObjectModel
|
||||
// Step 6 : Break $package_list hotel wise
|
||||
$orderPackage = array();
|
||||
$serviceProducts = array();
|
||||
$standaloneProduct = array();
|
||||
$objRoomType = new HotelRoomType();
|
||||
$objHtlCartBookingData = new HotelCartBookingData();
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
$objHotelServiceProductCartDetail = new HotelServiceProductCartDetail();
|
||||
foreach ($final_package_list as $id_address => $packages) {
|
||||
foreach ($packages as $id_package => $package) {
|
||||
foreach ($package['product_list'] as $product) {
|
||||
@@ -2384,32 +2438,64 @@ class CartCore extends ObjectModel
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif (Product::SERVICE_PRODUCT_STANDALONE == $product['service_product_type']) {
|
||||
if (!isset($standaloneProduct[$id_address])) {
|
||||
$standaloneProduct[$id_address] = array(
|
||||
'product_list' => array(),
|
||||
'warehouse_list' => $package['warehouse_list'],
|
||||
'carrier_list' => $product['carrier_list'],
|
||||
'id_warehouse' => $package['id_warehouse'],
|
||||
'id_carrier' => isset($package['id_carrier']) ? $package['id_carrier'] : 0
|
||||
);
|
||||
}
|
||||
$standaloneProduct[$id_address]['product_list'][] = $product;
|
||||
} else {
|
||||
if ($selectedServiceProducts = $objHotelServiceProductCartDetail->getHotelProducts($this->id, $product
|
||||
['id_product'])) {
|
||||
if ($selectedServiceProducts = $objRoomTypeServiceProductCartDetail->getProducts($this->id, $product['id_product'])) {
|
||||
$array = array();
|
||||
foreach($selectedServiceProducts as $hotelProduct) {
|
||||
if (isset($array[$hotelProduct['id_hotel']])) {
|
||||
$array[$hotelProduct['id_hotel']]['total_price_tax_excl'] += $hotelProduct['total_price_tax_excl'];
|
||||
$array[$hotelProduct['id_hotel']]['total_price_tax_incl'] += $hotelProduct['total_price_tax_incl'];
|
||||
$array[$hotelProduct['id_hotel']]['quantity'] += $hotelProduct['quantity'];
|
||||
} else {
|
||||
$array[$hotelProduct['id_hotel']] = array(
|
||||
'quantity' => $hotelProduct['quantity'],
|
||||
'id_hotel' => $hotelProduct['id_hotel'],
|
||||
'total_price_tax_excl' => $hotelProduct['total_price_tax_excl'],
|
||||
'total_price_tax_incl' => $hotelProduct['total_price_tax_incl'],
|
||||
);
|
||||
}
|
||||
}
|
||||
foreach($array as $hotelProduct) {
|
||||
$serviceProduct = $product;
|
||||
$serviceProduct['cart_quantity'] = $hotelProduct['quantity'];
|
||||
$unitPrice = $objHotelServiceProductCartDetail->getHotelProductUnitPrice($this->id, $product['id_product'], $hotelProduct['id_hotel'], false);
|
||||
$unitPriceWt = $objHotelServiceProductCartDetail->getHotelProductUnitPrice($this->id, $product['id_product'], $hotelProduct['id_hotel'], true);
|
||||
$serviceProduct['total'] = $unitPrice * $hotelProduct['quantity'];
|
||||
$serviceProduct['total_wt'] = $unitPriceWt * $hotelProduct['quantity'];
|
||||
$serviceProduct['price'] = $unitPrice;
|
||||
$serviceProduct['price_wt'] = $unitPriceWt;
|
||||
$serviceProduct['id_hotel'] = $hotelProduct['id_hotel'];
|
||||
$serviceProduct['total'] = $hotelProduct['total_price_tax_excl'];
|
||||
$serviceProduct['total_wt'] = $hotelProduct['total_price_tax_incl'];
|
||||
$serviceProduct['price'] = $hotelProduct['total_price_tax_excl'] / $product['cart_quantity'];
|
||||
$serviceProduct['price_wt'] = $hotelProduct['total_price_tax_incl'] / $product['cart_quantity'];
|
||||
// if (!empty($hotelProducts['products'])) {
|
||||
// foreach($hotelProducts['products'] as $hotelProduct) {
|
||||
$serviceProducts[$id_address][$hotelProduct['id_hotel']] = array(
|
||||
'product_list' => array(
|
||||
$serviceProduct
|
||||
),
|
||||
'id_hotel' => $hotelProduct['id_hotel'],
|
||||
'warehouse_list' => $package['warehouse_list'],
|
||||
'carrier_list' => $product['carrier_list'],
|
||||
'id_warehouse' => $package['id_warehouse'],
|
||||
'id_carrier' => isset($package['id_carrier']) ? $package['id_carrier'] : 0
|
||||
);
|
||||
// }
|
||||
// }
|
||||
$orderPackage[$id_address][$hotelProduct['id_hotel']]['product_list'][] = $serviceProduct;
|
||||
if (!isset($orderPackage[$id_address][$hotelProduct['id_hotel']]['id_hotel'])) {
|
||||
$orderPackage[$id_address][$hotelProduct['id_hotel']]['id_hotel'] = $hotelProduct['id_hotel'];
|
||||
}
|
||||
if (!isset($orderPackage[$id_address][$hotelProduct['id_hotel']]['carrier_list'])) {
|
||||
$orderPackage[$id_address][$hotelProduct['id_hotel']]['carrier_list'] = $product['carrier_list'];
|
||||
} else {
|
||||
$orderPackage[$id_address][$hotelProduct['id_hotel']]['carrier_list'] = array_intersect($orderPackage[$id_address][$hotelProduct['id_hotel']]['carrier_list'], $product['carrier_list']);
|
||||
}
|
||||
if (!isset($orderPackage[$id_address][$hotelProduct['id_hotel']]['warehouse_list'])) {
|
||||
$orderPackage[$id_address][$hotelProduct['id_hotel']]['warehouse_list'] = $package['warehouse_list'];
|
||||
}
|
||||
if (!isset($orderPackage[$id_address][$hotelProduct['id_hotel']]['id_warehouse'])) {
|
||||
$orderPackage[$id_address][$hotelProduct['id_hotel']]['id_warehouse'] = $package['id_warehouse'];
|
||||
}
|
||||
if (isset($package['id_carrier'])) {
|
||||
if (!isset($orderPackage[$id_address][$hotelProduct['id_hotel']]['id_carrier'])) {
|
||||
$orderPackage[$id_address][$hotelProduct['id_hotel']]['id_carrier'] = $package['id_carrier'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2421,14 +2507,18 @@ class CartCore extends ObjectModel
|
||||
$hotelWisePackageList = array();
|
||||
$numHotels = 0;
|
||||
|
||||
|
||||
if (!empty($serviceProducts)) {
|
||||
foreach ($serviceProducts as $id_address => $packagesByHotels) {
|
||||
foreach ($packagesByHotels as $packageByHotel) {
|
||||
$hotelWisePackageList[$id_address][] = $packageByHotel;
|
||||
}
|
||||
if (!empty($standaloneProduct)) {
|
||||
foreach ($standaloneProduct as $id_address => $packagesByAddress) {
|
||||
$hotelWisePackageList[$id_address][] = $packagesByAddress;
|
||||
}
|
||||
}
|
||||
// if (!empty($serviceProducts)) {
|
||||
// foreach ($serviceProducts as $id_address => $packagesByHotels) {
|
||||
// foreach ($packagesByHotels as $packageByHotel) {
|
||||
// $hotelWisePackageList[$id_address][] = $packageByHotel;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
foreach ($orderPackage as $id_address => $packageByAddress) {
|
||||
$numHotels += count($packageByAddress);
|
||||
foreach ($packageByAddress as $id_package => $package) {
|
||||
@@ -3661,8 +3751,8 @@ class CartCore extends ObjectModel
|
||||
$convenience_fee_wt = $this->getOrderTotal(true, Cart::ONLY_CONVENIENCE_FEE);
|
||||
$convenience_fee = $this->getOrderTotal(false, Cart::ONLY_CONVENIENCE_FEE);
|
||||
$convenience_fee_tax = $convenience_fee_wt - $convenience_fee;
|
||||
$total_service_products_wt = $this->getOrderTotal(true, Cart::ONLY_SERVICE_PRODUCTS);
|
||||
$total_service_products = $this->getOrderTotal(false, Cart::ONLY_SERVICE_PRODUCTS);
|
||||
$total_standalone_service_products_wt = $this->getOrderTotal(true, Cart::ONLY_STANDALONE_PRODUCTS);
|
||||
$total_standalone_service_products = $this->getOrderTotal(false, Cart::ONLY_STANDALONE_PRODUCTS);
|
||||
$total_discounts = $this->getOrderTotal(true, Cart::ONLY_DISCOUNTS);
|
||||
$total_discounts_tax_exc = $this->getOrderTotal(false, Cart::ONLY_DISCOUNTS);
|
||||
$objCartBookingData = new HotelCartBookingData();
|
||||
@@ -3772,8 +3862,8 @@ class CartCore extends ObjectModel
|
||||
}
|
||||
|
||||
$objHotelAdvancedPayment = new HotelAdvancedPayment();
|
||||
$total_rooms_with_services_without_discount_te = $total_rooms + $total_demands + $total_additional_services + $total_additional_services_auto_add;
|
||||
$total_rooms_with_services_without_discount_ti = $total_rooms_wt + $total_demands_wt + $total_additional_services_wt + $total_additional_services_auto_add_wt;
|
||||
$total_rooms_with_services_without_discount_te = $total_rooms + $total_demands + $total_additional_services + $total_additional_services_auto_add + $total_standalone_service_products;
|
||||
$total_rooms_with_services_without_discount_ti = $total_rooms_wt + $total_demands_wt + $total_additional_services_wt + $total_additional_services_auto_add_wt + $total_standalone_service_products_wt;
|
||||
|
||||
$cart_total_without_discount_te = $total_rooms_with_services_without_discount_te + $convenience_fee;
|
||||
$cart_total_without_discount_ti = $total_rooms_with_services_without_discount_ti + $convenience_fee_wt;
|
||||
@@ -3809,8 +3899,8 @@ class CartCore extends ObjectModel
|
||||
'convenience_fee_wt' => $convenience_fee_wt,
|
||||
'convenience_fee' => $convenience_fee,
|
||||
'convenience_fee_tax' => $convenience_fee_tax,
|
||||
'total_service_products_wt' => $total_service_products_wt,
|
||||
'total_service_products' => $total_service_products,
|
||||
'total_standalone_service_products_wt' => $total_standalone_service_products_wt,
|
||||
'total_standalone_service_products' => $total_standalone_service_products,
|
||||
'total_extra_demands_wt' => $total_demands_wt,
|
||||
'total_extra_demands' => $total_demands,
|
||||
'total_price' => $base_total_tax_inc,
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
use Twig\Node\Expression\Binary\AddBinary;
|
||||
|
||||
abstract class PaymentModuleCore extends Module
|
||||
{
|
||||
const DEBUG_MODE = false;
|
||||
@@ -286,9 +288,19 @@ abstract class PaymentModuleCore extends Module
|
||||
$order->id_customer = (int)$this->context->cart->id_customer;
|
||||
$order->id_address_invoice = (int)$this->context->cart->id_address_invoice;
|
||||
$order->id_address_delivery = (int)$id_address;
|
||||
$addressInfo = HotelBranchInformation::getAddress($package['id_hotel']);
|
||||
if (isset($package['id_hotel']) && $package['id_hotel']) {
|
||||
$addressInfo = HotelBranchInformation::getAddress($package['id_hotel']);
|
||||
$order->id_address_tax = $addressInfo['id_address'];
|
||||
} else {
|
||||
$order->id_address_tax = $order->id_address_invoice;
|
||||
}
|
||||
|
||||
// $id_tax_rules_group = (int)Product::getIdTaxRulesGroupByIdProduct((int)11, $this->context);
|
||||
// $address = new Address($order->id_address_tax);
|
||||
// $tax_manager = TaxManagerFactory::getManager($address, $id_tax_rules_group);
|
||||
// // ddd($tax_manager);
|
||||
// ddd($tax_manager->getTaxCalculator());
|
||||
|
||||
$order->id_address_tax = $addressInfo['id_address'];
|
||||
$order->id_currency = $this->context->currency->id;
|
||||
$order->id_lang = (int)$this->context->cart->id_lang;
|
||||
$order->id_cart = (int)$this->context->cart->id;
|
||||
@@ -495,6 +507,7 @@ abstract class PaymentModuleCore extends Module
|
||||
// Make sure CartRule caches are empty
|
||||
CartRule::cleanCache();
|
||||
$objRoomType = new HotelRoomType();
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
$cart_rules = $this->context->cart->getCartRules();
|
||||
foreach ($order_detail_list as $key => $order_detail) {
|
||||
/** @var OrderDetail $order_detail */
|
||||
@@ -587,7 +600,12 @@ abstract class PaymentModuleCore extends Module
|
||||
$idHotel = $roomDetail['id_hotel'];
|
||||
}
|
||||
}
|
||||
if (!$product['booking_product'] && $product['service_product_type'] == Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE) {
|
||||
if (!$product['booking_product']
|
||||
&& (
|
||||
$product['service_product_type'] == Product::SERVICE_PRODUCT_STANDALONE
|
||||
|| $product['service_product_type'] == Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL
|
||||
)
|
||||
) {
|
||||
$cover_image_arr = $objProduct->getCover($product['id_product']);
|
||||
|
||||
if (!empty($cover_image_arr)) {
|
||||
@@ -596,7 +614,11 @@ abstract class PaymentModuleCore extends Module
|
||||
$cover_img = $this->context->link->getImageLink($product['link_rewrite'], $this->context->language->iso_code."-default", 'small_default');
|
||||
}
|
||||
$product_var_tpl['cover_img'] = $cover_img;
|
||||
$orderServiceProducts[] = $product_var_tpl;
|
||||
$serviceProducts = $objRoomTypeServiceProductCartDetail->getProducts($order->id_cart, $product['id_product']);
|
||||
|
||||
foreach ($serviceProducts as $serviceProduct) {
|
||||
$orderServiceProducts[] = array_merge($product_var_tpl, $serviceProduct);
|
||||
}
|
||||
}
|
||||
} // end foreach ($products)
|
||||
|
||||
@@ -727,7 +749,11 @@ abstract class PaymentModuleCore extends Module
|
||||
$maxOverbookingCount = 0;
|
||||
foreach ($order->product_list as $product) {
|
||||
$idProduct = $product['id_product'];
|
||||
$cartBookingData = $objCartBookingData->getOnlyCartBookingData($this->context->cart->id, $this->context->cart->id_guest, $idProduct);
|
||||
$cartBookingData = $objCartBookingData->getOnlyCartBookingData(
|
||||
$this->context->cart->id,
|
||||
$this->context->cart->id_guest,
|
||||
$idProduct
|
||||
);
|
||||
if ($cartBookingData) {
|
||||
foreach ($cartBookingData as $bookingInfo) {
|
||||
$objCartBookingData = new HotelCartBookingData($bookingInfo['id']);
|
||||
@@ -936,41 +962,95 @@ abstract class PaymentModuleCore extends Module
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
foreach($normalProducts as $product) {
|
||||
$idProduct = $product['id_product'];
|
||||
if ($cartAdditialServices = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
|
||||
$this->context->cart->id,
|
||||
$product['id_product'],
|
||||
isset($product['id_hotel']) ? $product['id_hotel'] : 0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
null,
|
||||
null
|
||||
)) {
|
||||
$idOrderDetail = $objBookingDetail->getPsOrderDetailIdByIdProduct($idProduct, $order->id);
|
||||
foreach ($cartAdditialServices as $additionalService) {
|
||||
$roomBookingDetail = $objBookingDetail->getRowByIdOrderIdProductInDateRange(
|
||||
$order->id,
|
||||
$additionalService['room_type_id_product'],
|
||||
$additionalService['date_from'],
|
||||
$additionalService['date_to'],
|
||||
$additionalService['id_room']
|
||||
);
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
$objRoomTypeServiceProductOrderDetail->id_product = $idProduct;
|
||||
$objRoomTypeServiceProductOrderDetail->id_order = $order->id;
|
||||
$objRoomTypeServiceProductOrderDetail->id_order_detail = $idOrderDetail;
|
||||
$objRoomTypeServiceProductOrderDetail->id_cart = $this->context->cart->id;
|
||||
$objRoomTypeServiceProductOrderDetail->id_htl_booking_detail = $roomBookingDetail['id'];
|
||||
$objRoomTypeServiceProductOrderDetail->unit_price_tax_excl = $additionalService['unit_price_tax_excl'];
|
||||
$objRoomTypeServiceProductOrderDetail->unit_price_tax_incl = $additionalService['unit_price_tax_incl'];
|
||||
$objRoomTypeServiceProductOrderDetail->total_price_tax_excl = $additionalService['total_price_tax_excl'];
|
||||
$objRoomTypeServiceProductOrderDetail->total_price_tax_incl = $additionalService['total_price_tax_incl'];
|
||||
$objRoomTypeServiceProductOrderDetail->name = $product['name'];
|
||||
$objRoomTypeServiceProductOrderDetail->quantity = $additionalService['quantity'];
|
||||
$objRoomTypeServiceProductOrderDetail->auto_added = $additionalService['auto_add_to_cart'];
|
||||
$objRoomTypeServiceProductOrderDetail->save();
|
||||
if (Product::SERVICE_PRODUCT_WITH_ROOMTYPE == $product['service_product_type']) {
|
||||
if ($cartAdditialServices = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
|
||||
$this->context->cart->id,
|
||||
$product['id_product'],
|
||||
isset($product['id_hotel']) ? $product['id_hotel'] : 0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
null,
|
||||
null
|
||||
)) {
|
||||
$idOrderDetail = $objBookingDetail->getPsOrderDetailIdByIdProduct($idProduct, $order->id);
|
||||
foreach ($cartAdditialServices as $additionalService) {
|
||||
$roomBookingDetail = $objBookingDetail->getRowByIdOrderIdProductInDateRange(
|
||||
$order->id,
|
||||
$additionalService['room_type_id_product'],
|
||||
$additionalService['date_from'],
|
||||
$additionalService['date_to'],
|
||||
$additionalService['id_room']
|
||||
);
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
$objRoomTypeServiceProductOrderDetail->id_product = $idProduct;
|
||||
$objRoomTypeServiceProductOrderDetail->id_order = $order->id;
|
||||
$objRoomTypeServiceProductOrderDetail->id_order_detail = $idOrderDetail;
|
||||
$objRoomTypeServiceProductOrderDetail->id_cart = $this->context->cart->id;
|
||||
$objRoomTypeServiceProductOrderDetail->id_htl_booking_detail = $roomBookingDetail['id'];
|
||||
$objRoomTypeServiceProductOrderDetail->unit_price_tax_excl = $additionalService['unit_price_tax_excl'];
|
||||
$objRoomTypeServiceProductOrderDetail->unit_price_tax_incl = $additionalService['unit_price_tax_incl'];
|
||||
$objRoomTypeServiceProductOrderDetail->total_price_tax_excl = $additionalService['total_price_tax_excl'];
|
||||
$objRoomTypeServiceProductOrderDetail->total_price_tax_incl = $additionalService['total_price_tax_incl'];
|
||||
$objRoomTypeServiceProductOrderDetail->name = $product['name'];
|
||||
$objRoomTypeServiceProductOrderDetail->quantity = $additionalService['quantity'];
|
||||
$objRoomTypeServiceProductOrderDetail->auto_added = $additionalService['auto_add_to_cart'];
|
||||
$objRoomTypeServiceProductOrderDetail->save();
|
||||
}
|
||||
}
|
||||
} elseif (Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL == $product['service_product_type']) {
|
||||
if ($hotelProducts = $objRoomTypeServiceProductCartDetail->getProducts(
|
||||
$this->context->cart->id,
|
||||
$product['id_product'],
|
||||
ProductCore::SERVICE_PRODUCT_lINKED_WITH_HOTEL,
|
||||
isset($product['id_hotel']) ? $product['id_hotel'] : 0
|
||||
)) {
|
||||
$idOrderDetail = $objBookingDetail->getPsOrderDetailIdByIdProduct($idProduct, $order->id);
|
||||
foreach ($hotelProducts as $hotelProduct) {
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
$objRoomTypeServiceProductOrderDetail->id_product = $idProduct;
|
||||
$objRoomTypeServiceProductOrderDetail->id_service_product_option = $hotelProduct['id_service_product_option'];
|
||||
$objRoomTypeServiceProductOrderDetail->id_order = $order->id;
|
||||
$objRoomTypeServiceProductOrderDetail->id_order_detail = $idOrderDetail;
|
||||
$objRoomTypeServiceProductOrderDetail->id_cart = $this->context->cart->id;
|
||||
$objRoomTypeServiceProductOrderDetail->id_hotel = $product['id_hotel'];
|
||||
$objRoomTypeServiceProductOrderDetail->unit_price_tax_excl = $hotelProduct['unit_price_tax_excl'];
|
||||
$objRoomTypeServiceProductOrderDetail->unit_price_tax_incl = $hotelProduct['unit_price_tax_incl'];
|
||||
$objRoomTypeServiceProductOrderDetail->total_price_tax_excl = $hotelProduct['total_price_tax_excl'];
|
||||
$objRoomTypeServiceProductOrderDetail->total_price_tax_incl = $hotelProduct['total_price_tax_incl'];
|
||||
$objRoomTypeServiceProductOrderDetail->name = $hotelProduct['name'];
|
||||
$objRoomTypeServiceProductOrderDetail->option_name = $hotelProduct['option_name'];
|
||||
$objRoomTypeServiceProductOrderDetail->quantity = $hotelProduct['quantity'];
|
||||
$objRoomTypeServiceProductOrderDetail->save();
|
||||
|
||||
}
|
||||
}
|
||||
} elseif (Product::SERVICE_PRODUCT_STANDALONE == $product['service_product_type']) {
|
||||
if ($standaloneProducts = $objRoomTypeServiceProductCartDetail->getProducts(
|
||||
$this->context->cart->id,
|
||||
$product['id_product'],
|
||||
ProductCore::SERVICE_PRODUCT_STANDALONE
|
||||
)) {
|
||||
$idOrderDetail = $objBookingDetail->getPsOrderDetailIdByIdProduct($idProduct, $order->id);
|
||||
foreach ($standaloneProducts as $standaloneProduct) {
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
$objRoomTypeServiceProductOrderDetail->id_product = $idProduct;
|
||||
$objRoomTypeServiceProductOrderDetail->id_service_product_option = $standaloneProduct['id_service_product_option'];
|
||||
$objRoomTypeServiceProductOrderDetail->id_order = $order->id;
|
||||
$objRoomTypeServiceProductOrderDetail->id_order_detail = $idOrderDetail;
|
||||
$objRoomTypeServiceProductOrderDetail->id_cart = $this->context->cart->id;
|
||||
$objRoomTypeServiceProductOrderDetail->unit_price_tax_excl = $standaloneProduct['unit_price_tax_excl'];
|
||||
$objRoomTypeServiceProductOrderDetail->unit_price_tax_incl = $standaloneProduct['unit_price_tax_incl'];
|
||||
$objRoomTypeServiceProductOrderDetail->total_price_tax_excl = $standaloneProduct['total_price_tax_excl'];
|
||||
$objRoomTypeServiceProductOrderDetail->total_price_tax_incl = $standaloneProduct['total_price_tax_incl'];
|
||||
$objRoomTypeServiceProductOrderDetail->name = $standaloneProduct['name'];
|
||||
$objRoomTypeServiceProductOrderDetail->option_name = $standaloneProduct['option_name'];
|
||||
$objRoomTypeServiceProductOrderDetail->quantity = $standaloneProduct['quantity'];
|
||||
$objRoomTypeServiceProductOrderDetail->save();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1076,9 +1156,8 @@ abstract class PaymentModuleCore extends Module
|
||||
|
||||
$extra_demands_details_html = $this->getEmailTemplateContent('booking_extra_demands.tpl', Mail::TYPE_HTML, $cart_booking_data['cart_htl_data']);
|
||||
$extra_demands_details_text = $this->getEmailTemplateContent('booking_extra_demands_text.tpl', Mail::TYPE_HTML, $cart_booking_data['cart_htl_data']);
|
||||
|
||||
$normal_products_data_html = $this->getEmailTemplateContent('hotel-service-product-data.tpl', Mail::TYPE_TEXT, $orderServiceProducts);
|
||||
$normal_products_data_txt = $this->getEmailTemplateContent('hotel-service-product-data-text.tpl', Mail::TYPE_TEXT, $orderServiceProducts);
|
||||
$normal_products_data_html = $this->getEmailTemplateContent('service-product-data.tpl', Mail::TYPE_TEXT, $orderServiceProducts);
|
||||
$normal_products_data_txt = $this->getEmailTemplateContent('service-product-data-text.tpl', Mail::TYPE_TEXT, $orderServiceProducts);
|
||||
|
||||
// total room price
|
||||
$room_price_tax_excl = $order->getTotalProductsWithoutTaxes(false, true) + $order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_WITH_ROOM);
|
||||
@@ -1096,9 +1175,9 @@ abstract class PaymentModuleCore extends Module
|
||||
$total_convenience_fee_tax = $total_convenience_fee_ti - $total_convenience_fee_te;
|
||||
|
||||
// service products
|
||||
// $service_products_price_tax_excl = $order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE);
|
||||
// $service_products_price_tax_incl = $order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE);
|
||||
// $service_products_tax = ($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE) - $order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE));
|
||||
// $service_products_price_tax_excl = $order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_STANDALONE);
|
||||
// $service_products_price_tax_incl = $order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_STANDALONE);
|
||||
// $service_products_tax = ($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_STANDALONE) - $order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_STANDALONE));
|
||||
$total_order_tax = $room_tax + $additional_service_tax + $total_convenience_fee_tax;
|
||||
|
||||
$idOrderHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id);
|
||||
|
||||
@@ -551,7 +551,8 @@ class ProductCore extends ObjectModel
|
||||
const PRICE_DISPALY_INDIVISUAL = 2;
|
||||
|
||||
const SERVICE_PRODUCT_WITH_ROOMTYPE = 1;
|
||||
const SERVICE_PRODUCT_WITHOUT_ROOMTYPE = 2;
|
||||
const SERVICE_PRODUCT_STANDALONE = 2;
|
||||
const SERVICE_PRODUCT_lINKED_WITH_HOTEL = 3;
|
||||
|
||||
const PRICE_ADDITION_TYPE_WITH_ROOM = 1;
|
||||
const PRICE_ADDITION_TYPE_INDEPENDENT = 2;
|
||||
@@ -931,6 +932,14 @@ class ProductCore extends ObjectModel
|
||||
), 'id_product = '.(int)$id_product);
|
||||
}
|
||||
|
||||
public static function getServiceProductType($id_product) {
|
||||
return Db::getInstance()->getValue(
|
||||
'SELECT p.`service_product_type`
|
||||
FROM `'._DB_PREFIX_.'product` p '.Shop::addSqlAssociation('product', 'p').'
|
||||
WHERE p.`id_product` = '.(int)$id_product
|
||||
);
|
||||
}
|
||||
|
||||
public static function getProductPriceCalculation($id_product) {
|
||||
return Db::getInstance()->getValue(
|
||||
'SELECT product_shop.`price_calculation_method`
|
||||
@@ -3100,6 +3109,10 @@ class ProductCore extends ObjectModel
|
||||
}
|
||||
}
|
||||
|
||||
if (is_null($id_customer) && Validate::isLoadedObject($context->customer)) {
|
||||
$id_customer = $context->customer->id;
|
||||
}
|
||||
|
||||
$id_currency = Validate::isLoadedObject($context->currency) ? (int)$context->currency->id : (int)Configuration::get('PS_CURRENCY_DEFAULT');
|
||||
|
||||
// retrieve address informations
|
||||
@@ -3112,6 +3125,14 @@ class ProductCore extends ObjectModel
|
||||
if ($id_product_roomtype) {
|
||||
// if room type is provided with product then we know that the service product price should be calculated accroding to roomt type
|
||||
$id_address = Cart::getIdAddressForTaxCalculation($id_product_roomtype);
|
||||
} else {
|
||||
if (Product::getServiceProductType($id_product) == ProductCore::SERVICE_PRODUCT_lINKED_WITH_HOTEL) {
|
||||
|
||||
} else {
|
||||
if (isset($id_customer)) {
|
||||
$id_address = (int)Address::getFirstCustomerAddressId($id_customer);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$id_address = Cart::getIdAddressForTaxCalculation($id_product);
|
||||
@@ -3140,10 +3161,6 @@ class ProductCore extends ObjectModel
|
||||
$usetax = false;
|
||||
}
|
||||
|
||||
if (is_null($id_customer) && Validate::isLoadedObject($context->customer)) {
|
||||
$id_customer = $context->customer->id;
|
||||
}
|
||||
|
||||
$return = Product::priceCalculation(
|
||||
$context->shop->id,
|
||||
$id_product,
|
||||
@@ -3220,6 +3237,13 @@ class ProductCore extends ObjectModel
|
||||
$id_customer = 0;
|
||||
}
|
||||
|
||||
if ($id_product_attribute) {
|
||||
$id_service_product_option = $id_product_attribute;
|
||||
$id_product_attribute = null;
|
||||
} else {
|
||||
$id_service_product_option = null;
|
||||
}
|
||||
|
||||
if ($id_product_attribute === null) {
|
||||
$id_product_attribute = Product::getDefaultAttribute($id_product);
|
||||
}
|
||||
@@ -3227,7 +3251,7 @@ class ProductCore extends ObjectModel
|
||||
$cache_id = (int)$id_product.'-'.(int)$id_shop.'-'.(int)$id_currency.'-'.(int)$id_country.'-'.$id_state.'-'.$zipcode.'-'.(int)$id_group.
|
||||
'-'.(int)$quantity.'-'.(int)$id_product_attribute.
|
||||
'-'.(int)$with_ecotax.'-'.(int)$id_customer.'-'.(int)$use_group_reduction.'-'.(int)$id_cart.'-'.(int)$real_quantity.
|
||||
'-'.($only_reduc?'1':'0').'-'.($use_reduc?'1':'0').'-'.($use_tax?'1':'0').'-'.(int)$decimals.'-'.($id_product_roomtype?(int)$id_product_roomtype:'0');
|
||||
'-'.($only_reduc?'1':'0').'-'.($use_reduc?'1':'0').'-'.($use_tax?'1':'0').'-'.(int)$decimals.'-'.($id_product_roomtype?(int)$id_product_roomtype:'0').'-'.($id_service_product_option?(int)$id_service_product_option:'0');
|
||||
|
||||
// reference parameter is filled before any returns
|
||||
$specific_price = SpecificPrice::getSpecificPrice(
|
||||
@@ -3253,6 +3277,9 @@ class ProductCore extends ObjectModel
|
||||
|
||||
// fetch price & attribute price
|
||||
$cache_id_2 = $id_product.'-'.$id_shop;
|
||||
if ($id_service_product_option) {
|
||||
$cache_id_2 .= '-'.$id_service_product_option;
|
||||
}
|
||||
if (!isset(self::$_pricesLevel2[$cache_id_2])) {
|
||||
$sql = new DbQuery();
|
||||
$sql->select('product_shop.`price`, product_shop.`ecotax`');
|
||||
@@ -3266,6 +3293,15 @@ class ProductCore extends ObjectModel
|
||||
$sql->select('0 as id_product_attribute');
|
||||
}
|
||||
|
||||
if (ServiceProductOption::productHasOptions($id_product)) {
|
||||
$sql->select('service_product_option.id_service_product_option, service_product_option.price_impact as option_impact_price');
|
||||
|
||||
if ($id_service_product_option) {
|
||||
$sql->leftJoin('service_product_option', 'service_product_option', '(service_product_option.id_product = p.id_product AND service_product_option.id_service_product_option = '.(int)$id_service_product_option.')');
|
||||
} else {
|
||||
$sql->leftJoin('service_product_option', 'service_product_option', '(service_product_option.id_product = p.id_product)');
|
||||
}
|
||||
}
|
||||
$res = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||
|
||||
if (is_array($res) && count($res)) {
|
||||
@@ -3275,11 +3311,19 @@ class ProductCore extends ObjectModel
|
||||
'ecotax' => $row['ecotax'],
|
||||
'attribute_price' => (isset($row['attribute_price']) ? $row['attribute_price'] : null)
|
||||
);
|
||||
if (isset($row['option_impact_price'])) {
|
||||
$array_tmp['option_impact_price'] = $row['option_impact_price'];
|
||||
$array_tmp['id_service_product_option'] = $row['id_service_product_option'];
|
||||
}
|
||||
|
||||
self::$_pricesLevel2[$cache_id_2][(int)$row['id_product_attribute']] = $array_tmp;
|
||||
|
||||
if (isset($row['default_on']) && $row['default_on'] == 1) {
|
||||
self::$_pricesLevel2[$cache_id_2][0] = $array_tmp;
|
||||
}
|
||||
if (isset($row['option_impact_price']) && !$id_service_product_option) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3309,6 +3353,10 @@ class ProductCore extends ObjectModel
|
||||
$price = (float)$specific_price['price'];
|
||||
}
|
||||
|
||||
if (isset($result['option_impact_price'])) {
|
||||
$price += (float)$result['option_impact_price'];
|
||||
}
|
||||
|
||||
// convert only if the specific price is in the default currency (id_currency = 0)
|
||||
if (!$specific_price || !($specific_price['price'] >= 0 && $specific_price['id_currency'])) {
|
||||
$price = Tools::convertPrice($price, $id_currency);
|
||||
@@ -4075,7 +4123,7 @@ class ProductCore extends ObjectModel
|
||||
* @param string $query Search query
|
||||
* @return array Matching products
|
||||
*/
|
||||
public static function searchByName($id_lang, $query, Context $context = null, $id_hotel = false)
|
||||
public static function searchByName($id_lang, $query, $booking_product = null, $service_product_type = null, $id_hotel = false, Context $context = null)
|
||||
{
|
||||
if (!$context) {
|
||||
$context = Context::getContext();
|
||||
@@ -4090,13 +4138,22 @@ class ProductCore extends ObjectModel
|
||||
AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl')
|
||||
);
|
||||
$sql->leftJoin('manufacturer', 'm', 'm.`id_manufacturer` = p.`id_manufacturer`');
|
||||
if ($id_hotel) {
|
||||
$sql->innerJoin(
|
||||
'htl_room_type',
|
||||
'hrt',
|
||||
'p.`id_product` = hrt.`id_product` AND hrt.`id_hotel` = '.(int)$id_hotel
|
||||
);
|
||||
|
||||
if ($booking_product) {
|
||||
if ($id_hotel) {
|
||||
$sql->innerJoin(
|
||||
'htl_room_type',
|
||||
'hrt',
|
||||
'p.`id_product` = hrt.`id_product` AND hrt.`id_hotel` = '.(int)$id_hotel
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL == $service_product_type && $id_hotel) {
|
||||
$sql->innerJoin(
|
||||
'htl_room_type_service_product',
|
||||
'hrtsp',
|
||||
'p.`id_product` = hrtsp.`id_product` AND hrtsp.`id_element` = '.(int)$id_hotel.' AND hrtsp.`element_type` = '.(int)RoomTypeServiceProduct::WK_ELEMENT_TYPE_HOTEL
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$where = 'pl.`name` LIKE \'%'.pSQL($query).'%\'
|
||||
|
||||
@@ -29,7 +29,7 @@ class CheckoutCustomerDetailsStepCore extends AbstractCheckoutStepCore
|
||||
public function handleRequest()
|
||||
{
|
||||
$idAddressDelivery = $this->context->cart->id_address_delivery;
|
||||
$objAddress = new Address($idAddressDelivery);
|
||||
// $objAddress = new Address($idAddressDelivery);
|
||||
if (Tools::getValue('proceed_to_customer_dtl')) {
|
||||
$this->step_is_reachable = 1;
|
||||
$this->step_is_current = 1;
|
||||
|
||||
@@ -1267,13 +1267,14 @@ class OrderCore extends ObjectModel
|
||||
*/
|
||||
public function isReturnable()
|
||||
{
|
||||
$objBookingDetail = new HotelBookingDetail();
|
||||
if ($bookingInfo = $objBookingDetail->getBookingDataByOrderId($this->id)) {
|
||||
$idHotel = reset($bookingInfo)['id_hotel'];
|
||||
$objHotelBranch = new HotelBranchInformation($idHotel);
|
||||
$vatAddress = new Address((int)$this->id_address_tax);
|
||||
if ($vatAddress->id_hotel) {
|
||||
$objHotelBranch = new HotelBranchInformation($vatAddress->id_hotel);
|
||||
|
||||
// check if global as well as hotel refund is allowed
|
||||
return (Configuration::get('WK_ORDER_REFUND_ALLOWED') && $objHotelBranch->active_refund);
|
||||
} else {
|
||||
return Configuration::get('WK_ORDER_REFUND_ALLOWED');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -2649,63 +2650,84 @@ class OrderCore extends ObjectModel
|
||||
*/
|
||||
public function hasCompletelyRefunded($action = 0, $includeCheckIn = 0)
|
||||
{
|
||||
$res = true;
|
||||
// check rooms in booking
|
||||
$objHotelBooking = new HotelBookingdetail();
|
||||
if ($orderBookings = $objHotelBooking->getOrderCurrentDataByOrderId($this->id)) {
|
||||
// If action is Order::ORDER_COMPLETE_REFUND_FLAG (for refunded) then we will check
|
||||
// that all rooms must be refunded and at least one booking is not cancelled
|
||||
if ($action == Order::ORDER_COMPLETE_REFUND_FLAG) {
|
||||
$uniqueRefundedBookings = array_unique(array_column($orderBookings, 'is_refunded'));
|
||||
if (count($uniqueRefundedBookings) == 1 && $uniqueRefundedBookings[0] == 1) {
|
||||
foreach ($orderBookings as $booking) {
|
||||
if ($booking['is_cancelled'] == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// If action is Order::ORDER_COMPLETE_CANCELLATION_FLAG (for cancelled) then we will check that all rooms must be cancelled
|
||||
} elseif ($action == Order::ORDER_COMPLETE_CANCELLATION_FLAG) {
|
||||
$uniqueRefundedBookings = array_unique(array_column($orderBookings, 'is_cancelled'));
|
||||
if (count($uniqueRefundedBookings) == 1 && $uniqueRefundedBookings[0] == 1) {
|
||||
return true;
|
||||
}
|
||||
// If action is Order::ORDER_COMPLETE_CANCELLATION_OR_REFUND_REQUEST_FLAG (for cancelled and refund requests) then we will check that all rooms are either cancelled or requested for refund
|
||||
} elseif ($action == Order::ORDER_COMPLETE_CANCELLATION_OR_REFUND_REQUEST_FLAG) {
|
||||
foreach ($orderBookings as $booking) {
|
||||
if (!$booking['is_refunded']) {
|
||||
// If booking refund request is created and request is completed but booking is not refunded then return false
|
||||
if ($bookingRefundDetail = OrderReturn::getOrdersReturnDetail($this->id, 0, $booking['id'])) {
|
||||
$bookingRefundDetail = reset($bookingRefundDetail);
|
||||
if ($bookingRefundDetail['refunded']) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
// Default process to check if order is fully refunded or cancelled or not
|
||||
} else {
|
||||
// if is_refunded is 1 means booking either is cancelled or refunded. So check all bookings must have is_refunded = 1
|
||||
$uniqueRefundedBookings = array_unique(array_column($orderBookings, 'is_refunded'));
|
||||
if (count($uniqueRefundedBookings) == 1 && $uniqueRefundedBookings[0] == 1) {
|
||||
return true;
|
||||
} elseif ($includeCheckIn) {
|
||||
foreach ($orderBookings as $booking) {
|
||||
if ($booking['is_refunded'] == 0
|
||||
&& !OrderReturn::getOrdersReturnDetail($this->id, 0, $booking['id'])
|
||||
&& $booking['id_status'] == HotelBookingDetail::STATUS_ALLOTED
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
$res = $res && $this->checkList($orderBookings, $action, $includeCheckIn);
|
||||
}
|
||||
|
||||
return false;
|
||||
// check hotel linked products
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
if ($hotelProducts = $objRoomTypeServiceProductOrderDetail->getProducts($this->id, 0, 0, Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL)) {
|
||||
$res = $res && $this->checkList($hotelProducts, $action, false);
|
||||
}
|
||||
|
||||
if ($standaloneProducts = $objRoomTypeServiceProductOrderDetail->getProducts($this->id, 0, 0, Product::SERVICE_PRODUCT_STANDALONE)) {
|
||||
$res = $res && $this->checkList($standaloneProducts, $action, false);
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function checkList($list, $action = 0, $includeCheckIn = 0) {
|
||||
// If action is Order::ORDER_COMPLETE_REFUND_FLAG (for refunded) then we will check
|
||||
// that all rooms must be refunded and at least one booking is not cancelled
|
||||
if ($action == Order::ORDER_COMPLETE_REFUND_FLAG) {
|
||||
$uniqueRefundedBookings = array_unique(array_column($list, 'is_refunded'));
|
||||
if (count($uniqueRefundedBookings) == 1 && $uniqueRefundedBookings[0] == 1) {
|
||||
foreach ($list as $booking) {
|
||||
if ($booking['is_cancelled'] == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// If action is Order::ORDER_COMPLETE_CANCELLATION_FLAG (for cancelled) then we will check that all rooms must be cancelled
|
||||
} elseif ($action == Order::ORDER_COMPLETE_CANCELLATION_FLAG) {
|
||||
$uniqueRefundedBookings = array_unique(array_column($list, 'is_cancelled'));
|
||||
if (count($uniqueRefundedBookings) == 1 && $uniqueRefundedBookings[0] == 1) {
|
||||
return true;
|
||||
}
|
||||
// If action is Order::ORDER_COMPLETE_CANCELLATION_OR_REFUND_REQUEST_FLAG (for cancelled and refund requests) then we will check that all rooms are either cancelled or requested for refund
|
||||
} elseif ($action == Order::ORDER_COMPLETE_CANCELLATION_OR_REFUND_REQUEST_FLAG) {
|
||||
foreach ($list as $product) {
|
||||
if (!$product['is_refunded']) {
|
||||
// If booking refund request is created and request is completed but booking is not refunded then return false
|
||||
if ($bookingRefundDetail = OrderReturn::getOrdersReturnDetail(
|
||||
$this->id,
|
||||
0,
|
||||
isset($product['id']) ? $product['id'] : 0,
|
||||
isset($product['id_room_type_service_product_order_detail']) ? $product['id_room_type_service_product_order_detail'] : 0,
|
||||
)) {
|
||||
$bookingRefundDetail = reset($bookingRefundDetail);
|
||||
if ($bookingRefundDetail['refunded']) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
// Default process to check if order is fully refunded or cancelled or not
|
||||
} else {
|
||||
// if is_refunded is 1 means booking either is cancelled or refunded. So check all bookings must have is_refunded = 1
|
||||
$uniqueRefundedBookings = array_unique(array_column($list, 'is_refunded'));
|
||||
if (count($uniqueRefundedBookings) == 1 && $uniqueRefundedBookings[0] == 1) {
|
||||
return true;
|
||||
} elseif ($includeCheckIn) {
|
||||
foreach ($list as $booking) {
|
||||
if ($booking['is_refunded'] == 0
|
||||
&& !OrderReturn::getOrdersReturnDetail($this->id, 0, isset($product['id']) ? $product['id'] : 0)
|
||||
&& $booking['id_status'] == HotelBookingDetail::STATUS_ALLOTED
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getWsBookings()
|
||||
|
||||
@@ -478,14 +478,16 @@ class OrderDetailCore extends ObjectModel
|
||||
/*
|
||||
*By webkul so that product quantity will not be decreased when product is ordered
|
||||
*/
|
||||
/*$update_quantity = true;
|
||||
if (!StockAvailable::dependsOnStock($product['id_product'])) {
|
||||
$update_quantity = StockAvailable::updateQuantity($product['id_product'], $product['id_product_attribute'], -(int)$product['cart_quantity']);
|
||||
}
|
||||
if (!$product['booking_product']) {
|
||||
$update_quantity = true;
|
||||
if (!StockAvailable::dependsOnStock($product['id_product'])) {
|
||||
$update_quantity = StockAvailable::updateQuantity($product['id_product'], $product['id_product_attribute'], -(int)$product['cart_quantity']);
|
||||
}
|
||||
|
||||
if ($update_quantity) {
|
||||
$product['stock_quantity'] -= $product['cart_quantity'];
|
||||
}*/
|
||||
if ($update_quantity) {
|
||||
$product['stock_quantity'] -= $product['cart_quantity'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($product['stock_quantity'] < 0 && Configuration::get('PS_STOCK_MANAGEMENT')) {
|
||||
$this->outOfStock = true;
|
||||
|
||||
@@ -618,9 +618,13 @@ class OrderInvoiceCore extends ObjectModel
|
||||
$breakdown = array();
|
||||
$order_detail = $this->getProducts();
|
||||
$order_detail = array_filter($order_detail, function($v) {
|
||||
return (!$v['is_booking_product'] && $v['product_service_type'] == Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE);
|
||||
return (!$v['is_booking_product'] && (
|
||||
$v['product_service_type'] == Product::SERVICE_PRODUCT_STANDALONE
|
||||
|| $v['product_service_type'] == Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL
|
||||
));
|
||||
});
|
||||
$details = $order->getProductTaxesDetails($order_detail, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE);
|
||||
|
||||
$details = $order->getProductTaxesDetails($order_detail, false);
|
||||
|
||||
if ($sum_composite_taxes) {
|
||||
$grouped_details = array();
|
||||
|
||||
@@ -189,8 +189,8 @@ class OrderReturnCore extends ObjectModel
|
||||
public function getOrderRefundRequestedBookings($idOrder, $idOrderReturn = 0, $onlyBookingIds = 0, $customerView = 0, $skipReqCompletedNonRefunded = 0)
|
||||
{
|
||||
$sql = 'SELECT hbd.*, ord.*, orr.`state` as id_return_state 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 .= ' INNER JOIN `'._DB_PREFIX_.'order_return_detail` ord ON (orr.`id_order_return` = ord.`id_order_return`)';
|
||||
$sql .= ' INNER JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd ON (hbd.`id` = ord.`id_htl_booking`)';
|
||||
$sql .= ' WHERE orr.`id_order` = '.(int)$idOrder;
|
||||
|
||||
if ($idOrderReturn) {
|
||||
@@ -309,6 +309,54 @@ class OrderReturnCore extends ObjectModel
|
||||
return $returnDetails;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get order refund request products
|
||||
*/
|
||||
public function getOrderRefundRequestedProducts($idOrder, $idOrderReturn = 0, $onlyIds = 0, $customerView = 0, $skipReqCompletedNonRefunded = 0)
|
||||
{
|
||||
$sql = 'SELECT spod.*, ord.*, orr.`state` as id_return_state FROM `'._DB_PREFIX_.'order_return` orr';
|
||||
$sql .= ' INNER JOIN `'._DB_PREFIX_.'order_return_detail` ord ON (orr.`id_order_return` = ord.`id_order_return`)';
|
||||
$sql .= ' INNER JOIN `'._DB_PREFIX_.'htl_room_type_service_product_order_detail` spod ON (spod.`id_room_type_service_product_order_detail` = ord.`id_room_type_service_product_order_detail`)';
|
||||
$sql .= ' WHERE orr.`id_order` = '.(int)$idOrder;
|
||||
|
||||
if ($idOrderReturn) {
|
||||
$sql .= ' AND ord.`id_order_return` = '.(int)$idOrderReturn;
|
||||
}
|
||||
if ($returnDetails = Db::getInstance()->executeS($sql)) {
|
||||
if ($customerView) {
|
||||
$returnsCustView = array();
|
||||
}
|
||||
$objOrder = new Order($idOrder);
|
||||
|
||||
foreach ($returnDetails as $key => &$product) {
|
||||
if ($skipReqCompletedNonRefunded) {
|
||||
$objReturnState = new OrderReturnState($product['id_return_state']);
|
||||
if ($objReturnState->refunded && !$product['is_refunded']) {
|
||||
unset($returnDetails[$key]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$product['paid_amount'] = 0;
|
||||
if ($product['total_price_tax_incl'] > 0) {
|
||||
if ($objOrder->total_paid_real > 0) {
|
||||
$product['paid_amount'] = ($objOrder->total_paid_real*$product['total_price_tax_incl'])/ ($objOrder->total_paid_tax_incl + $objOrder->total_discounts_tax_incl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($onlyIds) {
|
||||
return array_column($returnDetails, 'id_room_type_service_product_order_detail');
|
||||
}
|
||||
|
||||
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) {
|
||||
@@ -322,6 +370,8 @@ class OrderReturnCore extends ObjectModel
|
||||
ON (ord.`id_order_return` = orr.`id_order_return`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd
|
||||
ON (hbd.`id` = ord.`id_htl_booking`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product_order_detail` rtspod
|
||||
ON (rtspod.`id_room_type_service_product_order_detail` = ord.`id_room_type_service_product_order_detail`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_slip` ors
|
||||
ON (ors.`id_order_slip` = orr.`id_return_type` AND orr.`return_type` = '.(int) self::RETURN_TYPE_ORDER_SLIP.')
|
||||
WHERE orr.`id_customer` = '.(int)$customer_id.
|
||||
@@ -353,6 +403,7 @@ class OrderReturnCore extends ObjectModel
|
||||
$idOrder,
|
||||
$idOrderReturn = 0,
|
||||
$idHtlBooking = 0,
|
||||
$idServiceProductOrderOetail = 0,
|
||||
$idLang = 0,
|
||||
$orderByLatestRequest = 1
|
||||
) {
|
||||
@@ -373,6 +424,10 @@ class OrderReturnCore extends ObjectModel
|
||||
$sql .= ' AND ord.`id_htl_booking` = '.(int)$idHtlBooking;
|
||||
}
|
||||
|
||||
if ($idServiceProductOrderOetail) {
|
||||
$sql .= ' AND ord.`id_room_type_service_product_order_detail` = '.(int)$idServiceProductOrderOetail;
|
||||
}
|
||||
|
||||
if ($orderByLatestRequest) {
|
||||
$sql .= ' ORDER BY orr.`id_order_return` DESC';
|
||||
}
|
||||
|
||||
@@ -26,6 +26,9 @@ class OrderReturnDetailCore extends ObjectModel
|
||||
/** @var int */
|
||||
public $id_htl_booking;
|
||||
|
||||
/** @var int */
|
||||
public $id_room_type_service_product_order_detail;
|
||||
|
||||
/** @var float amount of the refund transaction */
|
||||
public $refunded_amount;
|
||||
|
||||
@@ -47,7 +50,8 @@ class OrderReturnDetailCore extends ObjectModel
|
||||
'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_htl_booking' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'id_room_type_service_product_order_detail' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'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),
|
||||
|
||||
@@ -183,13 +183,19 @@ class OrderSlipCore extends ObjectModel
|
||||
|
||||
$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 ($slipRow['id_htl_booking']) {
|
||||
$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;
|
||||
} else {
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail($slipRow['id_room_type_service_product_order_detail']);
|
||||
$slipRow['product_name'] = $objRoomTypeServiceProductOrderDetail->name;
|
||||
}
|
||||
|
||||
|
||||
if (isset($orderDetailCustom[$slipRow['id_order_detail']])) {
|
||||
$slipRow = array_merge($orderDetailCustom[$slipRow['id_order_detail']], $slipRow);
|
||||
@@ -304,7 +310,7 @@ class OrderSlipCore extends ObjectModel
|
||||
return OrderSlip::create($order, $product_list, $shipping);
|
||||
}
|
||||
|
||||
public static function create(Order $order, $booking_list, $shipping_cost = false, $amount = 0, $amount_choosen = false, $add_tax = true)
|
||||
public static function create(Order $order, $product_list, $shipping_cost = false, $amount = 0, $amount_choosen = false, $add_tax = true)
|
||||
{
|
||||
$currency = new Currency((int)$order->id_currency);
|
||||
$order_slip = new OrderSlip();
|
||||
@@ -347,25 +353,31 @@ class OrderSlipCore extends ObjectModel
|
||||
$order_slip->{'total_products_tax_'.$inc_or_ex_2} = 0;
|
||||
|
||||
$total_products = array();
|
||||
foreach ($booking_list as &$booking) {
|
||||
$objHtlBooking = new HotelBookingDetail($booking['id_htl_booking']);
|
||||
$order_detail = new OrderDetail((int)$objHtlBooking->id_order_detail);
|
||||
foreach ($product_list as &$product_row) {
|
||||
if (isset($product_row['id_htl_booking'])) {
|
||||
$objHtlBooking = new HotelBookingDetail($product_row['id_htl_booking']);
|
||||
$order_detail = new OrderDetail((int)$objHtlBooking->id_order_detail);
|
||||
$quantity = (int)$product_row['num_days'];
|
||||
} else if (isset($product_row['id_room_type_service_product_order_detail'])) {
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail($product_row['id_room_type_service_product_order_detail']);
|
||||
$order_detail = new OrderDetail((int)$objRoomTypeServiceProductOrderDetail->id_order_detail);
|
||||
$quantity = (int)$product_row['quantity'];
|
||||
}
|
||||
$price = (float)$product_row['unit_price'];
|
||||
|
||||
$price = (float)$booking['unit_price'];
|
||||
$numDays = (int)$booking['num_days'];
|
||||
|
||||
$order_slip_resume = OrderSlip::getProductSlipResume((int)$order_detail->id);
|
||||
|
||||
if ($numDays + $order_slip_resume['product_quantity'] > $order_detail->product_quantity) {
|
||||
$numDays = $order_detail->product_quantity - $order_slip_resume['product_quantity'];
|
||||
if ($quantity + $order_slip_resume['product_quantity'] > $order_detail->product_quantity) {
|
||||
$quantity = $order_detail->product_quantity - $order_slip_resume['product_quantity'];
|
||||
}
|
||||
|
||||
if ($numDays == 0) {
|
||||
if ($quantity == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!Tools::isSubmit('cancelProduct') && $order->hasBeenPaid()) {
|
||||
$order_detail->product_quantity_refunded += $numDays;
|
||||
$order_detail->product_quantity_refunded += $quantity;
|
||||
}
|
||||
|
||||
$address = Address::initialize($order->id_address_tax, false);
|
||||
@@ -385,7 +397,7 @@ class OrderSlipCore extends ObjectModel
|
||||
}
|
||||
|
||||
$product_tax_inc_or_ex_1 = Tools::processPriceRounding(
|
||||
($price * $numDays),
|
||||
($price * $quantity),
|
||||
1,
|
||||
$order->round_type,
|
||||
$order->round_mode
|
||||
@@ -394,7 +406,7 @@ class OrderSlipCore extends ObjectModel
|
||||
$order_slip->{'total_products_tax_'.$inc_or_ex_1} += $product_tax_inc_or_ex_1;
|
||||
|
||||
$product_tax_inc_or_ex_2 = Tools::processPriceRounding(
|
||||
($tax_calculator->{$add_or_remove.'Taxes'}($price * $numDays)),
|
||||
($tax_calculator->{$add_or_remove.'Taxes'}($price * $quantity)),
|
||||
1,
|
||||
$order->round_type,
|
||||
$order->round_mode
|
||||
@@ -405,10 +417,10 @@ class OrderSlipCore extends ObjectModel
|
||||
$total_products[$id_tax_rules_group] += $product_tax_inc_or_ex_2;
|
||||
}
|
||||
|
||||
$booking['unit_price_tax_'.$inc_or_ex_1] = $price;
|
||||
$booking['unit_price_tax_'.$inc_or_ex_2] = $tax_calculator->{$add_or_remove.'Taxes'}($price);
|
||||
$booking['total_price_tax_'.$inc_or_ex_1] = $product_tax_inc_or_ex_1;
|
||||
$booking['total_price_tax_'.$inc_or_ex_2] = $product_tax_inc_or_ex_2;
|
||||
$product_row['unit_price_tax_'.$inc_or_ex_1] = $price;
|
||||
$product_row['unit_price_tax_'.$inc_or_ex_2] = $tax_calculator->{$add_or_remove.'Taxes'}($price);
|
||||
$product_row['total_price_tax_'.$inc_or_ex_1] = $product_tax_inc_or_ex_1;
|
||||
$product_row['total_price_tax_'.$inc_or_ex_2] = $product_tax_inc_or_ex_2;
|
||||
}
|
||||
|
||||
foreach ($total_products as $key => $price) {
|
||||
@@ -441,26 +453,27 @@ class OrderSlipCore extends ObjectModel
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($booking_list as $bookingRow) {
|
||||
$order_slip->addProductOrderSlip($bookingRow);
|
||||
foreach ($product_list as $product_row) {
|
||||
$order_slip->addProductOrderSlip($product_row);
|
||||
}
|
||||
|
||||
return $order_slip->id;
|
||||
}
|
||||
|
||||
protected function addProductOrderSlip($booking)
|
||||
protected function addProductOrderSlip($product_row)
|
||||
{
|
||||
return Db::getInstance()->insert('order_slip_detail', array(
|
||||
'id_order_slip' => (int)$this->id,
|
||||
'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']
|
||||
'id_htl_booking' => isset($product_row['id_htl_booking']) ? (int)$product_row['id_htl_booking'] : 0,
|
||||
'id_room_type_service_product_order_detail' => isset($product_row['id_room_type_service_product_order_detail']) ? (int)$product_row['id_room_type_service_product_order_detail'] : 0,
|
||||
'id_order_detail' => (int)$product_row['id_order_detail'],
|
||||
'product_quantity' => $product_row['quantity'],
|
||||
'unit_price_tax_excl' => $product_row['unit_price_tax_excl'],
|
||||
'unit_price_tax_incl' => $product_row['unit_price_tax_incl'],
|
||||
'total_price_tax_excl' => $product_row['total_price_tax_excl'],
|
||||
'total_price_tax_incl' => $product_row['total_price_tax_incl'],
|
||||
'amount_tax_excl' => $product_row['total_price_tax_excl'],
|
||||
'amount_tax_incl' => $product_row['total_price_tax_incl']
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -541,8 +541,29 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
foreach ($cart_htl_data[$type_key]['date_diff'] as $key => &$value) {
|
||||
$value['avg_paid_unit_price_tax_excl'] = Tools::ps_round($value['avg_paid_unit_price_tax_excl'] / $value['num_rm'], 6);
|
||||
}
|
||||
} else if (Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE == $type_value['product_service_type']) {
|
||||
$service_product_data[$type_key] = $type_value;
|
||||
} else if (Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL == $type_value['product_service_type']
|
||||
|| Product::SERVICE_PRODUCT_STANDALONE == $type_value['product_service_type']
|
||||
) {
|
||||
$serviceProducts = $objRoomTypeServiceProductOrderDetail->getProducts($order_obj->id, $type_value['id_order_detail'], $type_value['product_id']);
|
||||
if ($taxes = OrderDetail::getTaxListStatic($type_value['id_order_detail'])) {
|
||||
$tax_temp = array();
|
||||
foreach ($taxes as $tax) {
|
||||
$obj = new Tax($tax['id_tax']);
|
||||
$tax_temp[] = sprintf($this->l('%1$s%2$s%%'), ($obj->rate + 0), '');
|
||||
}
|
||||
$order_detail_tax_label = implode(', ', $tax_temp);
|
||||
} else {
|
||||
$order_detail_tax_label = HTMLTemplateInvoice::l('No tax');
|
||||
}
|
||||
foreach ($serviceProducts as $serviceProduct) {
|
||||
if ($serviceProduct['id_hotel']) {
|
||||
$objHotel = new HotelBranchInformation($serviceProduct['id_hotel'], $order_obj->id_lang);
|
||||
$serviceProduct['hotel_name'] = $objHotel->hotel_name;
|
||||
}
|
||||
$serviceProduct = array_merge($type_value, $serviceProduct);
|
||||
$serviceProduct['order_detail_tax_label'] = $order_detail_tax_label;
|
||||
$service_product_data[] = $serviceProduct;
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($tax_temp);
|
||||
@@ -562,8 +583,8 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
if ($idsOrderDetail = array_column($order_details, 'id_order_detail')) {
|
||||
$footer['room_price_tax_excl'] = $this->order->getTotalProductsWithoutTaxes(false, true, null, null, null, $idsOrderDetail) + $this->order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_WITH_ROOM, $idsOrderDetail);
|
||||
$footer['room_price_tax_incl'] = $this->order->getTotalProductsWithTaxes(false, true, null, null, null, $idsOrderDetail) + $this->order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_WITH_ROOM, $idsOrderDetail);
|
||||
// $footer['service_products_price_tax_excl'] = $this->order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE);
|
||||
// $footer['service_products_price_tax_incl'] = $this->order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE);
|
||||
$footer['service_products_price_tax_excl'] = $this->order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_STANDALONE, false, false, $idsOrderDetail) + $this->order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL, false, false, $idsOrderDetail);
|
||||
$footer['service_products_price_tax_incl'] = $this->order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_STANDALONE, false, false, $idsOrderDetail) + $this->order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL, false, false, $idsOrderDetail);
|
||||
$footer['additional_service_price_tax_excl'] = $this->order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 0, null, $idsOrderDetail) + $totalDemandsPriceTE;
|
||||
$footer['additional_service_price_tax_incl'] = $this->order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 0, null, $idsOrderDetail) + $totalDemandsPriceTI;
|
||||
$footer['total_convenience_fee_te'] = $this->order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT, $idsOrderDetail);
|
||||
@@ -571,8 +592,8 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
}
|
||||
|
||||
$footer['total_paid_real'] = $this->order_invoice->getTotalPaid();
|
||||
$footer['total_without_discount_te'] = $footer['room_price_tax_excl'] + $footer['total_convenience_fee_te'] + $footer['additional_service_price_tax_excl'];
|
||||
$footer['total_without_discount_ti'] = $footer['room_price_tax_incl'] + $footer['total_convenience_fee_ti'] + $footer['additional_service_price_tax_incl'];
|
||||
$footer['total_without_discount_te'] = $footer['room_price_tax_excl'] + $footer['total_convenience_fee_te'] + $footer['additional_service_price_tax_excl'] + $footer['service_products_price_tax_excl'];
|
||||
$footer['total_without_discount_ti'] = $footer['room_price_tax_incl'] + $footer['total_convenience_fee_ti'] + $footer['additional_service_price_tax_incl'] + $footer['service_products_price_tax_incl'];
|
||||
$footer['total_tax_without_discount'] = $footer['total_without_discount_ti'] - $footer['total_without_discount_te'];
|
||||
if ($footer['total_tax_without_discount'] < 0) {
|
||||
$footer['total_tax_without_discount'] = 0;
|
||||
|
||||
@@ -90,7 +90,8 @@ class HTMLTemplateOrderSlipCore extends HTMLTemplateInvoice
|
||||
|
||||
$customer = new Customer((int)$this->order->id_customer);
|
||||
$this->order->total_paid_tax_excl = $this->order->total_paid_tax_incl = $this->order->total_products = $this->order->total_products_wt = 0;
|
||||
|
||||
$roomsDetails = array();
|
||||
$productsDetails = array();
|
||||
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'];
|
||||
@@ -101,9 +102,10 @@ class HTMLTemplateOrderSlipCore extends HTMLTemplateInvoice
|
||||
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_htl_booking` = '.(int)$product['id_htl_booking']);
|
||||
AND `id_htl_booking` = '.(int)$product['id_htl_booking'].'
|
||||
AND `id_room_type_service_product_order_detail` = '.(int)$product['id_room_type_service_product_order_detail']);
|
||||
|
||||
$product['total_price_tax_excl'] = $order_slip_detail['amount_tax_excl'];
|
||||
$product['total_price_tax_excl'] = $order_slip_detail['amount_tax_excl'];
|
||||
$product['total_price_tax_incl'] = $order_slip_detail['amount_tax_incl'];
|
||||
}
|
||||
|
||||
@@ -111,6 +113,12 @@ class HTMLTemplateOrderSlipCore extends HTMLTemplateInvoice
|
||||
$this->order->total_products_wt += $product['total_price_tax_incl'];
|
||||
$this->order->total_paid_tax_excl = $this->order->total_products;
|
||||
$this->order->total_paid_tax_incl = $this->order->total_products_wt;
|
||||
|
||||
if ($product['id_htl_booking']) {
|
||||
$roomsDetails[] = $product;
|
||||
} else {
|
||||
$productsDetails[] = $product;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->order->products = null;
|
||||
@@ -144,10 +152,13 @@ class HTMLTemplateOrderSlipCore extends HTMLTemplateInvoice
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->smarty->assign(array(
|
||||
'order' => $this->order,
|
||||
'order_slip' => $this->order_slip,
|
||||
'order_details' => $this->order->products,
|
||||
'roomsDetails' => $roomsDetails,
|
||||
'productsDetails' => $productsDetails,
|
||||
'cart_rules' => $this->order_slip->order_slip_type == 1 ? $this->order->getCartRules($this->order_invoice->id) : false,
|
||||
'amount_choosen' => $this->order_slip->order_slip_type == 2 ? true : false,
|
||||
'delivery_address' => $formatted_delivery_address,
|
||||
|
||||
@@ -1842,8 +1842,8 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
|
||||
// Checking if the auto add service was sent in the request
|
||||
if (!isset($this->wsRequestedRoomTypes[$dateRoomJoinKey]['services'][$service['id_product']])
|
||||
&& ($idRoomTypeServiceProductCartDetail = $objRoomTypeServiceProductCartDetail->alreadyExists(
|
||||
$service['id_product'],
|
||||
$this->context->cart->id,
|
||||
$service['id_product'],
|
||||
$serviceProduct['htl_cart_booking_id'])
|
||||
)) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail((int) $idRoomTypeServiceProductCartDetail);
|
||||
@@ -3092,9 +3092,10 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
|
||||
$services = $formattedServices;
|
||||
foreach ($services as $service) {
|
||||
$objRoomTypeServiceProductCartDetail->addServiceProductInCart(
|
||||
$objCart->id,
|
||||
$service['id_product'],
|
||||
$service['quantity'],
|
||||
$objCart->id,
|
||||
false,
|
||||
$roomHtlCartInfo['id']
|
||||
);
|
||||
}
|
||||
@@ -3105,8 +3106,8 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
|
||||
$objOrderDetail->createList($objOrder, $objCart, $objOrder->getCurrentOrderState(), $productList, 0, true);
|
||||
foreach ($productList as &$product) {
|
||||
if ($idRoomTypeServiceProductCartDetail = $objRoomTypeServiceProductCartDetail->alreadyExists(
|
||||
$product['id_product'],
|
||||
$objCart->id,
|
||||
$product['id_product'],
|
||||
$roomHtlCartInfo['id'])
|
||||
) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail((int) $idRoomTypeServiceProductCartDetail);
|
||||
|
||||
@@ -1061,6 +1061,20 @@ class AdminCartsControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public function ajaxProcessUpdateProductQuantity()
|
||||
{
|
||||
$params = Tools::getValue('params');
|
||||
$idProduct = (int) $params['id_product'];
|
||||
|
||||
$idCart = (int) $params['id_cart'];
|
||||
$this->context->cart = new Cart($idCart);
|
||||
if ($this->tabAccess['edit'] === '1') {
|
||||
|
||||
$id_hotel_service_product_cart_detail = (int) $params['id_hotel_service_product_cart_detail'];
|
||||
$product = new Product($idProduct, true, $this->context->language->id);
|
||||
}
|
||||
}
|
||||
|
||||
// Process to get extra demands of any room while order creation process form.tpl
|
||||
public function ajaxProcessGetRoomTypeCartDemands()
|
||||
{
|
||||
|
||||
@@ -102,6 +102,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
// 'Seo' => $this->l('SEO'),
|
||||
'Images' => $this->l('Images'),
|
||||
'Associations' => $this->l('Associations'),
|
||||
// 'Quantities' => $this->l('Quantities'),
|
||||
);
|
||||
|
||||
if ($this->context->shop->getContext() != Shop::CONTEXT_GROUP) {
|
||||
@@ -111,6 +112,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
// 'Seo' => 2,
|
||||
'Associations' => 3,
|
||||
'Images' => 4,
|
||||
// 'Quantities' => 5,
|
||||
));
|
||||
}
|
||||
|
||||
@@ -207,6 +209,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
|
||||
// show the list of the product according to the booking or service products
|
||||
$this->_where .= ' AND a.`booking_product` = 0';
|
||||
$this->_where .= ' AND a.`service_product_type` = '.(int)ProductCore::SERVICE_PRODUCT_WITH_ROOMTYPE;
|
||||
|
||||
$this->_group = 'GROUP BY a.`id_product`';
|
||||
|
||||
@@ -291,7 +294,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
);
|
||||
// $serviceProductType = array(
|
||||
// Product::SERVICE_PRODUCT_WITH_ROOMTYPE => $this->l('Bought with room type'),
|
||||
// Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE => $this->l('Bought without room type')
|
||||
// Product::SERVICE_PRODUCT_STANDALONE => $this->l('Bought without room type')
|
||||
// );
|
||||
// $this->fields_list['service_product_type'] = array(
|
||||
// 'type' => 'select',
|
||||
@@ -358,7 +361,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
{
|
||||
if ($service_product_type == Product::SERVICE_PRODUCT_WITH_ROOMTYPE) {
|
||||
return $this->l('With room type');
|
||||
} else if ($service_product_type == Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE) {
|
||||
} else if ($service_product_type == Product::SERVICE_PRODUCT_STANDALONE) {
|
||||
return $this->l('Without room type');
|
||||
}
|
||||
|
||||
@@ -1822,8 +1825,8 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
$_POST['allow_multiple_quantity'] = 0;
|
||||
}
|
||||
|
||||
$_POST['service_product_type'] = Product::SERVICE_PRODUCT_WITH_ROOMTYPE;
|
||||
$this->copyFromPost($this->object, $this->table);
|
||||
$this->object->service_product_type = Product::SERVICE_PRODUCT_WITH_ROOMTYPE;
|
||||
|
||||
|
||||
// set product visibility to none for current flow.
|
||||
@@ -1967,6 +1970,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
if (Validate::isLoadedObject($object)) {
|
||||
$this->_removeTaxFromEcotax();
|
||||
$product_type_before = $object->getType();
|
||||
$_POST['service_product_type'] = Product::SERVICE_PRODUCT_WITH_ROOMTYPE;
|
||||
$this->copyFromPost($object, $this->table);
|
||||
$object->indexed = 0;
|
||||
|
||||
@@ -2878,8 +2882,9 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
{
|
||||
if (Validate::isLoadedObject($product)) {
|
||||
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
|
||||
$associatedRoomTypes = $objRoomTypeServiceProduct->getAssociatedHotelsAndRoomType($product->id)['room_type'];
|
||||
$allAssociations = $objRoomTypeServiceProduct->getAssociatedHotelsAndRoomType($product->id);
|
||||
if (Product::SERVICE_PRODUCT_WITH_ROOMTYPE == $product->service_product_type) {
|
||||
$associatedRoomTypes = $allAssociations['room_type'];
|
||||
$selectedRoomTypes = Tools::getValue('room_type_box');
|
||||
|
||||
// Generate list of new associations
|
||||
@@ -2915,15 +2920,55 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE
|
||||
);
|
||||
}
|
||||
} else {
|
||||
RoomTypeServiceProduct::deleteRoomProductLink(
|
||||
$product->id,
|
||||
RoomTypeServiceProduct::WK_ELEMENT_TYPE_HOTEL
|
||||
);
|
||||
} elseif (Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL == $product->service_product_type) {
|
||||
$associatedHotels = $allAssociations['hotel'];
|
||||
$selectedHotel = Tools::getValue('hotel_box');
|
||||
// Generate list of new associations
|
||||
$newHotels = array();
|
||||
foreach ($selectedHotel as $selectedRoomType) {
|
||||
if (!in_array($selectedRoomType, $associatedHotels)) {
|
||||
$newHotels[] = $selectedRoomType;
|
||||
}
|
||||
}
|
||||
|
||||
// Generate list of associations to remove
|
||||
$removedHotels = array();
|
||||
foreach ($associatedHotels as $associatedRoomType) {
|
||||
if (!in_array($associatedRoomType, $selectedHotel)) {
|
||||
$removedHotels[] = $associatedRoomType;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove associations
|
||||
foreach ($associatedRoomTypes as $associatedRoomType) {
|
||||
foreach ($removedHotels as $removedHotel) {
|
||||
RoomTypeServiceProduct::deleteRoomProductLink(
|
||||
$product->id,
|
||||
RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE,
|
||||
$associatedRoomType
|
||||
RoomTypeServiceProduct::WK_ELEMENT_TYPE_HOTEL,
|
||||
$removedHotel
|
||||
);
|
||||
}
|
||||
|
||||
// Save new associations
|
||||
if ($newHotels) {
|
||||
$objRoomTypeServiceProduct->addRoomProductLink(
|
||||
$product->id,
|
||||
$newHotels,
|
||||
RoomTypeServiceProduct::WK_ELEMENT_TYPE_HOTEL
|
||||
);
|
||||
}
|
||||
RoomTypeServiceProduct::deleteRoomProductLink(
|
||||
$product->id,
|
||||
RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE
|
||||
);
|
||||
} else {
|
||||
// Remove associations
|
||||
RoomTypeServiceProduct::deleteRoomProductLink(
|
||||
$product->id
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3190,6 +3235,160 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
$this->tpl_form_vars['custom_form'] = $data->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Product $obj
|
||||
* @throws Exception
|
||||
* @throws SmartyException
|
||||
*/
|
||||
public function initFormQuantities($obj)
|
||||
{
|
||||
if (!$this->default_form_language) {
|
||||
$this->getLanguages();
|
||||
}
|
||||
|
||||
$data = $this->createTemplate($this->tpl_form);
|
||||
$data->assign('default_form_language', $this->default_form_language);
|
||||
|
||||
if ($obj->id) {
|
||||
if ($this->product_exists_in_shop) {
|
||||
// Get all id_product_attribute
|
||||
$attributes = $obj->getAttributesResume($this->context->language->id);
|
||||
if (empty($attributes)) {
|
||||
$attributes[] = array(
|
||||
'id_product_attribute' => 0,
|
||||
'attribute_designation' => ''
|
||||
);
|
||||
}
|
||||
|
||||
// Get available quantities
|
||||
$available_quantity = array();
|
||||
$product_designation = array();
|
||||
|
||||
foreach ($attributes as $attribute) {
|
||||
// Get available quantity for the current product attribute in the current shop
|
||||
$available_quantity[$attribute['id_product_attribute']] = isset($attribute['id_product_attribute']) && $attribute['id_product_attribute'] ? (int)$attribute['quantity'] : (int)$obj->quantity;
|
||||
// Get all product designation
|
||||
$product_designation[$attribute['id_product_attribute']] = rtrim(
|
||||
$obj->name[$this->context->language->id].' - '.$attribute['attribute_designation'],
|
||||
' - '
|
||||
);
|
||||
}
|
||||
|
||||
$show_quantities = true;
|
||||
$shop_context = Shop::getContext();
|
||||
$shop_group = new ShopGroup((int)Shop::getContextShopGroupID());
|
||||
|
||||
// if we are in all shops context, it's not possible to manage quantities at this level
|
||||
if (Shop::isFeatureActive() && $shop_context == Shop::CONTEXT_ALL) {
|
||||
$show_quantities = false;
|
||||
}
|
||||
// if we are in group shop context
|
||||
elseif (Shop::isFeatureActive() && $shop_context == Shop::CONTEXT_GROUP) {
|
||||
// if quantities are not shared between shops of the group, it's not possible to manage them at group level
|
||||
if (!$shop_group->share_stock) {
|
||||
$show_quantities = false;
|
||||
}
|
||||
}
|
||||
// if we are in shop context
|
||||
elseif (Shop::isFeatureActive()) {
|
||||
// if quantities are shared between shops of the group, it's not possible to manage them for a given shop
|
||||
if ($shop_group->share_stock) {
|
||||
$show_quantities = false;
|
||||
}
|
||||
}
|
||||
|
||||
$data->assign('ps_stock_management', Configuration::get('PS_STOCK_MANAGEMENT'));
|
||||
$data->assign('has_attribute', $obj->hasAttributes());
|
||||
// Check if product has combination, to display the available date only for the product or for each combination
|
||||
if (Combination::isFeatureActive()) {
|
||||
$data->assign('countAttributes', (int)Db::getInstance()->getValue('SELECT COUNT(id_product) FROM '._DB_PREFIX_.'product_attribute WHERE id_product = '.(int)$obj->id));
|
||||
} else {
|
||||
$data->assign('countAttributes', false);
|
||||
}
|
||||
// if advanced stock management is active, checks associations
|
||||
$advanced_stock_management_warning = false;
|
||||
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && $obj->advanced_stock_management) {
|
||||
$p_attributes = Product::getProductAttributesIds($obj->id);
|
||||
$warehouses = array();
|
||||
|
||||
if (!$p_attributes) {
|
||||
$warehouses[] = Warehouse::getProductWarehouseList($obj->id, 0);
|
||||
}
|
||||
|
||||
foreach ($p_attributes as $p_attribute) {
|
||||
$ws = Warehouse::getProductWarehouseList($obj->id, $p_attribute['id_product_attribute']);
|
||||
if ($ws) {
|
||||
$warehouses[] = $ws;
|
||||
}
|
||||
}
|
||||
$warehouses = Tools::arrayUnique($warehouses);
|
||||
|
||||
if (empty($warehouses)) {
|
||||
$advanced_stock_management_warning = true;
|
||||
}
|
||||
}
|
||||
if ($advanced_stock_management_warning) {
|
||||
$this->displayWarning($this->l('If you wish to use the advanced stock management, you must:'));
|
||||
$this->displayWarning('- '.$this->l('associate your room types with warehouses.'));
|
||||
$this->displayWarning('- '.$this->l('associate your warehouses with carriers.'));
|
||||
$this->displayWarning('- '.$this->l('associate your warehouses with the appropriate shops.'));
|
||||
}
|
||||
|
||||
$pack_quantity = null;
|
||||
// if product is a pack
|
||||
if (Pack::isPack($obj->id)) {
|
||||
$items = Pack::getItems((int)$obj->id, Configuration::get('PS_LANG_DEFAULT'));
|
||||
|
||||
// gets an array of quantities (quantity for the product / quantity in pack)
|
||||
$pack_quantities = array();
|
||||
foreach ($items as $item) {
|
||||
/** @var Product $item */
|
||||
if (!$item->isAvailableWhenOutOfStock((int)$item->out_of_stock)) {
|
||||
$pack_id_product_attribute = Product::getDefaultAttribute($item->id, 1);
|
||||
$pack_quantities[] = Product::getQuantity($item->id, $pack_id_product_attribute) / ($item->pack_quantity !== 0 ? $item->pack_quantity : 1);
|
||||
}
|
||||
}
|
||||
|
||||
// gets the minimum
|
||||
if (count($pack_quantities)) {
|
||||
$pack_quantity = $pack_quantities[0];
|
||||
foreach ($pack_quantities as $value) {
|
||||
if ($pack_quantity > $value) {
|
||||
$pack_quantity = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && !Warehouse::getPackWarehouses((int)$obj->id)) {
|
||||
$this->displayWarning($this->l('You must have a common warehouse between this pack and its room type.'));
|
||||
}
|
||||
}
|
||||
|
||||
$data->assign(array(
|
||||
'attributes' => $attributes,
|
||||
'available_quantity' => $available_quantity,
|
||||
'pack_quantity' => $pack_quantity,
|
||||
'stock_management_active' => Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'),
|
||||
'product_designation' => $product_designation,
|
||||
'product' => $obj,
|
||||
'show_quantities' => $show_quantities,
|
||||
'order_out_of_stock' => Configuration::get('PS_ORDER_OUT_OF_STOCK'),
|
||||
'pack_stock_type' => Configuration::get('PS_PACK_STOCK_TYPE'),
|
||||
'token_preferences' => Tools::getAdminTokenLite('AdminPPreferences'),
|
||||
'token' => $this->token,
|
||||
'languages' => $this->_languages,
|
||||
'id_lang' => $this->context->language->id
|
||||
));
|
||||
} else {
|
||||
$this->displayWarning($this->l('You must save the room type in this shop before managing quantities.'));
|
||||
}
|
||||
} else {
|
||||
$this->displayWarning($this->l('You must save this room type before managing quantities.'));
|
||||
}
|
||||
|
||||
$this->tpl_form_vars['custom_form'] = $data->fetch();
|
||||
}
|
||||
|
||||
protected function _getFinalPrice($specific_price, $product_price, $tax_rate)
|
||||
{
|
||||
return $this->object->getPrice(false, $specific_price['id_product_attribute'], 2);
|
||||
@@ -3503,7 +3702,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
|
||||
$selectedElements = $objRoomTypeServiceProduct->getAssociatedHotelsAndRoomType($product->id);
|
||||
|
||||
$tree = new HelperTree('hotels-tree');
|
||||
$tree = new HelperTree('hotels-room-tree');
|
||||
$tree->setData(HotelHelper::generateTreeData([
|
||||
'rootNode' => HotelHelper::NODE_HOTEL,
|
||||
'leafNode' => HotelHelper::NODE_ROOM_TYPE,
|
||||
@@ -3513,6 +3712,18 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
->setAutoSelectChildren(true)
|
||||
->setUseBulkActions(true)
|
||||
->setUseSearch(true);
|
||||
$data->assign('hotel_room_tree', $tree->render());
|
||||
|
||||
$tree = new HelperTree('hotels-tree');
|
||||
$tree->setData(HotelHelper::generateTreeData([
|
||||
'rootNode' => HotelHelper::NODE_HOTEL,
|
||||
'leafNode' => HotelHelper::NODE_HOTEL,
|
||||
'selectedElements' => $selectedElements
|
||||
]))
|
||||
->setUseCheckBox(true)
|
||||
->setAutoSelectChildren(true)
|
||||
->setUseBulkActions(true)
|
||||
->setUseSearch(true);
|
||||
$data->assign('hotel_tree', $tree->render());
|
||||
|
||||
// TinyMCE
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -340,80 +340,80 @@ class AdminPPreferencesControllerCore extends AdminController
|
||||
),
|
||||
'submit' => array('title' => $this->l('Save'))
|
||||
),
|
||||
// 'stock' => array(
|
||||
// 'title' => $this->l('Products stock'),
|
||||
// 'fields' => array(
|
||||
// 'PS_ORDER_OUT_OF_STOCK' => array(
|
||||
// 'title' => $this->l('Allow ordering of out-of-stock products'),
|
||||
// 'hint' => $this->l('By default, the Add to Cart button is hidden when a product is unavailable. You can choose to have it displayed in all cases.'),
|
||||
// 'validation' => 'isBool',
|
||||
// 'cast' => 'intval',
|
||||
// 'required' => false,
|
||||
// 'type' => 'bool'
|
||||
// ),
|
||||
// 'PS_STOCK_MANAGEMENT' => array(
|
||||
// 'title' => $this->l('Enable stock management'),
|
||||
// 'validation' => 'isBool',
|
||||
// 'cast' => 'intval',
|
||||
// 'required' => false,
|
||||
// 'type' => 'bool',
|
||||
// 'js' => array(
|
||||
// 'on' => 'onchange="stockManagementActivationAuthorization()"',
|
||||
// 'off' => 'onchange="stockManagementActivationAuthorization()"'
|
||||
// )
|
||||
// ),
|
||||
// 'PS_ADVANCED_STOCK_MANAGEMENT' => array(
|
||||
// 'title' => $this->l('Enable advanced stock management'),
|
||||
// 'hint' => $this->l('Allows you to manage physical stock, warehouses and supply orders in a new Stock menu.'),
|
||||
// 'validation' => 'isBool',
|
||||
// 'cast' => 'intval',
|
||||
// 'required' => false,
|
||||
// 'type' => 'bool',
|
||||
// 'visibility' => Shop::CONTEXT_ALL,
|
||||
// 'js' => array(
|
||||
// 'on' => 'onchange="advancedStockManagementActivationAuthorization()"',
|
||||
// 'off' => 'onchange="advancedStockManagementActivationAuthorization()"'
|
||||
// )
|
||||
// ),
|
||||
// 'PS_FORCE_ASM_NEW_PRODUCT' => array(
|
||||
// 'title' => $this->l('New products use advanced stock management'),
|
||||
// 'hint' => $this->l('New products will automatically use advanced stock management and depends on stock, but no warehouse will be selected'),
|
||||
// 'validation' => 'isBool',
|
||||
// 'cast' => 'intval',
|
||||
// 'required' => false,
|
||||
// 'type' => 'bool',
|
||||
// 'visibility' => Shop::CONTEXT_ALL,
|
||||
// ),
|
||||
// 'PS_DEFAULT_WAREHOUSE_NEW_PRODUCT' => array(
|
||||
// 'title' => $this->l('Default warehouse on new products'),
|
||||
// 'hint' => $this->l('Automatically set a default warehouse when new product is created'),
|
||||
// 'type' => 'select',
|
||||
// 'list' => $warehouse_list,
|
||||
// 'identifier' => 'id_warehouse'
|
||||
// ),
|
||||
// 'PS_PACK_STOCK_TYPE' => array(
|
||||
// 'title' => $this->l('Default pack stock management'),
|
||||
// 'type' => 'select',
|
||||
// 'list' =>array(
|
||||
// array(
|
||||
// 'pack_stock' => 0,
|
||||
// 'name' => $this->l('Decrement pack only.')
|
||||
// ),
|
||||
// array(
|
||||
// 'pack_stock' => 1,
|
||||
// 'name' => $this->l('Decrement products in pack only.')
|
||||
// ),
|
||||
// array(
|
||||
// 'pack_stock' => 2,
|
||||
// 'name' => $this->l('Decrement both.')
|
||||
// ),
|
||||
// ),
|
||||
// 'identifier' => 'pack_stock',
|
||||
// ),
|
||||
// ),
|
||||
// 'bottom' => '<script type="text/javascript">stockManagementActivationAuthorization();advancedStockManagementActivationAuthorization();</script>',
|
||||
// 'submit' => array('title' => $this->l('Save'))
|
||||
// ),
|
||||
'stock' => array(
|
||||
'title' => $this->l('Products stock'),
|
||||
'fields' => array(
|
||||
'PS_ORDER_OUT_OF_STOCK' => array(
|
||||
'title' => $this->l('Allow ordering of out-of-stock products'),
|
||||
'hint' => $this->l('By default, the Add to Cart button is hidden when a product is unavailable. You can choose to have it displayed in all cases.'),
|
||||
'validation' => 'isBool',
|
||||
'cast' => 'intval',
|
||||
'required' => false,
|
||||
'type' => 'bool'
|
||||
),
|
||||
'PS_STOCK_MANAGEMENT' => array(
|
||||
'title' => $this->l('Enable stock management'),
|
||||
'validation' => 'isBool',
|
||||
'cast' => 'intval',
|
||||
'required' => false,
|
||||
'type' => 'bool',
|
||||
'js' => array(
|
||||
'on' => 'onchange="stockManagementActivationAuthorization()"',
|
||||
'off' => 'onchange="stockManagementActivationAuthorization()"'
|
||||
)
|
||||
),
|
||||
// 'PS_ADVANCED_STOCK_MANAGEMENT' => array(
|
||||
// 'title' => $this->l('Enable advanced stock management'),
|
||||
// 'hint' => $this->l('Allows you to manage physical stock, warehouses and supply orders in a new Stock menu.'),
|
||||
// 'validation' => 'isBool',
|
||||
// 'cast' => 'intval',
|
||||
// 'required' => false,
|
||||
// 'type' => 'bool',
|
||||
// 'visibility' => Shop::CONTEXT_ALL,
|
||||
// 'js' => array(
|
||||
// 'on' => 'onchange="advancedStockManagementActivationAuthorization()"',
|
||||
// 'off' => 'onchange="advancedStockManagementActivationAuthorization()"'
|
||||
// )
|
||||
// ),
|
||||
// 'PS_FORCE_ASM_NEW_PRODUCT' => array(
|
||||
// 'title' => $this->l('New products use advanced stock management'),
|
||||
// 'hint' => $this->l('New products will automatically use advanced stock management and depends on stock, but no warehouse will be selected'),
|
||||
// 'validation' => 'isBool',
|
||||
// 'cast' => 'intval',
|
||||
// 'required' => false,
|
||||
// 'type' => 'bool',
|
||||
// 'visibility' => Shop::CONTEXT_ALL,
|
||||
// ),
|
||||
// 'PS_DEFAULT_WAREHOUSE_NEW_PRODUCT' => array(
|
||||
// 'title' => $this->l('Default warehouse on new products'),
|
||||
// 'hint' => $this->l('Automatically set a default warehouse when new product is created'),
|
||||
// 'type' => 'select',
|
||||
// 'list' => $warehouse_list,
|
||||
// 'identifier' => 'id_warehouse'
|
||||
// ),
|
||||
// 'PS_PACK_STOCK_TYPE' => array(
|
||||
// 'title' => $this->l('Default pack stock management'),
|
||||
// 'type' => 'select',
|
||||
// 'list' =>array(
|
||||
// array(
|
||||
// 'pack_stock' => 0,
|
||||
// 'name' => $this->l('Decrement pack only.')
|
||||
// ),
|
||||
// array(
|
||||
// 'pack_stock' => 1,
|
||||
// 'name' => $this->l('Decrement products in pack only.')
|
||||
// ),
|
||||
// array(
|
||||
// 'pack_stock' => 2,
|
||||
// 'name' => $this->l('Decrement both.')
|
||||
// ),
|
||||
// ),
|
||||
// 'identifier' => 'pack_stock',
|
||||
// ),
|
||||
),
|
||||
// 'bottom' => '<script type="text/javascript">stockManagementActivationAuthorization();advancedStockManagementActivationAuthorization();</script>',
|
||||
'submit' => array('title' => $this->l('Save'))
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ class CartControllerCore extends FrontController
|
||||
$this->id_product_attribute = (int)Tools::getValue('id_product_attribute', Tools::getValue('ipa'));
|
||||
$this->customization_id = (int)Tools::getValue('id_customization');
|
||||
$this->qty = abs(Tools::getValue('qty', 1));
|
||||
$this->id_hotel = abs(Tools::getValue('id_hotel', null));
|
||||
$this->id_address_delivery = (int)Tools::getValue('id_address_delivery');
|
||||
}
|
||||
|
||||
@@ -178,7 +179,29 @@ class CartControllerCore extends FrontController
|
||||
$this->context->cookie->avail_rooms = $total_available_rooms;
|
||||
}
|
||||
} else {
|
||||
$result = $this->context->cart->deleteProduct($this->id_product, $this->id_product_attribute, $this->customization_id, $this->id_address_delivery);
|
||||
$idServiceProductOption = Tools::getValue('id_service_product_option', null);
|
||||
if ($product->service_product_type == Product::SERVICE_PRODUCT_STANDALONE) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
$result = $objRoomTypeServiceProductCartDetail->removeCartServiceProduct(
|
||||
$this->context->cart->id,
|
||||
$this->id_product,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
$idServiceProductOption
|
||||
);
|
||||
|
||||
} elseif ($product->service_product_type == Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
$result = $objRoomTypeServiceProductCartDetail->removeCartServiceProduct(
|
||||
$this->context->cart->id,
|
||||
$this->id_product,
|
||||
false,
|
||||
$this->id_hotel,
|
||||
false,
|
||||
$idServiceProductOption
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
@@ -432,19 +455,82 @@ class CartControllerCore extends FrontController
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$obj_htl_cart_booking_data = new HotelCartBookingData();
|
||||
if ($product->service_product_type == Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE) {
|
||||
$objHotelCartBookingData = new HotelCartBookingData();
|
||||
if ($product->service_product_type == Product::SERVICE_PRODUCT_STANDALONE) {
|
||||
// if can be added without room type then we can directly add product in cart.
|
||||
if (!$product->allow_multiple_quantity) {
|
||||
// check if product already exists in cart.
|
||||
if ($id_cart) {
|
||||
if (cart::getProductQtyInCart($id_cart, $product->id)) {
|
||||
$this->errors[] = Tools::displayError('You can only order one quantity for this product.');
|
||||
if ($operator == 'up') {
|
||||
if ($product->allow_multiple_quantity) {
|
||||
if ($id_cart) {
|
||||
$quantityInCart = Cart::getProductQtyInCart(
|
||||
$id_cart,
|
||||
$this->id_product
|
||||
);
|
||||
}
|
||||
$finalQuantity = $this->qty;
|
||||
if (isset($quantityInCart)) {
|
||||
$finalQuantity += $quantityInCart;
|
||||
}
|
||||
if ($product->max_quantity && $finalQuantity > $product->max_quantity) {
|
||||
$this->errors[] = Tools::displayError(sprintf('cannot add more than %d quantity.', $product->max_quantity));
|
||||
}
|
||||
} else {
|
||||
if ($id_cart) {
|
||||
if (cart::getProductQtyInCart($id_cart, $product->id)) {
|
||||
$this->errors[] = Tools::displayError('You can only order one quantity for this product.');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ServiceProductOption::productHasOptions($this->id_product)) {
|
||||
if (!$idServiceProductOption = Tools::getValue('id_service_product_option')) {
|
||||
$this->errors[] = Tools::displayError('Cannot add service without a option.');
|
||||
} else {
|
||||
if (!ServiceProductOption::productHasOptions($this->id_product, $idServiceProductOption)) {
|
||||
$this->errors[] = Tools::displayError('The selected option is not available.');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($product->service_product_type == Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL) {
|
||||
$id_hotel = Tools::getValue('id_hotel');
|
||||
if ($operator == 'up') {
|
||||
if ($id_hotel) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
if ($cartDetail = $objRoomTypeServiceProductCartDetail->getProducts(
|
||||
$id_cart,
|
||||
$this->id_product,
|
||||
ProductCore::SERVICE_PRODUCT_lINKED_WITH_HOTEL,
|
||||
$id_hotel
|
||||
)) {
|
||||
$productCartDetail = array_shift($cartDetail);
|
||||
}
|
||||
if ($product->allow_multiple_quantity) {
|
||||
$finalQuantity = $this->qty;
|
||||
if (isset($productCartDetail)) {
|
||||
$finalQuantity += $productCartDetail['quantity'];
|
||||
}
|
||||
if ($product->max_quantity && $finalQuantity > $product->max_quantity) {
|
||||
$this->errors[] = Tools::displayError(sprintf('cannot add more than %d quantity.', $product->max_quantity));
|
||||
}
|
||||
} else {
|
||||
if ($productCartDetail) {
|
||||
$this->errors[] = Tools::displayError('You can only order one quantity for this product.');
|
||||
}
|
||||
}
|
||||
if (ServiceProductOption::productHasOptions($this->id_product)) {
|
||||
if (!$idServiceProductOption = Tools::getValue('id_service_product_option')) {
|
||||
$this->errors[] = Tools::displayError('Cannot add service without a option.');
|
||||
} else {
|
||||
if (!ServiceProductOption::productHasOptions($this->id_product, $idServiceProductOption)) {
|
||||
$this->errors[] = Tools::displayError('The selected option is not available.');
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('Cannot add service without a hotel.');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('cannot add product without room in cart');
|
||||
$this->errors[] = Tools::displayError('cannot add service without room in cart');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -511,7 +597,6 @@ class CartControllerCore extends FrontController
|
||||
/*
|
||||
* To add Rooms in hotel cart
|
||||
*/
|
||||
|
||||
if ($product->booking_product) {
|
||||
$objHotelCartBookingData = new HotelCartBookingData();
|
||||
$roomDemand = json_decode(Tools::getValue('roomDemands'), true);
|
||||
@@ -544,19 +629,41 @@ class CartControllerCore extends FrontController
|
||||
$this->availQty = $total_available_rooms + $req_rm;
|
||||
}
|
||||
$this->context->cookie->avail_rooms = $this->availQty;
|
||||
} else {
|
||||
$update_quantity = $this->context->cart->updateQty(
|
||||
$this->qty,
|
||||
} elseif ($product->service_product_type == Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
$update_quantity = $objRoomTypeServiceProductCartDetail->updateCartServiceProduct(
|
||||
$this->context->cart->id,
|
||||
$this->id_product,
|
||||
$this->id_product_attribute,
|
||||
$this->customization_id,
|
||||
$operator,
|
||||
$this->id_address_delivery
|
||||
$this->qty,
|
||||
$id_hotel,
|
||||
false,
|
||||
isset($idServiceProductOption) ? $idServiceProductOption : null
|
||||
);
|
||||
if ($operator == 'up') {
|
||||
$this->context->cookie->currentAddedProduct = json_encode(array(
|
||||
'id_product' => $this->id_product,
|
||||
'qty' => $this->qty
|
||||
'id_hotel' => $id_hotel,
|
||||
'qty' => $this->qty,
|
||||
'id_service_product_option' => isset($idServiceProductOption) ? $idServiceProductOption : null
|
||||
));
|
||||
}
|
||||
} elseif ($product->service_product_type == Product::SERVICE_PRODUCT_STANDALONE) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
$update_quantity = $objRoomTypeServiceProductCartDetail->updateCartServiceProduct(
|
||||
$this->context->cart->id,
|
||||
$this->id_product,
|
||||
$operator,
|
||||
$this->qty,
|
||||
false,
|
||||
false,
|
||||
isset($idServiceProductOption) ? $idServiceProductOption : null
|
||||
);
|
||||
if ($operator == 'up') {
|
||||
$this->context->cookie->currentAddedProduct = json_encode(array(
|
||||
'id_product' => $this->id_product,
|
||||
'qty' => $this->qty,
|
||||
'id_service_product_option' => isset($idServiceProductOption) ? $idServiceProductOption : null
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -651,11 +758,12 @@ class CartControllerCore extends FrontController
|
||||
if (empty($this->errors)) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
if ($objRoomTypeServiceProductCartDetail->updateCartServiceProduct(
|
||||
$idCartBooking,
|
||||
$idServiceProduct,
|
||||
$qty,
|
||||
$this->context->cart->id,
|
||||
$operator
|
||||
$idServiceProduct,
|
||||
$operator,
|
||||
$qty,
|
||||
false,
|
||||
$idCartBooking
|
||||
)) {
|
||||
$this->ajaxDie(json_encode(array(
|
||||
'hasError' => false
|
||||
|
||||
@@ -516,7 +516,7 @@ class GuestTrackingControllerCore extends FrontController
|
||||
}
|
||||
} else {
|
||||
// get all products that are independent.
|
||||
if ($type_value['product_service_type'] == Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE) {
|
||||
if ($type_value['product_service_type'] == Product::SERVICE_PRODUCT_STANDALONE) {
|
||||
$product = new Product($type_value['product_id'], false, $this->context->language->id);
|
||||
$cover_image_arr = $product->getCover($type_value['product_id']);
|
||||
|
||||
|
||||
@@ -146,7 +146,8 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
$hotelCartBookingData = new HotelCartBookingData();
|
||||
$objBookingDemand = new HotelBookingDemands();
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
$cart_service_products = array();
|
||||
$cart_standalone_service_products = array();
|
||||
$cart_hotel_service_products = array();
|
||||
$cart_htl_data = array();
|
||||
foreach ($cartOrders as $cartOrder) {
|
||||
$idOrder = $cartOrder['id_order'];
|
||||
@@ -155,10 +156,7 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
|
||||
if (!empty($orderProducts)) {
|
||||
foreach ($orderProducts as $type_key => $type_value) {
|
||||
if (in_array($type_value['product_id'], $processed_product)) {
|
||||
continue;
|
||||
}
|
||||
$processed_product[] = $type_value['product_id'];
|
||||
|
||||
|
||||
$product = new Product($type_value['product_id'], false, $this->context->language->id);
|
||||
|
||||
@@ -176,6 +174,11 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
$order_bk_data = $obj_htl_bk_dtl->getOnlyOrderBookingData($idOrder, $customer->id_guest, $type_value['product_id']);
|
||||
}
|
||||
if ($rm_dtl = $obj_rm_type->getRoomTypeInfoByIdProduct($type_value['product_id'])) {
|
||||
if (in_array($type_value['product_id'], $processed_product)) {
|
||||
continue;
|
||||
}
|
||||
$processed_product[] = $type_value['product_id'];
|
||||
|
||||
$cart_htl_data[$type_key]['id_order'] = $idOrder;
|
||||
$cart_htl_data[$type_key]['id_product'] = $type_value['product_id'];
|
||||
$cart_htl_data[$type_key]['cover_img'] = $cover_img;
|
||||
@@ -355,7 +358,7 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
|
||||
$totalRoomsBooked += 1;
|
||||
}
|
||||
} else if ($product->service_product_type == Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE) {
|
||||
} else if ($product->service_product_type == ProductCore::SERVICE_PRODUCT_lINKED_WITH_HOTEL) {
|
||||
$cover_image_arr = $product->getCover($type_value['product_id']);
|
||||
|
||||
if (!empty($cover_image_arr)) {
|
||||
@@ -363,15 +366,41 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
} else {
|
||||
$type_value['cover_img'] = $this->context->link->getImageLink($product->link_rewrite, $this->context->language->iso_code.'-default', 'small_default');
|
||||
}
|
||||
// $orderTotalInfo['total_service_products_te'] += $type_value['total_price_tax_excl'];
|
||||
// $orderTotalInfo['total_service_products_ti'] += $type_value['total_price_tax_incl'];
|
||||
$cart_service_products[] = $type_value;
|
||||
$serviceProducts = $objRoomTypeServiceProductOrderDetail->getProducts($idOrder, $type_value['id_order_detail'], $type_value['product_id']);
|
||||
foreach ($serviceProducts as $serviceProduct) {
|
||||
$type_value['total_price_tax_excl'] = $serviceProduct['total_price_tax_excl'];
|
||||
$type_value['total_price_tax_incl'] = $serviceProduct['total_price_tax_incl'];
|
||||
$type_value['product_quantity'] = $serviceProduct['quantity'];
|
||||
$type_value['option_name'] = $serviceProduct['option_name'];
|
||||
$orderTotalInfo['total_service_products_te'] += $type_value['total_price_tax_excl'];
|
||||
$orderTotalInfo['total_service_products_ti'] += $type_value['total_price_tax_incl'];
|
||||
$cart_hotel_service_products[] = $type_value;
|
||||
}
|
||||
} else if ($product->service_product_type == Product::SERVICE_PRODUCT_STANDALONE) {
|
||||
$cover_image_arr = $product->getCover($type_value['product_id']);
|
||||
|
||||
if (!empty($cover_image_arr)) {
|
||||
$type_value['cover_img'] = $this->context->link->getImageLink($product->link_rewrite, $product->id.'-'.$cover_image_arr['id_image'], 'small_default');
|
||||
} else {
|
||||
$type_value['cover_img'] = $this->context->link->getImageLink($product->link_rewrite, $this->context->language->iso_code.'-default', 'small_default');
|
||||
}
|
||||
$serviceProducts = $objRoomTypeServiceProductOrderDetail->getProducts($idOrder, $type_value['id_order_detail'], $type_value['product_id']);
|
||||
foreach ($serviceProducts as $serviceProduct) {
|
||||
$type_value['total_price_tax_excl'] = $serviceProduct['total_price_tax_excl'];
|
||||
$type_value['total_price_tax_incl'] = $serviceProduct['total_price_tax_incl'];
|
||||
$type_value['product_quantity'] = $serviceProduct['quantity'];
|
||||
$type_value['option_name'] = $serviceProduct['option_name'];
|
||||
$orderTotalInfo['total_service_products_te'] += $type_value['total_price_tax_excl'];
|
||||
$orderTotalInfo['total_service_products_ti'] += $type_value['total_price_tax_incl'];
|
||||
$cart_standalone_service_products[] = $type_value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($cart_service_products)) {
|
||||
$this->context->smarty->assign('cart_service_products', $cart_service_products);
|
||||
if (!empty($cart_hotel_service_products)) {
|
||||
$this->context->smarty->assign('cart_hotel_service_products', $cart_hotel_service_products);
|
||||
}
|
||||
if (!empty($cart_standalone_service_products)) {
|
||||
$this->context->smarty->assign('cart_standalone_service_products', $cart_standalone_service_products);
|
||||
}
|
||||
}
|
||||
if (!$objCartOrder->hasInvoice()) {
|
||||
@@ -386,8 +415,8 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
$orderTotalInfo['total_services_ti'] += $objCartOrder->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 0);
|
||||
$orderTotalInfo['total_convenience_fee_te'] += $objCartOrder->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT);
|
||||
$orderTotalInfo['total_convenience_fee_ti'] += $objCartOrder->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT);
|
||||
// $orderTotalInfo['total_service_products_te'] += $objCartOrder->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE);
|
||||
// $orderTotalInfo['total_service_products_ti'] += $objCartOrder->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE);
|
||||
// $orderTotalInfo['total_service_products_te'] += $objCartOrder->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_STANDALONE);
|
||||
// $orderTotalInfo['total_service_products_ti'] += $objCartOrder->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_STANDALONE);
|
||||
$orderTotalInfo['total_discounts'] += $objCartOrder->total_discounts;
|
||||
$orderTotalInfo['total_discounts_te'] += $objCartOrder->total_discounts_tax_excl;
|
||||
$orderTotalInfo['total_tax'] += $objCartOrder->total_paid_tax_incl - $objCartOrder->total_paid_tax_excl;
|
||||
@@ -403,7 +432,6 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
$this->context->smarty->assign('orderTotalInfo', $orderTotalInfo);
|
||||
$this->context->smarty->assign('orders_has_invoice', $orders_has_invoice);
|
||||
}
|
||||
|
||||
if (!empty($cart_htl_data)) {
|
||||
$this->context->smarty->assign('cart_htl_data', $cart_htl_data);
|
||||
}
|
||||
@@ -423,6 +451,8 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
'objOrderCurrency' => (new Currency($order->id_currency)),
|
||||
'use_tax' => Configuration::get('PS_TAX'),
|
||||
'group_use_tax' => (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC),
|
||||
'order_history' => $order->getHistory((int)$this->context->language->id, false, true),
|
||||
'overbooking_order_states' => OrderState::getOverBookingStates()
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ class OrderDetailControllerCore extends FrontController
|
||||
$carrier = new Carrier((int)$order->id_carrier, (int)$order->id_lang);
|
||||
$addressInvoice = new Address((int)$order->id_address_invoice);
|
||||
$addressDelivery = new Address((int)$order->id_address_delivery);
|
||||
$addressTax = new Address((int)$order->id_address_tax);
|
||||
|
||||
$inv_adr_fields = AddressFormat::getOrderedAddressFields($addressInvoice->id_country);
|
||||
$dlv_adr_fields = AddressFormat::getOrderedAddressFields($addressDelivery->id_country);
|
||||
@@ -92,6 +93,9 @@ class OrderDetailControllerCore extends FrontController
|
||||
$processedProducts = array();
|
||||
$cartHotelData = array();
|
||||
$cartServiceProducts = array();
|
||||
$hotelServiceProducts = array();
|
||||
$standaloneServiceProducts = array();
|
||||
$serviceProductsFormatted = array();
|
||||
$total_demands_price_te = 0;
|
||||
$total_demands_price_ti = 0;
|
||||
$total_convenience_fee_te = 0;
|
||||
@@ -99,27 +103,26 @@ class OrderDetailControllerCore extends FrontController
|
||||
$roomTypes = array();
|
||||
$objOrderReturn = new OrderReturn();
|
||||
$refundedAmount = 0;
|
||||
if ($refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($order->id, 0, 1)) {
|
||||
$refundedAmount = $objOrderReturn->getRefundedAmount($order->id);
|
||||
}
|
||||
$refundedAmount = $objOrderReturn->getRefundedAmount($order->id);
|
||||
$refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($order->id, 0, 1);
|
||||
$refundReqProducts = $objOrderReturn->getOrderRefundRequestedProducts($order->id, 0, 1);
|
||||
|
||||
if (!empty($products)) {
|
||||
foreach ($products as $type_key => $type_value) {
|
||||
if (in_array($type_value['product_id'], $processedProducts)) {
|
||||
continue;
|
||||
}
|
||||
$product = new Product($type_value['product_id'], false, $this->context->language->id);
|
||||
$cover_image_arr = $product->getCover($type_value['product_id']);
|
||||
|
||||
if (!empty($cover_image_arr)) {
|
||||
$type_value['cover_img'] = $this->context->link->getImageLink($product->link_rewrite, $product->id.'-'.$cover_image_arr['id_image'], 'home_default');
|
||||
} else {
|
||||
$type_value['cover_img'] = $this->context->link->getImageLink($product->link_rewrite, $this->context->language->iso_code.'-default', 'home_default');
|
||||
}
|
||||
if ($type_value['is_booking_product']) {
|
||||
$processedProducts[] = $type_value['product_id'];
|
||||
|
||||
$product = new Product($type_value['product_id'], false, $this->context->language->id);
|
||||
$cover_image_arr = $product->getCover($type_value['product_id']);
|
||||
|
||||
if (!empty($cover_image_arr)) {
|
||||
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $product->id.'-'.$cover_image_arr['id_image'], 'home_default');
|
||||
} else {
|
||||
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $this->context->language->iso_code.'-default', 'home_default');
|
||||
}
|
||||
|
||||
if (isset($customer->id)) {
|
||||
$obj_cart = new Cart($order->id_cart);
|
||||
$order_bk_data = $objBookingDetail->getOnlyOrderBookingData($order->id, $obj_cart->id_guest, $type_value['product_id'], $customer->id);
|
||||
@@ -127,7 +130,7 @@ class OrderDetailControllerCore extends FrontController
|
||||
$order_bk_data = $objBookingDetail->getOnlyOrderBookingData($order->id, $customer->id_guest, $type_value['product_id']);
|
||||
}
|
||||
$cartHotelData[$type_key]['id_product'] = $type_value['product_id'];
|
||||
$cartHotelData[$type_key]['cover_img'] = $cover_img;
|
||||
$cartHotelData[$type_key]['cover_img'] = $type_value['cover_img'];
|
||||
|
||||
|
||||
$objBookingDemand = new HotelBookingDemands();
|
||||
@@ -359,7 +362,7 @@ class OrderDetailControllerCore extends FrontController
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
);
|
||||
@@ -376,18 +379,31 @@ class OrderDetailControllerCore extends FrontController
|
||||
1
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// get all products that are independent.
|
||||
if ($type_value['product_service_type'] == Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE) {
|
||||
$product = new Product($type_value['product_id'], false, $this->context->language->id);
|
||||
$cover_image_arr = $product->getCover($type_value['product_id']);
|
||||
|
||||
if (!empty($cover_image_arr)) {
|
||||
$type_value['cover_img'] = $this->context->link->getImageLink($product->link_rewrite, $product->id.'-'.$cover_image_arr['id_image'], 'small_default');
|
||||
} else {
|
||||
$type_value['cover_img'] = $this->context->link->getImageLink($product->link_rewrite, $this->context->language->iso_code.'-default', 'small_default');
|
||||
} else if ($type_value['product_service_type'] == Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL) {
|
||||
$hotelProducts = $objRoomTypeServiceProductOrderDetail->getProducts($id_order, $type_value['id_order_detail'], $type_value['product_id']);
|
||||
foreach ($hotelProducts as $hotelProduct) {
|
||||
$hotelServiceProducts[] = array_merge($type_value, $hotelProduct);
|
||||
if (!isset($serviceProductsFormatted[$hotelProduct['id_product']])) {
|
||||
$serviceProductsFormatted[$hotelProduct['id_product']] = array(
|
||||
'id_product' => $hotelProduct['id_product'],
|
||||
'name' => $hotelProduct['name'],
|
||||
'options' => array()
|
||||
);
|
||||
}
|
||||
$cartServiceProducts[] = $type_value;
|
||||
$serviceProductsFormatted[$hotelProduct['id_product']]['options'][] = $hotelProduct;
|
||||
}
|
||||
} else if ($type_value['product_service_type'] == Product::SERVICE_PRODUCT_STANDALONE) {
|
||||
$standaloneProducts = $objRoomTypeServiceProductOrderDetail->getProducts($id_order, $type_value['id_order_detail'], $type_value['product_id']);
|
||||
foreach ($standaloneProducts as $standaloneProduct) {
|
||||
$standaloneServiceProducts[] = array_merge($type_value, $standaloneProduct);
|
||||
if (!isset($serviceProductsFormatted[$standaloneProduct['id_product']])) {
|
||||
$serviceProductsFormatted[$standaloneProduct['id_product']] = array(
|
||||
'id_product' => $standaloneProduct['id_product'],
|
||||
'name' => $standaloneProduct['name'],
|
||||
'options' => array()
|
||||
);
|
||||
}
|
||||
$serviceProductsFormatted[$standaloneProduct['id_product']]['options'][] = $standaloneProduct;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -399,13 +415,7 @@ class OrderDetailControllerCore extends FrontController
|
||||
|
||||
$objHotelBookingDetail = new HotelBookingDetail();
|
||||
$htlBookingDetail = $objHotelBookingDetail->getOrderCurrentDataByOrderId($order->id);
|
||||
$idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id);
|
||||
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
|
||||
$hotelAddressInfo = HotelBranchInformation::getAddress($idHotel);
|
||||
|
||||
$objHotelBranchRefundRules = new HotelBranchRefundRules();
|
||||
$hotelRefundRules = $objHotelBranchRefundRules->getHotelRefundRules($idHotel, 0, 1);
|
||||
|
||||
// ddd($serviceProductsFormatted);
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'id_cms_refund_policy' => Configuration::get('WK_GLOBAL_REFUND_POLICY_CMS'),
|
||||
@@ -420,13 +430,26 @@ class OrderDetailControllerCore extends FrontController
|
||||
'order_has_invoice' => $order->hasInvoice(),
|
||||
'cart_htl_data' => $cartHotelData,
|
||||
'cart_service_products' => $cartServiceProducts,
|
||||
'obj_hotel_branch_information' => $objHotelBranchInformation,
|
||||
'hotel_address_info' => $hotelAddressInfo,
|
||||
'hotel_refund_rules' => $hotelRefundRules,
|
||||
'hotel_service_products' => $hotelServiceProducts,
|
||||
'standalone_service_products' => $standaloneServiceProducts,
|
||||
'service_products_formatted' => $serviceProductsFormatted,
|
||||
'view_on_map' => Configuration::get('WK_GOOGLE_ACTIVE_MAP'),
|
||||
)
|
||||
);
|
||||
|
||||
if ($idHotel = $addressTax->id_hotel) {
|
||||
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
|
||||
$hotelAddressInfo = HotelBranchInformation::getAddress($idHotel);
|
||||
$objHotelBranchRefundRules = new HotelBranchRefundRules();
|
||||
$hotelRefundRules = $objHotelBranchRefundRules->getHotelRefundRules($idHotel, 0, 1);
|
||||
$this->context->smarty->assign(array(
|
||||
'obj_hotel_branch_information' => $objHotelBranchInformation,
|
||||
'hotel_address_info' => $hotelAddressInfo,
|
||||
'hotel_refund_rules' => $hotelRefundRules,
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'hasOrderPaid' => $order->hasBeenPaid(),
|
||||
@@ -434,6 +457,7 @@ class OrderDetailControllerCore extends FrontController
|
||||
'refund_allowed' => (int) $order->isReturnable(),
|
||||
'returns' => OrderReturn::getOrdersReturn($order->id_customer, $order->id),
|
||||
'refundReqBookings' => $refundReqBookings,
|
||||
'refundReqProducts' => $refundReqProducts,
|
||||
'completeRefundRequestOrCancel' => $order->hasCompletelyRefunded(0, 1),
|
||||
'refundedAmount' => $refundedAmount,
|
||||
'shop_name' => strval(Configuration::get('PS_SHOP_NAME')),
|
||||
@@ -552,10 +576,11 @@ class OrderDetailControllerCore extends FrontController
|
||||
|
||||
$idOrder = Tools::getValue('id_order');
|
||||
$idsHtlBooking = Tools::getValue('bookings_to_refund');
|
||||
$idServiceProductOrderDetails = Tools::getValue('id_room_type_service_product_order_detail');
|
||||
$cancellationReason = trim(Tools::getValue('cancellation_reason'));
|
||||
|
||||
if (!$idsHtlBooking) {
|
||||
$this->errors[] = Tools::displayError('Please select at least on room for cancellation.');
|
||||
if (!$idsHtlBooking && !$idServiceProductOrderDetails) {
|
||||
$this->errors[] = Tools::displayError('Please select at least on room/product for cancellation.');
|
||||
}
|
||||
|
||||
if (!$cancellationReason) {
|
||||
@@ -568,23 +593,33 @@ class OrderDetailControllerCore extends FrontController
|
||||
$objOrder = new Order($idOrder);
|
||||
if (!(Validate::isLoadedObject($objOrder) && $objOrder->id_customer == $this->context->customer->id)) {
|
||||
$this->errors[] = Tools::displayError('Something went wrong. Please try later.');
|
||||
} elseif ($idsHtlBooking) {
|
||||
foreach ($idsHtlBooking as $idHtlBooking) {
|
||||
$objHotelBookingDetail = new HotelBookingDetail($idHtlBooking);
|
||||
if ($objHotelBookingDetail->id_customer != $objOrder->id_customer) {
|
||||
$this->errors[] = Tools::displayError('Something went wrong. Please try later.');
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if ($idsHtlBooking) {
|
||||
foreach ($idsHtlBooking as $idHtlBooking) {
|
||||
$objHotelBookingDetail = new HotelBookingDetail($idHtlBooking);
|
||||
if ($objHotelBookingDetail->id_customer != $objOrder->id_customer) {
|
||||
$this->errors[] = Tools::displayError('Something went wrong. Please try later.');
|
||||
break;
|
||||
}
|
||||
|
||||
// the room has already been checked in/checked out, room will not be able to be cancelled by the customer
|
||||
if ($objHotelBookingDetail->id_status != HotelBookingDetail::STATUS_ALLOTED) {
|
||||
$this->errors[] = Tools::displayError('Some selected rooms have already been checked-in/checked-out.');
|
||||
break;
|
||||
}
|
||||
// the room has already been checked in/checked out, room will not be able to be cancelled by the customer
|
||||
if ($objHotelBookingDetail->id_status != HotelBookingDetail::STATUS_ALLOTED) {
|
||||
$this->errors[] = Tools::displayError('Some selected rooms have already been checked-in/checked-out.');
|
||||
break;
|
||||
}
|
||||
|
||||
if (OrderReturn::getOrdersReturnDetail($objOrder->id, 0, $idHtlBooking)) {
|
||||
$this->errors[] = Tools::displayError('Some selected rooms have already been requested for cancellation.');
|
||||
break;
|
||||
if (OrderReturn::getOrdersReturnDetail($objOrder->id, 0, $idHtlBooking)) {
|
||||
$this->errors[] = Tools::displayError('Some selected rooms have already been requested for cancellation.');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($idServiceProductOrderDetails) {
|
||||
foreach ($idServiceProductOrderDetails as $idServiceProductOrderDetail) {
|
||||
if (OrderReturn::getOrdersReturnDetail($objOrder->id, 0, 0, $idServiceProductOrderDetail)) {
|
||||
$this->errors[] = Tools::displayError('Some selected rooms have already been requested for cancellation.');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -600,22 +635,39 @@ class OrderDetailControllerCore extends FrontController
|
||||
$objOrderReturn->refunded_amount = 0;
|
||||
$objOrderReturn->save();
|
||||
if ($objOrderReturn->id) {
|
||||
foreach ($idsHtlBooking 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->refunded_amount = 0;
|
||||
if (!$objOrder->getCartRules() && $objOrder->getTotalPaid() <= 0) {
|
||||
$objOrderReturnDetail->id_customization = 1;
|
||||
if ($idsHtlBooking) {
|
||||
foreach ($idsHtlBooking 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->refunded_amount = 0;
|
||||
if (!$objOrder->getCartRules() && $objOrder->getTotalPaid() <= 0) {
|
||||
$objOrderReturnDetail->id_customization = 1;
|
||||
}
|
||||
$objOrderReturnDetail->save();
|
||||
}
|
||||
}
|
||||
if ($idServiceProductOrderDetails) {
|
||||
foreach ($idServiceProductOrderDetails as $idServiceProductOrderDetail) {
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail($idServiceProductOrderDetail);
|
||||
$objOrderReturnDetail = new OrderReturnDetail();
|
||||
$objOrderReturnDetail->id_order_return = $objOrderReturn->id;
|
||||
$objOrderReturnDetail->id_order_detail = $objRoomTypeServiceProductOrderDetail->id_order_detail;
|
||||
$objOrderReturnDetail->product_quantity = $objRoomTypeServiceProductOrderDetail->quantity;
|
||||
$objOrderReturnDetail->id_room_type_service_product_order_detail = $idServiceProductOrderDetail;
|
||||
$objOrderReturnDetail->refunded_amount = 0;
|
||||
if (!$objOrder->getCartRules() && $objOrder->getTotalPaid() <= 0) {
|
||||
$objOrderReturnDetail->id_customization = 1;
|
||||
}
|
||||
$objOrderReturnDetail->save();
|
||||
}
|
||||
$objOrderReturnDetail->save();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -391,6 +391,8 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
$this->ajaxDie($this->submitCustomerGuestDetail());
|
||||
exit;
|
||||
break;
|
||||
case 'getOpcData':
|
||||
$this->ajaxDie($this->getOpcData());
|
||||
default:
|
||||
throw new PrestaShopException('Unknown method "'.Tools::getValue('method').'"');
|
||||
}
|
||||
@@ -431,11 +433,6 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
// validate room types before payment by customer
|
||||
if ($orderRestrictErr = HotelCartBookingData::validateCartBookings()) {
|
||||
$this->errors = array_merge($this->errors, $orderRestrictErr);
|
||||
}
|
||||
|
||||
parent::initContent();
|
||||
|
||||
/* id_carrier is not defined in database before choosing a carrier, set it to a default one to match a potential cart _rule */
|
||||
@@ -500,14 +497,12 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
// $objGlobalDemand = new HotelRoomTypeGlobalDemand();
|
||||
// $allDemands = $objGlobalDemand->getAllDemands();
|
||||
// $objCurrency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
$this->_assignCheckoutVars();
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'orderRestrictErr' => count($orderRestrictErr) ? 1 : 0,
|
||||
// 'allDemands' => $allDemands,
|
||||
// 'defaultcurrencySign' => $objCurrency->sign,
|
||||
'THEME_DIR' => _THEME_DIR_,
|
||||
'PS_REGISTRATION_PROCESS_TYPE' => Configuration::get('PS_REGISTRATION_PROCESS_TYPE'),
|
||||
'PS_ROOM_PRICE_AUTO_ADD_BREAKDOWN' => Configuration::get('PS_ROOM_PRICE_AUTO_ADD_BREAKDOWN'),
|
||||
'free_shipping' => $free_shipping,
|
||||
'isGuest' => isset($this->context->cookie->is_guest) ? $this->context->cookie->is_guest : 0,
|
||||
'countries' => $countries,
|
||||
@@ -590,51 +585,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
$this->addJS(_THEME_JS_DIR_ . 'advanced-payment-api.js');
|
||||
$this->setTemplate(_PS_THEME_DIR_ . 'order-opc-advanced.tpl');
|
||||
} else {
|
||||
// set used objects in the below code
|
||||
// $objBookingDetail = new HotelBookingDetail();
|
||||
// $objHtlRoomType = new HotelRoomType();
|
||||
|
||||
$cartProducts = $this->context->cart->getProducts();
|
||||
|
||||
if (!empty($cartProducts)) {
|
||||
|
||||
if ($cartBookingInfo = HotelCartBookingData::getHotelCartBookingData()) {
|
||||
$this->context->smarty->assign('cart_htl_data', $cartBookingInfo);
|
||||
}
|
||||
$objHotelServiceProductCartDetail = new HotelServiceProductCartDetail();
|
||||
if ($normalCartProduct = $objHotelServiceProductCartDetail->getHotelProducts($this->context->cart->id, 0, 0, 0, null, null, true)) {
|
||||
$this->context->smarty->assign('cart_normal_data', $normalCartProduct);
|
||||
}
|
||||
|
||||
// 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();
|
||||
|
||||
Tools::redirect($this->context->link->getPageLink('order-opc'));
|
||||
}
|
||||
|
||||
// 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),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
$this->_assignShoppingCart();
|
||||
$this->setTemplate(_PS_THEME_DIR_.'order-opc.tpl');
|
||||
}
|
||||
}
|
||||
@@ -1144,4 +1095,20 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
|
||||
$this->context->cart->save();
|
||||
}
|
||||
}
|
||||
|
||||
public function getOpcData()
|
||||
{
|
||||
$response = array('success' => false);
|
||||
if ($this->context->cart->getProducts()) {
|
||||
$this->_assignCheckoutVars();
|
||||
$this->_assignShoppingCart();
|
||||
$response['success'] = true;
|
||||
$response['shopping_cart'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'shopping-cart.tpl');
|
||||
$response['cart_total_block'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'cart-total-block.tpl');
|
||||
} else {
|
||||
$response['reload'] = 1;
|
||||
}
|
||||
|
||||
return json_encode($response);
|
||||
}
|
||||
}
|
||||
@@ -57,6 +57,8 @@ class OrderReturnControllerCore extends FrontController
|
||||
) {
|
||||
$isCanceledBookings = true;
|
||||
}
|
||||
$refundReqProducts = $objOrderReturn->getOrderRefundRequestedProducts($objOrderReturn->id_order, $objOrderReturn->id);
|
||||
|
||||
$voucher = '';
|
||||
if (Validate::isLoadedObject($objCartRule = new CartRule($objOrderReturn->id_return_type))) {
|
||||
$voucher = $objCartRule->name[$this->context->language->id];
|
||||
@@ -66,6 +68,7 @@ class OrderReturnControllerCore extends FrontController
|
||||
array (
|
||||
'orderReturnInfo' => (array)$objOrderReturn,
|
||||
'refundReqBookings' => $refundReqBookings,
|
||||
'refundReqProducts' => $refundReqProducts,
|
||||
'isCanceledBookings' => $isCanceledBookings,
|
||||
'orderInfo' => (array) $objOrder,
|
||||
'orderCurrency' => (array) $orderCurrency,
|
||||
|
||||
@@ -299,6 +299,95 @@ class ParentOrderControllerCore extends FrontController
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function _assignCheckoutVars()
|
||||
{
|
||||
if ($orderRestrictErr = HotelCartBookingData::validateCartBookings()) {
|
||||
$this->errors = array_merge($this->errors, $orderRestrictErr);
|
||||
}
|
||||
$show_option_allow_separate_package = (!$this->context->cart->isAllProductsInStock(true) && Configuration::get('PS_SHIP_WHEN_AVAILABLE'));
|
||||
$advanced_payment_api = (bool)Configuration::get('PS_ADVANCED_PAYMENT_API');
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'THEME_DIR' => _THEME_DIR_,
|
||||
'PS_ROOM_PRICE_AUTO_ADD_BREAKDOWN' => Configuration::get('PS_ROOM_PRICE_AUTO_ADD_BREAKDOWN'),
|
||||
'orderRestrictErr' => count($orderRestrictErr) ? 1 : 0,
|
||||
'show_option_allow_separate_package' => $show_option_allow_separate_package,
|
||||
'advanced_payment_api' => $advanced_payment_api
|
||||
));
|
||||
}
|
||||
|
||||
protected function _assignShoppingCart()
|
||||
{
|
||||
$summary = $this->context->cart->getSummaryDetails();
|
||||
$cartProducts = $this->context->cart->getProducts();
|
||||
if (!empty($cartProducts)) {
|
||||
|
||||
if ($cartBookingInfo = HotelCartBookingData::getHotelCartBookingData()) {
|
||||
$this->context->smarty->assign('cart_htl_data', $cartBookingInfo);
|
||||
}
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
if ($hotelProducts = $objRoomTypeServiceProductCartDetail->getProducts(
|
||||
$this->context->cart->id,
|
||||
0,
|
||||
Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL,
|
||||
0,
|
||||
0,
|
||||
null,
|
||||
0,
|
||||
0,
|
||||
null,
|
||||
null,
|
||||
true
|
||||
)) {
|
||||
$this->context->smarty->assign('hotel_products', $hotelProducts);
|
||||
}
|
||||
|
||||
$standaloneProducts = $objRoomTypeServiceProductCartDetail->getProducts(
|
||||
$this->context->cart->id,
|
||||
0,
|
||||
ProductCore::SERVICE_PRODUCT_STANDALONE
|
||||
);
|
||||
|
||||
if (count($standaloneProducts)) {
|
||||
$this->context->smarty->assign('standalone_products', $standaloneProducts);
|
||||
}
|
||||
|
||||
|
||||
// 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();
|
||||
|
||||
Tools::redirect($this->context->link->getPageLink('order-opc'));
|
||||
}
|
||||
|
||||
// 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),
|
||||
));
|
||||
}
|
||||
}
|
||||
$this->context->smarty->assign($summary);
|
||||
$this->context->smarty->assign(array(
|
||||
'HOOK_SHOPPING_CART' => Hook::exec('displayShoppingCartFooter', $summary),
|
||||
'HOOK_SHOPPING_CART_EXTRA' => Hook::exec('displayShoppingCart', $summary)
|
||||
));
|
||||
}
|
||||
|
||||
protected function _assignSummaryInformations()
|
||||
{
|
||||
$summary = $this->context->cart->getSummaryDetails();
|
||||
@@ -362,9 +451,6 @@ class ParentOrderControllerCore extends FrontController
|
||||
}
|
||||
}
|
||||
|
||||
$show_option_allow_separate_package = (!$this->context->cart->isAllProductsInStock(true) && Configuration::get('PS_SHIP_WHEN_AVAILABLE'));
|
||||
$advanced_payment_api = (bool)Configuration::get('PS_ADVANCED_PAYMENT_API');
|
||||
|
||||
$this->context->smarty->assign($summary);
|
||||
$this->context->smarty->assign(array(
|
||||
'token_cart' => Tools::getToken(false),
|
||||
@@ -379,9 +465,7 @@ class ParentOrderControllerCore extends FrontController
|
||||
'CUSTOMIZE_TEXTFIELD' => Product::CUSTOMIZE_TEXTFIELD,
|
||||
'lastProductAdded' => $this->context->cart->getLastProduct(),
|
||||
'displayVouchers' => $available_cart_rules,
|
||||
'show_option_allow_separate_package' => $show_option_allow_separate_package,
|
||||
'smallSize' => Image::getSize(ImageType::getFormatedName('small')),
|
||||
'advanced_payment_api' => $advanced_payment_api
|
||||
|
||||
));
|
||||
|
||||
@@ -398,7 +482,15 @@ class ParentOrderControllerCore extends FrontController
|
||||
$this->context->customer->logout();
|
||||
Tools::redirect('');
|
||||
} elseif (!Customer::getAddressesTotalById($this->context->customer->id)) {
|
||||
$multi = (int)Tools::getValue('multi-shipping');
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
if (count($objRoomTypeServiceProductCartDetail->getProducts(
|
||||
$this->context->cart->id,
|
||||
0,
|
||||
Product::SERVICE_PRODUCT_STANDALONE
|
||||
))) {
|
||||
$multi = (int)Tools::getValue('multi-shipping');
|
||||
Tools::redirect('index.php?controller=address&back='.urlencode('order.php?step=1'.($multi ? '&multi-shipping='.$multi : '')));
|
||||
}
|
||||
}
|
||||
|
||||
$customer = $this->context->customer;
|
||||
|
||||
@@ -117,12 +117,13 @@ class ProductControllerCore extends FrontController
|
||||
}
|
||||
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
$hotelRoomInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($this->product->id);
|
||||
$idHotel = (int) $hotelRoomInfo['id_hotel'];
|
||||
if (!HotelHelper::validateDateRangeForHotel($dateFrom, $dateTo, $idHotel)) {
|
||||
Tools::redirect($this->context->link->getPageLink('pagenotfound'));
|
||||
} else if (!$this->product->booking_product || ($this->product->booking_product && !$this->product->show_at_front)) {
|
||||
Tools::redirect($this->context->link->getPageLink('pagenotfound'));
|
||||
if ($hotelRoomInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($this->product->id)) {
|
||||
$idHotel = (int) $hotelRoomInfo['id_hotel'];
|
||||
if (!HotelHelper::validateDateRangeForHotel($dateFrom, $dateTo, $idHotel)) {
|
||||
Tools::redirect($this->context->link->getPageLink('pagenotfound'));
|
||||
} else if (!$this->product->booking_product || ($this->product->booking_product && !$this->product->show_at_front)) {
|
||||
Tools::redirect($this->context->link->getPageLink('pagenotfound'));
|
||||
}
|
||||
}
|
||||
|
||||
if (!Validate::isLoadedObject($this->product)) {
|
||||
@@ -445,7 +446,7 @@ class ProductControllerCore extends FrontController
|
||||
}
|
||||
|
||||
$this->assignBookingFormVars($this->product->id, $date_from, $date_to, $occupancy_value);
|
||||
$this->assignServiceProductVars();
|
||||
$this->assignRoomServiceProductVars();
|
||||
|
||||
// product price after imposing feature prices...
|
||||
if ($useTax) {
|
||||
@@ -474,6 +475,8 @@ class ProductControllerCore extends FrontController
|
||||
if (Tools::getValue('error')) {
|
||||
$this->context->smarty->assign('error', Tools::getValue('error'));
|
||||
}
|
||||
} else {
|
||||
$this->assignServiceProductVars();
|
||||
}
|
||||
|
||||
// send all the common variables for all type of products
|
||||
@@ -524,7 +527,7 @@ class ProductControllerCore extends FrontController
|
||||
$this->setTemplate(_PS_THEME_DIR_.'product.tpl');
|
||||
}
|
||||
|
||||
public function assignServiceProductVars()
|
||||
public function assignRoomServiceProductVars()
|
||||
{
|
||||
// get service products for room type
|
||||
$p = 1;
|
||||
@@ -801,6 +804,66 @@ class ProductControllerCore extends FrontController
|
||||
return true;
|
||||
}
|
||||
|
||||
public function assignServiceProductVars(
|
||||
$idServiceProductOption = false,
|
||||
$quantity = false,
|
||||
$idHotel = false
|
||||
) {
|
||||
$smartyVars = array();
|
||||
if (Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL == $this->product->service_product_type) {
|
||||
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
|
||||
|
||||
if ($associatedHotels = $objRoomTypeServiceProduct->getAssociatedHotelsAndRoomType($this->product->id)['hotel']) {
|
||||
foreach ($associatedHotels as $key => $hotel) {
|
||||
if (Validate::isLoadedObject($objHotel = new HotelBranchInformation($hotel, $this->context->language->id))) {
|
||||
|
||||
$associatedHotels[$key] = array('id_hotel' => $hotel, 'name' => $objHotel->hotel_name);
|
||||
} else {
|
||||
unset($associatedHotels[$key]);
|
||||
}
|
||||
}
|
||||
$smartyVars['associated_hotels'] = $associatedHotels;
|
||||
}
|
||||
}
|
||||
if ($idHotel) {
|
||||
$smartyVars['service_id_hotel'] = $idHotel;
|
||||
}
|
||||
$useTax = HotelBookingDetail::useTax();
|
||||
$objServiceProductOption = new ServiceProductOption();
|
||||
if ($serviceProductOptions = $objServiceProductOption->getProductOptions($this->product->id)) {
|
||||
foreach ($serviceProductOptions as &$serviceProductOption) {
|
||||
if ($idServiceProductOption == null) {
|
||||
$idServiceProductOption = $serviceProductOption['id_service_product_option'];
|
||||
}
|
||||
$serviceProductOption['price'] = RoomTypeServiceProductPrice::getPrice(
|
||||
$this->product->id,
|
||||
$idHotel,
|
||||
$serviceProductOption['id_service_product_option'],
|
||||
$useTax,
|
||||
$quantity
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
$smartyVars['service_product_option'] = $serviceProductOptions;
|
||||
$smartyVars['service_price'] = RoomTypeServiceProductPrice::getPrice(
|
||||
$this->product->id,
|
||||
$idHotel,
|
||||
$idServiceProductOption,
|
||||
$useTax,
|
||||
$quantity
|
||||
);
|
||||
if ($quantity) {
|
||||
$smartyVars['quantity'] = $quantity;
|
||||
}
|
||||
if ($idServiceProductOption) {
|
||||
$smartyVars['id_service_product_option'] = $idServiceProductOption;
|
||||
}
|
||||
|
||||
$this->context->smarty->assign($smartyVars);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign price and tax to the template
|
||||
*/
|
||||
@@ -1270,35 +1333,45 @@ class ProductControllerCore extends FrontController
|
||||
{
|
||||
$response = array('status' => false);
|
||||
$idProduct = (int) Tools::getValue('id_product');
|
||||
$dateFrom = Tools::getValue('room_check_in');
|
||||
$dateTo = Tools::getValue('room_check_out');
|
||||
$occupancy = Tools::getValue('occupancy');
|
||||
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
if (!Validate::isOccupancy($occupancy)) {
|
||||
$occupancy = array();
|
||||
if ($this->product->booking_product) {
|
||||
$dateFrom = Tools::getValue('room_check_in');
|
||||
$dateTo = Tools::getValue('room_check_out');
|
||||
$occupancy = Tools::getValue('occupancy');
|
||||
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
if (!Validate::isOccupancy($occupancy)) {
|
||||
$occupancy = array();
|
||||
}
|
||||
} else {
|
||||
$occupancy = Tools::getValue('qty', 1);
|
||||
}
|
||||
$roomTypeDemands = Tools::getValue('room_type_demands');
|
||||
$roomServiceProducts = Tools::getValue('room_service_products');
|
||||
$dateFrom = date('Y-m-d H:i:s', strtotime($dateFrom));
|
||||
$dateTo = date('Y-m-d H:i:s', strtotime($dateTo));
|
||||
$this->assignRoomServiceProductVars();
|
||||
if ($this->assignBookingFormVars(
|
||||
$idProduct,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
$occupancy,
|
||||
$roomTypeDemands,
|
||||
$roomServiceProducts
|
||||
)) {
|
||||
}
|
||||
} else {
|
||||
$occupancy = Tools::getValue('qty', 1);
|
||||
$idHotel = Tools::getValue('service_id_hotel');
|
||||
$id_service_product_option = Tools::getValue('id_service_product_option');
|
||||
$quantity = Tools::getValue('service_product_qty');
|
||||
$this->assignServiceProductVars(
|
||||
$id_service_product_option,
|
||||
$quantity,
|
||||
$idHotel
|
||||
);
|
||||
}
|
||||
$roomTypeDemands = Tools::getValue('room_type_demands');
|
||||
$roomServiceProducts = Tools::getValue('room_service_products');
|
||||
|
||||
$dateFrom = date('Y-m-d H:i:s', strtotime($dateFrom));
|
||||
$dateTo = date('Y-m-d H:i:s', strtotime($dateTo));
|
||||
|
||||
$this->assignServiceProductVars();
|
||||
if ($this->assignBookingFormVars(
|
||||
$idProduct,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
$occupancy,
|
||||
$roomTypeDemands,
|
||||
$roomServiceProducts
|
||||
)) {
|
||||
$html = $this->context->smarty->fetch('_partials/booking-form.tpl');
|
||||
$response['status'] = true;
|
||||
$response['html_booking_form'] = $html;
|
||||
}
|
||||
$html = $this->context->smarty->fetch('_partials/booking-form.tpl');
|
||||
$response['status'] = true;
|
||||
$response['html_booking_form'] = $html;
|
||||
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
@@ -1350,11 +1350,13 @@ 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_htl_booking` int(11) NOT NULL,
|
||||
`id_room_type_service_product_order_detail` 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',
|
||||
KEY `id_htl_booking` (`id_htl_booking`),
|
||||
KEY `id_room_type_service_product_order_detail` (`id_room_type_service_product_order_detail`),
|
||||
PRIMARY KEY (`id_order_return_detail`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
|
||||
|
||||
@@ -1407,6 +1409,7 @@ 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,
|
||||
`id_room_type_service_product_order_detail` 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,
|
||||
@@ -1414,7 +1417,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_htl_booking`)
|
||||
PRIMARY KEY (`id_order_slip`,`id_htl_booking`,`id_room_type_service_product_order_detail`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
|
||||
|
||||
CREATE TABLE `PREFIX_order_state` (
|
||||
|
||||
@@ -551,19 +551,45 @@ product_tabs['Informations'] = new function(){
|
||||
this.switchProductType = function(){
|
||||
|
||||
$('#service_product_type').on('change',function(){
|
||||
if (parseInt($(this).val()) == with_room_type) {
|
||||
$('#associated_hotel_rooms_tree').show('fast');
|
||||
if (parseInt($(this).val()) == SERVICE_PRODUCT_WITH_ROOMTYPE) {
|
||||
$('#associated_hotel_tree').hide('fast').find('input').each(function() {
|
||||
$(this).attr('data-name', $(this).attr('name'));
|
||||
$(this).removeAttr('name');
|
||||
});
|
||||
$('#associated_hotel_rooms_tree').show('fast').find('input').each(function() {
|
||||
$(this).attr('name', $(this).attr('data-name'));
|
||||
$(this).removeAttr('data-name');
|
||||
});
|
||||
$('#auto_add_to_cart_container').show('fast');
|
||||
$('#show_at_front_container').show('fast');
|
||||
$('#product_options').show('fast');
|
||||
} else if (parseInt($(this).val()) == SERVICE_PRODUCT_STANDALONE) {
|
||||
$('#associated_hotel_rooms_tree').hide('fast').find('input').each(function() {
|
||||
$(this).attr('data-name', $(this).attr('name'));
|
||||
$(this).removeAttr('name');
|
||||
});
|
||||
$('#associated_hotel_tree').hide('fast').find('input').each(function() {
|
||||
$(this).attr('data-name', $(this).attr('name'));
|
||||
$(this).removeAttr('name');
|
||||
});
|
||||
$('#auto_add_to_cart_container').hide('fast');
|
||||
$('#show_at_front_container').show('fast');
|
||||
$('#product_options').show('fast');
|
||||
} else if (parseInt($(this).val()) == SERVICE_PRODUCT_lINKED_WITH_HOTEL) {
|
||||
$('#associated_hotel_rooms_tree').hide('fast').find('input').each(function() {
|
||||
$(this).attr('data-name', $(this).attr('name'));
|
||||
$(this).removeAttr('name');
|
||||
});
|
||||
$('#associated_hotel_tree').show('fast').show('fast').find('input').each(function() {
|
||||
$(this).attr('name', $(this).attr('data-name'));
|
||||
$(this).removeAttr('data-name');
|
||||
});
|
||||
$('#auto_add_to_cart_container').hide('fast');
|
||||
$('#show_at_front_container').show('fast');
|
||||
$('#product_options').show('fast');
|
||||
$('#independent_product_info').hide('fast');
|
||||
} else {
|
||||
$('#associated_hotel_rooms_tree').hide('fast');
|
||||
$('#show_at_front_container').hide('fast');
|
||||
$('#product_options').hide('fast');
|
||||
$('#independent_product_info').show('fast');
|
||||
}
|
||||
});
|
||||
|
||||
$('#service_product_type').trigger('change');
|
||||
$('#simple_product').attr('checked', true);
|
||||
|
||||
$('input[name="type_product"]').on('click', function(e)
|
||||
@@ -615,6 +641,122 @@ product_tabs['Features'] = new function(){
|
||||
}
|
||||
}
|
||||
|
||||
product_tabs['Quantities'] = new function(){
|
||||
var self = this;
|
||||
this.ajaxCall = function(data){
|
||||
data.ajaxProductQuantity = 1;
|
||||
data.id_product = id_product;
|
||||
data.token = token;
|
||||
data.ajax = 1;
|
||||
data.controller = "AdminNormalProducts";
|
||||
data.action = "productQuantity";
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax-tab.php",
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
async : true,
|
||||
beforeSend: function(xhr, settings)
|
||||
{
|
||||
$('.product_quantities_button').attr('disabled', 'disabled');
|
||||
},
|
||||
complete: function(xhr, status)
|
||||
{
|
||||
$('.product_quantities_button').removeAttr('disabled');
|
||||
},
|
||||
success: function(msg)
|
||||
{
|
||||
if (msg.error)
|
||||
{
|
||||
showErrorMessage(msg.error);
|
||||
return;
|
||||
}
|
||||
showSuccessMessage(quantities_ajax_success);
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown)
|
||||
{
|
||||
if (textStatus != 'error' || errorThrown != '')
|
||||
showErrorMessage(textStatus + ': ' + errorThrown);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.refreshQtyAvailabilityForm = function()
|
||||
{
|
||||
if ($('#depends_on_stock_0').prop('checked'))
|
||||
{
|
||||
$('.available_quantity').find('input').show();
|
||||
$('.available_quantity').find('span').hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.available_quantity').find('input').hide();
|
||||
$('.available_quantity').find('span').show();
|
||||
}
|
||||
};
|
||||
|
||||
this.onReady = function(){
|
||||
$('#available_date').datepicker({
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
dateFormat: 'yy-mm-dd'
|
||||
});
|
||||
|
||||
$('.depends_on_stock').click(function(e)
|
||||
{
|
||||
self.refreshQtyAvailabilityForm();
|
||||
self.ajaxCall( { actionQty: 'depends_on_stock', value: $(this).val() } );
|
||||
if($(this).val() == 0)
|
||||
$('.available_quantity input').trigger('change');
|
||||
});
|
||||
|
||||
$('.advanced_stock_management').click(function(e)
|
||||
{
|
||||
var val = 0;
|
||||
if ($(this).prop('checked'))
|
||||
val = 1;
|
||||
|
||||
self.ajaxCall({actionQty: 'advanced_stock_management', value: val});
|
||||
if (val == 1)
|
||||
{
|
||||
$(this).val(1);
|
||||
$('#depends_on_stock_1').attr('disabled', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).val(0);
|
||||
$('#depends_on_stock_1').attr('disabled', true);
|
||||
$('#depends_on_stock_0').attr('checked', true);
|
||||
self.ajaxCall({actionQty: 'depends_on_stock', value: 0});
|
||||
self.refreshQtyAvailabilityForm();
|
||||
}
|
||||
self.refreshQtyAvailabilityForm();
|
||||
});
|
||||
|
||||
$('.available_quantity').find('input').change(function(e, init_val)
|
||||
{
|
||||
self.ajaxCall({actionQty: 'set_qty', id_product_attribute: $(this).parent().attr('id').split('_')[1], value: $(this).val()});
|
||||
});
|
||||
|
||||
$('.out_of_stock').click(function(e)
|
||||
{
|
||||
self.refreshQtyAvailabilityForm();
|
||||
self.ajaxCall({actionQty: 'out_of_stock', value: $(this).val()});
|
||||
});
|
||||
if (display_multishop_checkboxes)
|
||||
ProductMultishop.checkAllQuantities();
|
||||
|
||||
$('.pack_stock_type').click(function(e)
|
||||
{
|
||||
self.refreshQtyAvailabilityForm();
|
||||
self.ajaxCall({actionQty: 'pack_stock_type', value: $(this).val()});
|
||||
});
|
||||
|
||||
self.refreshQtyAvailabilityForm();
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the product image list position buttons
|
||||
*
|
||||
|
||||
1292
js/admin/orders.js
1292
js/admin/orders.js
File diff suppressed because it is too large
Load Diff
@@ -82,13 +82,14 @@
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
{assign var="is_full_date" value=($show_full_date && ($rm_v['data_form']|date_format:'%D' == $rm_v['data_to']|date_format:'%D'))}
|
||||
<td style="border:1px solid #D6D4D4;">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td width="10"> </td>
|
||||
<td align="right" class="text-center">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
{$rm_v['data_form']|date_format:"%d-%b-%G"}
|
||||
{$rm_v['data_form']|date_format:"%d-%b-%G"}{if $is_full_date} {$rm_v['data_form']|date_format:"%I:%M %p"}{/if}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10"> </td>
|
||||
@@ -101,7 +102,7 @@
|
||||
<td width="10"> </td>
|
||||
<td align="right" class="text-center">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
{$rm_v['data_to']|date_format:"%d-%b-%G"}
|
||||
{$rm_v['data_to']|date_format:"%d-%b-%G"}{if $is_full_date} {$rm_v['data_to']|date_format:"%I:%M %p"}{/if}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10"> </td>
|
||||
|
||||
@@ -131,6 +131,11 @@
|
||||
{extra_demands_details_html}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center;color:#777;padding:7px 0">
|
||||
{normal_products_data_html}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:7px 0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
|
||||
@@ -17,6 +17,8 @@ Total
|
||||
|
||||
{extra_demands_details_text}
|
||||
|
||||
{normal_products_data_txt}
|
||||
|
||||
{discounts}
|
||||
|
||||
Total Rooms Cost
|
||||
|
||||
@@ -149,6 +149,12 @@
|
||||
{extra_demands_details_html}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="9" style="border:1px solid #D6D4D4;text-align:center;color:#777;padding:7px 0">
|
||||
{normal_products_data_html}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="conf_body">
|
||||
<td bgcolor="#f8f8f8" colspan="4" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
|
||||
@@ -24,6 +24,8 @@ Total
|
||||
|
||||
{extra_demands_details_text}
|
||||
|
||||
{normal_products_data_txt}
|
||||
|
||||
{discounts}
|
||||
|
||||
Total Rooms Cost
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<td width="10"> </td>
|
||||
<td class="text-center">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
{$product['name']}
|
||||
{$product['name']}{if isset($product['option_name']) && $product['option_name']} : {$product['option_name']}{/if}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10"> </td>
|
||||
@@ -47,7 +47,7 @@
|
||||
<td width="10"> </td>
|
||||
<td align="right" class="text-center">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
{convertPrice price=$product['unit_price']}
|
||||
{convertPrice price=$product['unit_price_tax_excl']}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10"> </td>
|
||||
@@ -73,7 +73,7 @@
|
||||
<td width="10"> </td>
|
||||
<td align="right" class="text-center">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
{convertPrice price=$product['price']}
|
||||
{convertPrice price=$product['total_price_tax_excl']}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10"> </td>
|
||||
@@ -71,6 +71,9 @@ class Blockcart extends Module
|
||||
}
|
||||
}
|
||||
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
$serviceProducts = $objRoomTypeServiceProductCartDetail->getProducts($params['cart']->id);
|
||||
|
||||
$priceDisplayMethod = Product::getTaxCalculationMethod((int)$this->context->cookie->id_customer);
|
||||
$nbTotalProducts = 0;
|
||||
|
||||
@@ -112,11 +115,49 @@ class Blockcart extends Module
|
||||
$product['is_gift'] = (isset($product['is_gift']) && $product['is_gift'] )? true : false;
|
||||
$product['hasCustomizedDatas'] = false;
|
||||
$product['hasAttributes'] = false;
|
||||
$product['hasOptions'] = false;
|
||||
|
||||
if (!$product['booking_product']) {
|
||||
if (Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE == $product['service_product_type']) {
|
||||
// $nbTotalProducts += (int) $product['cart_quantity'];
|
||||
$product['hasOptions'] = ServiceProductOption::productHasOptions($product['id_product']);
|
||||
if (Product::SERVICE_PRODUCT_STANDALONE == $product['service_product_type']) {
|
||||
$nbTotalProducts += (int) $product['cart_quantity'];
|
||||
$product['total_price_tax_incl'] = 0;
|
||||
$product['total_price_tax_excl'] = 0;
|
||||
$product['amount'] = 0;
|
||||
$product['options'] = array();
|
||||
foreach ($serviceProducts as $key => $serviceProduct) {
|
||||
if ($serviceProduct['id_product'] == $product['id_product']) {
|
||||
$product['options'][] = $serviceProduct;
|
||||
$product['total_price_tax_incl'] += $serviceProduct['total_price_tax_incl'];
|
||||
$product['total_price_tax_excl'] += $serviceProduct['total_price_tax_excl'];
|
||||
$product['amount'] += $useTax ? $serviceProduct['total_price_tax_incl'] : $serviceProduct['total_price_tax_excl'];
|
||||
}
|
||||
}
|
||||
} elseif (Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL == $product['service_product_type']) {
|
||||
$nbTotalProducts += (int) $product['cart_quantity'];
|
||||
foreach ($serviceProducts as $key => $serviceProduct) {
|
||||
if ($serviceProduct['id_product'] == $product['id_product']) {
|
||||
if (!isset($product['hotel_wise_data'][$serviceProduct['id_hotel']])) {
|
||||
$product['hotel_wise_data'][$serviceProduct['id_hotel']] = array(
|
||||
'id_hotel' => $serviceProduct['id_hotel'],
|
||||
'hotel_name' => $serviceProduct['hotel_name'],
|
||||
'options' => array(),
|
||||
'total_qty' => 0,
|
||||
'total_price_tax_incl' => 0,
|
||||
'total_price_tax_excl' => 0,
|
||||
'amount' => 0
|
||||
);
|
||||
}
|
||||
$product['hotel_wise_data'][$serviceProduct['id_hotel']]['total_price_tax_incl'] += $serviceProduct['total_price_tax_incl'];
|
||||
$product['hotel_wise_data'][$serviceProduct['id_hotel']]['total_price_tax_excl'] += $serviceProduct['total_price_tax_excl'];
|
||||
$product['hotel_wise_data'][$serviceProduct['id_hotel']]['amount'] += $useTax ? $serviceProduct['total_price_tax_incl'] : $serviceProduct['total_price_tax_excl'];
|
||||
$product['hotel_wise_data'][$serviceProduct['id_hotel']]['total_qty'] += $serviceProduct['quantity'];
|
||||
$product['hotel_wise_data'][$serviceProduct['id_hotel']]['options'][] = $serviceProduct;
|
||||
}
|
||||
}
|
||||
if (isset($product['hotel_wise_data'])) {
|
||||
$product['hotel_wise_data'] = array_values($product['hotel_wise_data']);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// getbooking cart data
|
||||
@@ -252,19 +293,29 @@ class Blockcart extends Module
|
||||
$addedProduct['date_from'] = Tools::displayDate($addedProduct['date_from'], null, $fullDate);
|
||||
$addedProduct['date_to'] = Tools::displayDate($addedProduct['date_to'], null, $fullDate);
|
||||
} else {
|
||||
// @todo get price of added product from front
|
||||
$addedProduct['price'] = ProductCore::getPriceStatic(
|
||||
$objProduct->id,
|
||||
$useTax,
|
||||
null,
|
||||
6,
|
||||
null,
|
||||
false,
|
||||
true,
|
||||
$addedProduct['qty']
|
||||
) * $addedProduct['qty'];
|
||||
}
|
||||
if ($objProduct->service_product_type == Product::SERVICE_PRODUCT_STANDALONE) {
|
||||
$addedProduct['unit_price'] = RoomTypeServiceProductPrice::getPrice(
|
||||
$objProduct->id,
|
||||
0,
|
||||
isset($addedProduct['id_service_product_option']) ? $addedProduct['id_service_product_option'] : null,
|
||||
$useTax,
|
||||
$addedProduct['qty']
|
||||
);
|
||||
|
||||
} elseif ($objProduct->service_product_type == Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL) {
|
||||
$addedProduct['unit_price'] = RoomTypeServiceProductPrice::getPrice(
|
||||
$objProduct->id,
|
||||
$addedProduct['id_hotel'],
|
||||
isset($addedProduct['id_service_product_option']) ? $addedProduct['id_service_product_option'] : null,
|
||||
$useTax,
|
||||
$addedProduct['qty']
|
||||
);
|
||||
$objHotel = new HotelBranchInformation($addedProduct['id_hotel'], $this->context->language->id);
|
||||
$addedProduct['hotel_name'] = $objHotel->hotel_name;
|
||||
}
|
||||
$addedProduct['price'] = Tools::displayPrice($addedProduct['unit_price'] * $addedProduct['qty']);
|
||||
$addedProduct['unit_price'] = Tools::displayPrice($addedProduct['unit_price']);
|
||||
}
|
||||
unset($this->context->cookie->currentAddedProduct);
|
||||
}
|
||||
|
||||
@@ -272,6 +323,7 @@ class Blockcart extends Module
|
||||
$totalAdditionalServicesWithAutoAddPrice = $params['cart']->getOrderTotal($useTax, Cart::ONLY_ROOM_SERVICES);
|
||||
$totalConvenienceFee = $params['cart']->getOrderTotal($useTax, Cart::ONLY_CONVENIENCE_FEE);
|
||||
$totalRoomsPrice = $params['cart']->getOrderTotal($useTax, Cart::ONLY_ROOMS);
|
||||
$totalNormalProductPrice = $params['cart']->getOrderTotal($useTax, Cart::ONLY_STANDALONE_PRODUCTS);
|
||||
|
||||
$response = array(
|
||||
'products' => $products,
|
||||
@@ -289,10 +341,13 @@ class Blockcart extends Module
|
||||
'tax_cost' => $tax_cost,
|
||||
'wrapping_cost' => Tools::displayPrice($wrappingCost, $currency),
|
||||
'product_total' => Tools::displayPrice($params['cart']->getOrderTotal($useTax, Cart::ONLY_PRODUCTS), $currency),
|
||||
'room_total' => Tools::displayPrice($totalRoomsPrice + $totalDemandsPrice + $totalAdditionalServicesWithAutoAddPrice - $totalConvenienceFee),
|
||||
'room_total' => ($totalRoomsPrice + $totalDemandsPrice + $totalAdditionalServicesWithAutoAddPrice),
|
||||
'room_total_format' => Tools::displayPrice($totalRoomsPrice + $totalDemandsPrice + $totalAdditionalServicesWithAutoAddPrice - $totalConvenienceFee),
|
||||
'totalToPay' => $totalToPay,
|
||||
'total_convenience_fee' => $totalConvenienceFee,
|
||||
'total_convenience_fee_format' => Tools::displayPrice(($totalConvenienceFee), $currency),
|
||||
'normal_products_total' => $totalNormalProductPrice,
|
||||
'normal_products_total_format' => Tools::displayPrice(($totalNormalProductPrice), $currency),
|
||||
'total' => Tools::displayPrice($totalToPay, $currency),
|
||||
'order_process' => $orderProcess,
|
||||
'ajax_allowed' => (int) (Configuration::get('PS_BLOCK_CART_AJAX')) == 1 ? true : false,
|
||||
@@ -416,10 +471,11 @@ class Blockcart extends Module
|
||||
if ($current_page == 'product') {
|
||||
$id_product = Tools::getValue('id_product');
|
||||
$obj_hotel_room_type = new HotelRoomType();
|
||||
$room_info_by_product_id = $obj_hotel_room_type->getRoomTypeInfoByIdProduct($id_product);
|
||||
$hotel_id = $room_info_by_product_id['id_hotel'];
|
||||
if ($hotel_id) {
|
||||
$max_order_date = HotelOrderRestrictDate::getMaxOrderDate($hotel_id);
|
||||
if ($room_info_by_product_id = $obj_hotel_room_type->getRoomTypeInfoByIdProduct($id_product)) {
|
||||
$hotel_id = $room_info_by_product_id['id_hotel'];
|
||||
if ($hotel_id) {
|
||||
$max_order_date = HotelOrderRestrictDate::getMaxOrderDate($hotel_id);
|
||||
}
|
||||
}
|
||||
} elseif ($current_page == 'category') {
|
||||
$htl_id_category = Tools::getValue('id_category');
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<dl class="products">
|
||||
{foreach from=$products key=data_k item='product' name='myLoop'}
|
||||
{* only show products that are booking or global without room *}
|
||||
{if $product.booking_product || ($product.service_product_type == Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE)}
|
||||
{if $product.booking_product || ($product.service_product_type == Product::SERVICE_PRODUCT_STANDALONE)}
|
||||
{assign var='productId' value=$product.id_product}
|
||||
{assign var='productAttributeId' value=$product.id_product_attribute}
|
||||
<dt data-id="cart_block_product_{$product.id_product|intval}_{if $product.id_product_attribute}{$product.id_product_attribute|intval}{else}0{/if}_{if $product.id_address_delivery}{$product.id_address_delivery|intval}{else}0{/if}" class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}">
|
||||
|
||||
@@ -502,9 +502,10 @@ class HotelCartBookingData extends ObjectModel
|
||||
if ($services = RoomTypeServiceProduct::getAutoAddServices($id_product)) {
|
||||
foreach($services as $service) {
|
||||
$objRoomTypeServiceProductCartDetail->addServiceProductInCart(
|
||||
$id_cart,
|
||||
$service['id_product'],
|
||||
1,
|
||||
$id_cart,
|
||||
false,
|
||||
$obj_htl_cart_booking_data->id
|
||||
);
|
||||
}
|
||||
@@ -512,9 +513,10 @@ class HotelCartBookingData extends ObjectModel
|
||||
if (count($serviceProducts)) {
|
||||
foreach($serviceProducts as $product) {
|
||||
$objRoomTypeServiceProductCartDetail->addServiceProductInCart(
|
||||
$id_cart,
|
||||
$product['id_product'],
|
||||
$product['quantity'],
|
||||
$id_cart,
|
||||
false,
|
||||
$obj_htl_cart_booking_data->id
|
||||
);
|
||||
}
|
||||
|
||||
@@ -383,22 +383,30 @@ class HotelReservationSystemDb
|
||||
KEY `id_product` (`id_product`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE `"._DB_PREFIX_."htl_hotel_service_product_cart_detail` (
|
||||
`id_hotel_service_product_cart_detail` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`id_cart` int(11) unsigned NOT NULL,
|
||||
"CREATE TABLE `"._DB_PREFIX_."service_product_option` (
|
||||
`id_service_product_option` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) UNSIGNED NOT NULL,
|
||||
`id_hotel` int(11) UNSIGNED NOT NULL,
|
||||
`quantity` int(11) UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (`id_hotel_service_product_cart_detail`),
|
||||
KEY `id_product` (`id_product`)
|
||||
`price_impact` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_service_product_option`),
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE `"._DB_PREFIX_."service_product_option_lang` (
|
||||
`id_service_product_option` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`name` varchar(255) character set utf8 NOT NULL,
|
||||
PRIMARY KEY (`id_service_product_option`, `id_lang`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE `"._DB_PREFIX_."htl_room_type_service_product_cart_detail` (
|
||||
`id_room_type_service_product_cart_detail` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) UNSIGNED NOT NULL,
|
||||
`quantity` int(11) UNSIGNED NOT NULL,
|
||||
`id_cart` int(11) unsigned NOT NULL,
|
||||
`id_hotel` int(11) UNSIGNED NOT NULL,
|
||||
`htl_cart_booking_id` int(11) unsigned NOT NULL,
|
||||
`id_service_product_option` int(11) UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (`id_room_type_service_product_cart_detail`),
|
||||
KEY `id_product` (`id_product`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
@@ -409,14 +417,19 @@ class HotelReservationSystemDb
|
||||
`id_order` int(11) NOT NULL,
|
||||
`id_order_detail` int(11) NOT NULL,
|
||||
`id_cart` int(11) NOT NULL,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`id_htl_booking_detail` int(11) NOT NULL,
|
||||
`id_service_product_option` int(11) NOT NULL,
|
||||
`unit_price_tax_excl` decimal(20,6) NOT NULL,
|
||||
`unit_price_tax_incl` decimal(20,6) NOT NULL,
|
||||
`total_price_tax_excl` decimal(20,6) NOT NULL,
|
||||
`total_price_tax_incl` decimal(20,6) NOT NULL,
|
||||
`name` varchar(255) DEFAULT NULL,
|
||||
`option_name` varchar(255) DEFAULT NULL,
|
||||
`quantity` INT(11) UNSIGNED NOT NULL,
|
||||
`auto_added` tinyint(1) unsigned NOT NULL,
|
||||
`is_refunded` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`is_cancelled` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_room_type_service_product_order_detail`)
|
||||
|
||||
@@ -1,299 +0,0 @@
|
||||
<?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 HotelServiceProductCartDetail extends ObjectModel
|
||||
{
|
||||
public $id_hotel_service_product_cart_detail;
|
||||
public $id_cart;
|
||||
public $id_product;
|
||||
public $id_hotel;
|
||||
public $quantity;
|
||||
|
||||
public static $definition = array(
|
||||
'table' => 'htl_hotel_service_product_cart_detail',
|
||||
'primary' => 'id_hotel_service_product_cart_detail',
|
||||
'fields' => array(
|
||||
'id_cart' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'id_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'id_hotel' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'quantity' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
|
||||
),
|
||||
);
|
||||
|
||||
public function alreadyExists(
|
||||
$idProduct,
|
||||
$idHotel,
|
||||
$idCart
|
||||
) {
|
||||
return Db::getInstance()->getValue(
|
||||
'SELECT `id_hotel_service_product_cart_detail` FROM `'._DB_PREFIX_.'htl_hotel_service_product_cart_detail`
|
||||
WHERE `id_cart` = '.(int)$idCart.' AND `id_product` = '.(int)$idProduct.' AND `id_hotel` = '.(int)$idHotel
|
||||
);
|
||||
}
|
||||
|
||||
public function addHotelProductInCart(
|
||||
$idProduct,
|
||||
$quantity,
|
||||
$idHotel,
|
||||
$idCart = null
|
||||
) {
|
||||
|
||||
if (!$idCart) {
|
||||
$context = context::getContext();
|
||||
$idCart = $context->cart->id;
|
||||
}
|
||||
if ($idHotelServiceProductCartDetail = $this->alreadyExists($idProduct, $idHotel, $idCart)) {
|
||||
$objHotelServiceProductCartDetail = new HotelServiceProductCartDetail($idHotelServiceProductCartDetail);
|
||||
$objHotelServiceProductCartDetail->quantity += $quantity;
|
||||
} else {
|
||||
$objHotelServiceProductCartDetail = new HotelServiceProductCartDetail();
|
||||
$objHotelServiceProductCartDetail->id_product = $idProduct;
|
||||
$objHotelServiceProductCartDetail->quantity = $quantity;
|
||||
$objHotelServiceProductCartDetail->id_hotel = $idHotel;
|
||||
$objHotelServiceProductCartDetail->id_cart = $idCart;
|
||||
|
||||
}
|
||||
if ($objHotelServiceProductCartDetail->save()) {
|
||||
$objCart = new Cart($idCart);
|
||||
return $objCart->updateQty($quantity, $idProduct);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function removeProductFromCart($idProduct, $idHotel, $idCart = null, $quantity = null)
|
||||
{
|
||||
if (!$idCart) {
|
||||
$context = context::getContext();
|
||||
$idCart = $context->cart->id;
|
||||
}
|
||||
|
||||
$updateQunatity = false;
|
||||
if ($idHotelServiceProductCartDetail = $this->alreadyExists($idProduct, $idHotel, $idCart)) {
|
||||
$objHotelServiceProductCartDetail = new HotelServiceProductCartDetail($idHotelServiceProductCartDetail);
|
||||
if ($quantity) {
|
||||
$removedQuantity = $quantity;
|
||||
$objHotelServiceProductCartDetail->quantity -= $quantity;
|
||||
if ($objHotelServiceProductCartDetail->quantity) {
|
||||
$updateQunatity = $objHotelServiceProductCartDetail->save();
|
||||
} else {
|
||||
$updateQunatity = $objHotelServiceProductCartDetail->delete();
|
||||
}
|
||||
} else {
|
||||
$removedQuantity = $objHotelServiceProductCartDetail->quantity;
|
||||
$updateQunatity = $objHotelServiceProductCartDetail->delete();
|
||||
}
|
||||
}
|
||||
|
||||
if ($updateQunatity) {
|
||||
$objCart = new Cart($idCart);
|
||||
return $objCart->updateQty((int)$removedQuantity, $idProduct, null, false, 'down');
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getHotelProductUnitPrice(
|
||||
$idCart,
|
||||
$idProduct,
|
||||
$idHotel = 0,
|
||||
$useTax = null
|
||||
) {
|
||||
$totalPrice = $totalQuantity = 0;
|
||||
|
||||
if ($useTax === null) {
|
||||
$useTax = Product::$_taxCalculationMethod == PS_TAX_EXC ? false : true;
|
||||
}
|
||||
$sql = 'SELECT spcd.`id_product`, spcd.`quantity`, spcd.`id_hotel`
|
||||
FROM `'._DB_PREFIX_.'htl_hotel_service_product_cart_detail` spcd
|
||||
WHERE spcd.`id_cart`='.(int) $idCart.' AND spcd.`id_product`='.(int) $idProduct;
|
||||
if ($idHotel) {
|
||||
$sql .= ' AND spcd.`id_hotel`='.(int) $idHotel;
|
||||
}
|
||||
if ($serviceProducts = Db::getInstance()->executeS($sql)) {
|
||||
foreach ($serviceProducts as $product) {
|
||||
$objProduct = new Product($product['id_product']);
|
||||
if (!$objProduct->booking_product) {
|
||||
$idHotelAddress = Cart::getIdAddressForTaxCalculation($idProduct, $product['id_hotel']);
|
||||
$totalQuantity += $product['quantity'] ? (int)$product['quantity'] : 1;
|
||||
$totalPrice += (ProductCore::getPriceStatic(
|
||||
$idProduct,
|
||||
$useTax,
|
||||
null,
|
||||
6,
|
||||
null,
|
||||
false,
|
||||
true,
|
||||
$product['quantity'],
|
||||
false,
|
||||
null,
|
||||
null,
|
||||
$idHotelAddress
|
||||
)* $product['quantity']);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if ($totalPrice && $totalQuantity) {
|
||||
return $totalPrice/(int)$totalQuantity;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getHotelProducts(
|
||||
$idCart,
|
||||
$idProduct = 0,
|
||||
$idHotel = 0,
|
||||
$getTotalPrice = 0,
|
||||
$useTax = null,
|
||||
$idLang = null,
|
||||
$full = false
|
||||
) {
|
||||
if ($useTax === null) {
|
||||
$useTax = Product::$_taxCalculationMethod == PS_TAX_EXC ? false : true;
|
||||
}
|
||||
|
||||
if (!$idLang) {
|
||||
$language = Context::getContext()->language;
|
||||
} else {
|
||||
$language = new Language($idLang);
|
||||
}
|
||||
|
||||
$sql = 'SELECT spcd.`id_product`, spcd.`quantity`, spcd.`id_hotel`';
|
||||
if (!$getTotalPrice) {
|
||||
$sql .= ', hbil.`hotel_name` ';
|
||||
}
|
||||
$sql .= ' FROM `'._DB_PREFIX_.'htl_hotel_service_product_cart_detail` spcd';
|
||||
if (!$getTotalPrice) {
|
||||
$sql .= ' INNER JOIN `'._DB_PREFIX_.'htl_branch_info_lang` hbil ON (hbil.`id` = spcd.`id_hotel` AND hbil.`id_lang` = '. $language->id.')
|
||||
INNER JOIN `'._DB_PREFIX_.'address` a ON (a.`id_hotel` = spcd.`id_hotel`)';
|
||||
}
|
||||
$sql .= ' WHERE spcd.`id_cart`='.(int) $idCart;
|
||||
|
||||
if ($idProduct) {
|
||||
$sql .= ' AND spcd.`id_product`='.(int) $idProduct;
|
||||
}
|
||||
if ($idHotel) {
|
||||
$sql .= ' AND spcd.`id_hotel`='.(int) $idHotel;
|
||||
}
|
||||
|
||||
if ($getTotalPrice) {
|
||||
$totalPrice = 0;
|
||||
}
|
||||
|
||||
$selectedProducts = array();
|
||||
if ($serviceProducts = Db::getInstance()->executeS($sql)) {
|
||||
foreach ($serviceProducts as $product) {
|
||||
$objProduct = new Product($product['id_product'], false, $language->id);
|
||||
if (!$objProduct->booking_product) {
|
||||
if ($getTotalPrice) {
|
||||
$idHotelAddress = Cart::getIdAddressForTaxCalculation($objProduct->id, $product['id_hotel']);
|
||||
$qty = $product['quantity'] ? (int)$product['quantity'] : 1;
|
||||
$totalPrice += Product::getPriceStatic(
|
||||
$objProduct->id,
|
||||
$useTax,
|
||||
null,
|
||||
6,
|
||||
null,
|
||||
false,
|
||||
true,
|
||||
$qty,
|
||||
false,
|
||||
null,
|
||||
null,
|
||||
$idHotelAddress
|
||||
);
|
||||
} else {
|
||||
$context = Context::getContext();
|
||||
$idHotelAddress = Cart::getIdAddressForTaxCalculation($objProduct->id, $product['id_hotel']);
|
||||
$priceTaxIncl = Product::getPriceStatic(
|
||||
$objProduct->id,
|
||||
true,
|
||||
null,
|
||||
6,
|
||||
null,
|
||||
false,
|
||||
true,
|
||||
$product['quantity'],
|
||||
false,
|
||||
null,
|
||||
null,
|
||||
$idHotelAddress
|
||||
);
|
||||
$priceTaxExcl = Product::getPriceStatic(
|
||||
$objProduct->id,
|
||||
false,
|
||||
null,
|
||||
6,
|
||||
null,
|
||||
false,
|
||||
true,
|
||||
$product['quantity'],
|
||||
false,
|
||||
null,
|
||||
null,
|
||||
$idHotelAddress
|
||||
);
|
||||
$coverImageArr = $objProduct->getCover($product['id_product']);
|
||||
if (!empty($coverImageArr)) {
|
||||
$coverImg = $context->link->getImageLink(
|
||||
$objProduct->link_rewrite,
|
||||
$objProduct->id.'-'.$coverImageArr['id_image'],
|
||||
'small_default'
|
||||
);
|
||||
} else {
|
||||
$coverImg = $context->link->getImageLink(
|
||||
$objProduct->link_rewrite,
|
||||
$language->iso_code.'-default',
|
||||
'small_default'
|
||||
);
|
||||
}
|
||||
|
||||
$selectedProducts[$product['id_hotel'].'-'.$product['id_product']] = array(
|
||||
'id_hotel' => $product['id_hotel'],
|
||||
'hotel_name' => $product['hotel_name'],
|
||||
'id_product' =>$objProduct->id,
|
||||
'name' => $objProduct->name,
|
||||
'unit_price_tax_incl' => $priceTaxIncl,
|
||||
'unit_price_tax_excl' => $priceTaxExcl,
|
||||
'quantity' => $product['quantity'],
|
||||
'total_price_tax_incl' => $priceTaxIncl * (int)$product['quantity'],
|
||||
'total_price_tax_excl' => $priceTaxExcl * (int)$product['quantity'],
|
||||
'cover_img' => $coverImg
|
||||
);
|
||||
if ($full) {
|
||||
$objHotelBranchInformation = new HotelBranchInformation();
|
||||
$hotelInfo = $objHotelBranchInformation->hotelBranchesInfo($language->id, 2, 1, $product['id_hotel']);
|
||||
$hotelInfo['location'] = $hotelInfo['hotel_name'].', '.$hotelInfo['city'].
|
||||
($hotelInfo['state_name']?', '.$hotelInfo['state_name']:'').', '.
|
||||
$hotelInfo['country_name'].', '.$hotelInfo['postcode'];
|
||||
$selectedProducts[$product['id_hotel'].'-'.$product['id_product']]['hotel_info'] = $hotelInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if ($getTotalPrice) {
|
||||
return $totalPrice;
|
||||
}
|
||||
return $selectedProducts;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,9 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
|
||||
public $id_product;
|
||||
public $quantity;
|
||||
public $id_cart;
|
||||
public $id_hotel;
|
||||
public $htl_cart_booking_id;
|
||||
public $id_service_product_option;
|
||||
|
||||
public static $definition = array(
|
||||
'table' => 'htl_room_type_service_product_cart_detail',
|
||||
@@ -32,57 +34,40 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
|
||||
'id_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'quantity' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
|
||||
'id_cart' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'id_hotel' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'htl_cart_booking_id' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'id_service_product_option' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
),
|
||||
);
|
||||
|
||||
public function alreadyExists(
|
||||
$idProduct,
|
||||
$idCart,
|
||||
$idHtlCartData
|
||||
$idProduct,
|
||||
$idHtlCartData = false,
|
||||
$idHotel = false,
|
||||
$idServiceProductOption = false
|
||||
) {
|
||||
return Db::getInstance()->getValue(
|
||||
'SELECT `id_room_type_service_product_cart_detail` FROM `'._DB_PREFIX_.'htl_room_type_service_product_cart_detail`
|
||||
WHERE `id_product` = '.(int)$idProduct.' AND `htl_cart_booking_id` = '.(int)$idHtlCartData.'
|
||||
AND `id_cart` = '.(int)$idCart
|
||||
);
|
||||
}
|
||||
|
||||
public function addServiceProductInCart(
|
||||
$idProduct,
|
||||
$quantity,
|
||||
$idCart,
|
||||
$idHtlCartData
|
||||
) {
|
||||
if ($id_room_type_service_product_cart_detail = $this->alreadyExists($idProduct, $idCart, $idHtlCartData)) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail($id_room_type_service_product_cart_detail);
|
||||
} else {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
$objRoomTypeServiceProductCartDetail->id_product = $idProduct;
|
||||
$objRoomTypeServiceProductCartDetail->htl_cart_booking_id = $idHtlCartData;
|
||||
$objRoomTypeServiceProductCartDetail->id_cart = $idCart;
|
||||
$sql = 'SELECT `id_room_type_service_product_cart_detail` FROM `'._DB_PREFIX_.'htl_room_type_service_product_cart_detail`
|
||||
WHERE `id_product` = '.(int)$idProduct.' AND `id_cart` = '.(int)$idCart;
|
||||
|
||||
if ($idHotel) {
|
||||
$sql .= ' AND `id_hotel` = '.(int)$idHotel;
|
||||
}
|
||||
if ($idHtlCartData) {
|
||||
$sql .= ' AND `htl_cart_booking_id` = '.(int)$idHtlCartData;
|
||||
}
|
||||
if ($idServiceProductOption) {
|
||||
$sql .= ' AND `id_service_product_option` = '.(int)$idServiceProductOption;
|
||||
}
|
||||
|
||||
if ($updateQty = $quantity - $objRoomTypeServiceProductCartDetail->quantity) {
|
||||
$way = $updateQty > 0 ? 'up' : 'down';
|
||||
$objRoomTypeServiceProductCartDetail->quantity += $updateQty;
|
||||
if (Product::getProductPriceCalculation($idProduct) == Product::PRICE_CALCULATION_METHOD_PER_DAY) {
|
||||
$objHotelCartBookingData = new HotelCartBookingData($idHtlCartData);
|
||||
$numdays = HotelHelper::getNumberOfDays($objHotelCartBookingData->date_from, $objHotelCartBookingData->date_to);
|
||||
$updateQty *= $numdays;
|
||||
}
|
||||
if ($objRoomTypeServiceProductCartDetail->save()) {
|
||||
$objCart = new Cart($idCart);
|
||||
return $objCart->updateQty((int)abs($updateQty), $idProduct, null, false, $way);
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return Db::getInstance()->getValue($sql);
|
||||
}
|
||||
|
||||
public function removeServiceProductByIdHtlCartBooking($htlCartBookingId, $idService = 0)
|
||||
public function removeServiceProductByIdHtlCartBooking(
|
||||
$htlCartBookingId,
|
||||
$idService = 0
|
||||
)
|
||||
{
|
||||
if ($stadardProductsData = Db::getInstance()->executeS(
|
||||
'SELECT * FROM `' . _DB_PREFIX_ . 'htl_room_type_service_product_cart_detail`
|
||||
@@ -493,35 +478,341 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
|
||||
return $selectedServiceProducts;
|
||||
}
|
||||
|
||||
public function updateCartServiceProduct(
|
||||
$idHtlCartData,
|
||||
$idProduct,
|
||||
$quantity,
|
||||
public function getProducts(
|
||||
$idCart,
|
||||
$operator
|
||||
$idProduct = 0,
|
||||
$serviceProductType = 0,
|
||||
$idHotel = 0,
|
||||
$htlCartBookingId = 0,
|
||||
$idServiceProductOption = null,
|
||||
$roomTypeIdProduct = 0,
|
||||
$getTotalPrice = 0,
|
||||
$useTax = null,
|
||||
$idLang = null,
|
||||
$full = false
|
||||
) {
|
||||
$id_room_type_service_product_cart_detail = $this->alreadyExists($idProduct, $idCart, $idHtlCartData);
|
||||
if ($useTax === null) {
|
||||
$useTax = Product::$_taxCalculationMethod == PS_TAX_EXC ? false : true;
|
||||
}
|
||||
|
||||
if (!$idLang) {
|
||||
$language = Context::getContext()->language;
|
||||
} else {
|
||||
$language = new Language($idLang);
|
||||
}
|
||||
|
||||
$sql = 'SELECT spc.`id_room_type_service_product_cart_detail`, p.`service_product_type`, spc.`id_cart`, spc.`id_product`, spc.`quantity`, spc.`id_hotel`,
|
||||
spc.`id_service_product_option`';
|
||||
if (!$getTotalPrice) {
|
||||
$sql .= ', hbil.`hotel_name` ';
|
||||
}
|
||||
$sql .= ' FROM `'._DB_PREFIX_.'htl_room_type_service_product_cart_detail` spc';
|
||||
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = spc.`id_product`)';
|
||||
if (!$getTotalPrice) {
|
||||
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'htl_branch_info_lang` hbil ON (hbil.`id` = spc.`id_hotel` AND hbil.`id_lang` = '. $language->id.')';
|
||||
// $sql .= ' INNER JOIN `'._DB_PREFIX_.'address` a ON (a.`id_hotel` = spc.`id_hotel`)';
|
||||
}
|
||||
$sql .= ' WHERE spc.`id_cart`='.(int) $idCart;
|
||||
if ($idServiceProductOption) {
|
||||
$sql .= ' AND spc.`id_service_product_option` = '.(int)$idServiceProductOption;
|
||||
}
|
||||
if ($serviceProductType) {
|
||||
$sql .= ' AND p.`service_product_type` = '.(int)$serviceProductType;
|
||||
}
|
||||
if ($idProduct) {
|
||||
$sql .= ' AND spc.`id_product`='.(int) $idProduct;
|
||||
}
|
||||
if ($idHotel) {
|
||||
$sql .= ' AND spc.`id_hotel`='.(int) $idHotel;
|
||||
}
|
||||
if ($idServiceProductOption) {
|
||||
$sql .= ' AND spc.`id_service_product_option` = '.(int)$idServiceProductOption;
|
||||
}
|
||||
if ($getTotalPrice) {
|
||||
$totalPrice = 0;
|
||||
}
|
||||
|
||||
$selectedProducts = array();
|
||||
$objServiceProductOption = new ServiceProductOption();
|
||||
if ($serviceProducts = Db::getInstance()->executeS($sql)) {
|
||||
foreach ($serviceProducts as $product) {
|
||||
$objProduct = new Product($product['id_product'], false, $language->id);
|
||||
if (!$objProduct->booking_product) {
|
||||
if ($getTotalPrice) {
|
||||
$qty = $product['quantity'] ? (int)$product['quantity'] : 1;
|
||||
$totalPrice += RoomTypeServiceProductPrice::getPrice(
|
||||
$objProduct->id,
|
||||
$product['id_hotel'],
|
||||
$product['id_service_product_option'],
|
||||
$useTax,
|
||||
$qty
|
||||
);
|
||||
} else {
|
||||
$context = Context::getContext();
|
||||
$priceTaxIncl = RoomTypeServiceProductPrice::getPrice(
|
||||
$objProduct->id,
|
||||
$product['id_hotel'],
|
||||
$product['id_service_product_option'],
|
||||
true,
|
||||
$product['quantity']
|
||||
);
|
||||
$priceTaxExcl = RoomTypeServiceProductPrice::getPrice(
|
||||
$objProduct->id,
|
||||
$product['id_hotel'],
|
||||
$product['id_service_product_option'],
|
||||
false,
|
||||
$product['quantity']
|
||||
);
|
||||
$optionDetails = false;
|
||||
if (ServiceProductOption::productHasOptions($product['id_product'])) {
|
||||
$optionDetails = $objServiceProductOption->getProductOptions(
|
||||
$objProduct->id,
|
||||
$product['id_service_product_option']
|
||||
);
|
||||
}
|
||||
$coverImageArr = $objProduct->getCover($product['id_product']);
|
||||
if (!empty($coverImageArr)) {
|
||||
$coverImg = $context->link->getImageLink(
|
||||
$objProduct->link_rewrite,
|
||||
$objProduct->id.'-'.$coverImageArr['id_image'],
|
||||
'small_default'
|
||||
);
|
||||
} else {
|
||||
$coverImg = $context->link->getImageLink(
|
||||
$objProduct->link_rewrite,
|
||||
$language->iso_code.'-default',
|
||||
'small_default'
|
||||
);
|
||||
}
|
||||
$productInfo = array(
|
||||
'id_room_type_service_product_cart_detail' => $product['id_room_type_service_product_cart_detail'],
|
||||
'id_cart' => $product['id_cart'],
|
||||
'id_hotel' => $product['id_hotel'],
|
||||
'hotel_name' => $product['hotel_name'],
|
||||
'id_product' =>$objProduct->id,
|
||||
'service_product_type' => $product['service_product_type'],
|
||||
'id_service_product_option' => $product['id_service_product_option'],
|
||||
'name' => $objProduct->name,
|
||||
'option_name' => isset($optionDetails['name']) ? $optionDetails['name'] : false,
|
||||
'minimal_quantity' => $objProduct->minimal_quantity,
|
||||
'allow_multiple_quantity' => $objProduct->allow_multiple_quantity,
|
||||
'max_quantity' => $objProduct->max_quantity,
|
||||
'unit_price_tax_incl' => $priceTaxIncl,
|
||||
'unit_price_tax_excl' => $priceTaxExcl,
|
||||
'quantity' => $product['quantity'],
|
||||
'total_price_tax_incl' => $priceTaxIncl * (int)$product['quantity'],
|
||||
'total_price_tax_excl' => $priceTaxExcl * (int)$product['quantity'],
|
||||
'cover_img' => $coverImg
|
||||
);
|
||||
if ($full) {
|
||||
$objHotelBranchInformation = new HotelBranchInformation();
|
||||
$hotelInfo = $objHotelBranchInformation->hotelBranchesInfo($language->id, 2, 1, $product['id_hotel']);
|
||||
$hotelInfo['location'] = $hotelInfo['hotel_name'].', '.$hotelInfo['city'].
|
||||
($hotelInfo['state_name']?', '.$hotelInfo['state_name']:'').', '.
|
||||
$hotelInfo['country_name'].', '.$hotelInfo['postcode'];
|
||||
$productInfo['hotel_info'] = $hotelInfo;
|
||||
}
|
||||
$selectedProducts[] = $productInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if ($getTotalPrice) {
|
||||
return $totalPrice;
|
||||
}
|
||||
return $selectedProducts;
|
||||
}
|
||||
|
||||
|
||||
public function updateCartServiceProduct(
|
||||
$idCart,
|
||||
$idProduct,
|
||||
$operator,
|
||||
$quantity = false,
|
||||
$idHotel = false,
|
||||
$idHtlCartData = false,
|
||||
$idServiceProductOption = null
|
||||
) {
|
||||
if ($operator == 'up') {
|
||||
return $this->addServiceProductInCart(
|
||||
$idCart,
|
||||
$idProduct,
|
||||
$quantity,
|
||||
$idCart,
|
||||
$idHtlCartData
|
||||
$idHotel,
|
||||
$idHtlCartData,
|
||||
$idServiceProductOption
|
||||
);
|
||||
} else {
|
||||
return $this->removeCartServiceProduct(
|
||||
$idCart,
|
||||
$idProduct,
|
||||
$quantity,
|
||||
$idHotel,
|
||||
$idHtlCartData,
|
||||
$idServiceProductOption
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function addServiceProductInCart(
|
||||
$idCart,
|
||||
$idProduct,
|
||||
$quantity,
|
||||
$idHotel = false,
|
||||
$idHtlCartData = false,
|
||||
$idServiceProductOption = null
|
||||
) {
|
||||
if ($quantity <= 0) {
|
||||
$quantity = 1;
|
||||
}
|
||||
if ($id_room_type_service_product_cart_detail = $this->alreadyExists(
|
||||
$idCart,
|
||||
$idProduct,
|
||||
$idHtlCartData,
|
||||
$idHotel,
|
||||
$idServiceProductOption
|
||||
)) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail($id_room_type_service_product_cart_detail);
|
||||
} else {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
$objRoomTypeServiceProductCartDetail->id_product = $idProduct;
|
||||
$objRoomTypeServiceProductCartDetail->quantity = 0;
|
||||
$objRoomTypeServiceProductCartDetail->id_hotel = $idHotel;
|
||||
$objRoomTypeServiceProductCartDetail->htl_cart_booking_id = $idHtlCartData;
|
||||
$objRoomTypeServiceProductCartDetail->id_cart = $idCart;
|
||||
$objRoomTypeServiceProductCartDetail->id_service_product_option = $idServiceProductOption;
|
||||
}
|
||||
|
||||
if ($idHtlCartData && Product::getProductPriceCalculation($idProduct) == Product::PRICE_CALCULATION_METHOD_PER_DAY) {
|
||||
$objHotelCartBookingData = new HotelCartBookingData($idHtlCartData);
|
||||
$numdays = HotelHelper::getNumberOfDays($objHotelCartBookingData->date_from, $objHotelCartBookingData->date_to);
|
||||
$quantity *= $numdays;
|
||||
}
|
||||
$objRoomTypeServiceProductCartDetail->quantity += $quantity;
|
||||
|
||||
if ($objRoomTypeServiceProductCartDetail->save()) {
|
||||
$objCart = new Cart($idCart);
|
||||
return $objCart->updateQty($quantity, $idProduct);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function removeCartServiceProduct(
|
||||
$idCart,
|
||||
$idProduct,
|
||||
$quantity = false,
|
||||
$idHotel = false,
|
||||
$idHtlCartData = false,
|
||||
$idServiceProductOption = null
|
||||
) {
|
||||
$updateQunatity = false;
|
||||
$res = true;
|
||||
|
||||
if ($idHtlCartData) {
|
||||
$id_room_type_service_product_cart_detail = $this->alreadyExists($idCart, $idProduct, $idHtlCartData);
|
||||
if ($id_room_type_service_product_cart_detail) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail($id_room_type_service_product_cart_detail);
|
||||
$updateQty = $objRoomTypeServiceProductCartDetail->quantity;
|
||||
if ($objRoomTypeServiceProductCartDetail->delete()) {
|
||||
$objCart = new Cart($idCart);
|
||||
return $objCart->updateQty((int)abs($updateQty), $idProduct, null, false, 'down');
|
||||
if ($quantity) {
|
||||
$removedQuantity = $quantity;
|
||||
$objRoomTypeServiceProductCartDetail->quantity -= $quantity;
|
||||
if ($objRoomTypeServiceProductCartDetail->quantity) {
|
||||
$updateQunatity = $objRoomTypeServiceProductCartDetail->save();
|
||||
} else {
|
||||
$updateQunatity = $objRoomTypeServiceProductCartDetail->delete();
|
||||
}
|
||||
} else {
|
||||
$removedQuantity = $objRoomTypeServiceProductCartDetail->quantity;
|
||||
$updateQunatity = $objRoomTypeServiceProductCartDetail->delete();
|
||||
}
|
||||
if ($updateQunatity) {
|
||||
$objCart = new Cart($idCart);
|
||||
if (isset(Context::getContext()->controller->controller_type)) {
|
||||
$controllerType = Context::getContext()->controller->controller_type;
|
||||
} else {
|
||||
$controllerType = 'front';
|
||||
}
|
||||
if ($controllerType == 'admin' || $controllerType == 'moduleadmin') {
|
||||
if ($cartQty = Cart::getProductQtyInCart($idCart, $idProduct)) {
|
||||
if ($removedQuantity < $cartQty) {
|
||||
$res = $res && Db::getInstance()->update(
|
||||
'cart_product',
|
||||
array('quantity' => (int)($cartQty - $removedQuantity)),
|
||||
'`id_product` = '.(int)$idProduct.' AND `id_cart` = '.(int)$idCart
|
||||
);
|
||||
} else {
|
||||
//if room type has no qty remaining in cart then delete row
|
||||
$res = $res && Db::getInstance()->delete(
|
||||
'cart_product',
|
||||
'`id_product` = '.(int)$idProduct.' AND `id_cart` = '.(int)$idCart
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$res = $res && $objCart->updateQty((int)$removedQuantity, $idProduct, null, false, 'down');
|
||||
}
|
||||
}
|
||||
return $res;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if ($products = $this->getProducts($idCart, $idProduct, 0, $idHotel, 0, $idServiceProductOption, 0, 0, $idHtlCartData)) {
|
||||
foreach ($products as $product) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail($product['id_room_type_service_product_cart_detail']);
|
||||
if ($quantity) {
|
||||
$removedQuantity = $quantity;
|
||||
$objRoomTypeServiceProductCartDetail->quantity -= $quantity;
|
||||
if ($objRoomTypeServiceProductCartDetail->quantity) {
|
||||
$updateQunatity = $objRoomTypeServiceProductCartDetail->save();
|
||||
} else {
|
||||
$updateQunatity = $objRoomTypeServiceProductCartDetail->delete();
|
||||
}
|
||||
} else {
|
||||
$removedQuantity = $objRoomTypeServiceProductCartDetail->quantity;
|
||||
$updateQunatity = $objRoomTypeServiceProductCartDetail->delete();
|
||||
}
|
||||
if ($updateQunatity) {
|
||||
$objCart = new Cart($idCart);
|
||||
if (isset(Context::getContext()->controller->controller_type)) {
|
||||
$controllerType = Context::getContext()->controller->controller_type;
|
||||
} else {
|
||||
$controllerType = 'front';
|
||||
}
|
||||
if ($controllerType == 'admin' || $controllerType == 'moduleadmin') {
|
||||
if ($cartQty = Cart::getProductQtyInCart($idCart, $idProduct)) {
|
||||
if ($removedQuantity < $cartQty) {
|
||||
$res = $res && Db::getInstance()->update(
|
||||
'cart_product',
|
||||
array('quantity' => (int)($cartQty - $removedQuantity)),
|
||||
'`id_product` = '.(int)$idProduct.' AND `id_cart` = '.(int)$idCart
|
||||
);
|
||||
} else {
|
||||
//if room type has no qty remaining in cart then delete row
|
||||
$res = $res && Db::getInstance()->delete(
|
||||
'cart_product',
|
||||
'`id_product` = '.(int)$idProduct.' AND `id_cart` = '.(int)$idCart
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$res = $res && $objCart->updateQty((int)$removedQuantity, $idProduct, null, false, 'down');
|
||||
}
|
||||
}
|
||||
if ($quantity) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $res;
|
||||
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getAllServiceProduct($idCart)
|
||||
@@ -541,9 +832,13 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
foreach ($cartProducts as $product) {
|
||||
if (!$product['active'] && !$product['booking_product']) {
|
||||
$serviceProducts = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart($context->cart->id, $product['id_product']);
|
||||
foreach ($serviceProducts as $serviceProduct) {
|
||||
$objRoomTypeServiceProductCartDetail->removeServiceProductByIdHtlCartBooking($serviceProduct['htl_cart_booking_id']);
|
||||
if ($serviceProducts = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
|
||||
$context->cart->id,
|
||||
$product['id_product']
|
||||
)) {
|
||||
foreach ($serviceProducts as $serviceProduct) {
|
||||
$objRoomTypeServiceProductCartDetail->removeServiceProductByIdHtlCartBooking($serviceProduct['htl_cart_booking_id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,14 +25,19 @@ class RoomTypeServiceProductOrderDetail extends ObjectModel
|
||||
public $id_order;
|
||||
public $id_order_detail;
|
||||
public $id_cart;
|
||||
public $id_hotel;
|
||||
public $id_htl_booking_detail;
|
||||
public $id_service_product_option;
|
||||
public $unit_price_tax_excl;
|
||||
public $unit_price_tax_incl;
|
||||
public $total_price_tax_excl;
|
||||
public $total_price_tax_incl;
|
||||
public $name;
|
||||
public $option_name;
|
||||
public $quantity;
|
||||
public $auto_added;
|
||||
public $is_refunded;
|
||||
public $is_cancelled;
|
||||
public $date_add;
|
||||
public $date_upd;
|
||||
|
||||
@@ -44,14 +49,19 @@ class RoomTypeServiceProductOrderDetail extends ObjectModel
|
||||
'id_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_order_detail' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_cart' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_htl_booking_detail' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_hotel' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'id_htl_booking_detail' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'id_service_product_option' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'unit_price_tax_excl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true),
|
||||
'unit_price_tax_incl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true),
|
||||
'total_price_tax_excl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true),
|
||||
'total_price_tax_incl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true),
|
||||
'name' => array('type' => self::TYPE_STRING, 'required' => true),
|
||||
'option_name' => array('type' => self::TYPE_STRING),
|
||||
'quantity' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true),
|
||||
'auto_added' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||
'is_refunded' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'is_cancelled' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
)
|
||||
@@ -309,6 +319,141 @@ class RoomTypeServiceProductOrderDetail extends ObjectModel
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function getProducts($idOrder, $idOrderDetail = 0, $idProduct = 0, $serviceProductType = 0)
|
||||
{
|
||||
$sql = 'SELECT spo.* FROM `'._DB_PREFIX_.'htl_room_type_service_product_order_detail` spo';
|
||||
|
||||
if ($serviceProductType) {
|
||||
$sql .= ' INNER JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order_detail` = spo.`id_order_detail` AND od.`id_order` = '.(int)$idOrder.')';
|
||||
}
|
||||
|
||||
$sql .= ' WHERE 1 AND spo.`id_order` = '.(int)$idOrder;
|
||||
|
||||
if ($idOrderDetail) {
|
||||
$sql .= ' AND spo.`id_order_detail` = '.(int)$idOrderDetail;
|
||||
}
|
||||
|
||||
if ($idProduct) {
|
||||
$sql .= ' AND spo.`id_product` = '.(int)$idProduct;
|
||||
}
|
||||
|
||||
if ($serviceProductType) {
|
||||
$sql .= ' AND od.`product_service_type` = '.(int)$serviceProductType;
|
||||
}
|
||||
|
||||
$products = Db::getInstance()->executeS($sql);
|
||||
foreach ($products as $key => $product) {
|
||||
// Check if this booking as any refund history then enter refund data
|
||||
if ($refundInfo = OrderReturn::getOrdersReturnDetail($idOrder, 0, 0, $product['id_room_type_service_product_order_detail'])) {
|
||||
$products[$key]['refund_info'] = reset($refundInfo);
|
||||
}
|
||||
}
|
||||
|
||||
return $products;
|
||||
}
|
||||
|
||||
public function processRefundInTable()
|
||||
{
|
||||
if (Validate::isLoadedObject($this)) {
|
||||
$reduction_amount = array(
|
||||
'total_price_tax_excl' => 0,
|
||||
'total_price_tax_incl' => 0,
|
||||
'total_products_tax_excl' => 0,
|
||||
'total_products_tax_incl' => 0,
|
||||
);
|
||||
$objOrder = new Order($this->id_order);
|
||||
$orderTotalPaid = $objOrder->getTotalPaid();
|
||||
$orderDiscounts = $objOrder->getCartRules();
|
||||
|
||||
$hasOrderDiscountOrPayment = ((float)$orderTotalPaid > 0 || $orderDiscounts) ? true : false;
|
||||
|
||||
// things to do if order is not paid
|
||||
if (!$hasOrderDiscountOrPayment) {
|
||||
$objHotelBookingDemands = new HotelBookingDemands();
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
|
||||
$reduction_amount['total_price_tax_excl'] = (float) $this->total_price_tax_excl;
|
||||
$reduction_amount['total_products_tax_excl'] = (float) $this->total_price_tax_excl;
|
||||
$reduction_amount['total_price_tax_incl'] = (float) $this->total_price_tax_incl;
|
||||
$reduction_amount['total_products_tax_incl'] = (float) $this->total_price_tax_incl;
|
||||
}
|
||||
|
||||
// enter refunded quantity in the order detail table
|
||||
$idOrderDetail = $this->id_order_detail;
|
||||
if (Validate::isLoadedObject($objOrderDetail = new OrderDetail($idOrderDetail))) {
|
||||
|
||||
$objOrderDetail->product_quantity_refunded += $this->quantity;
|
||||
if ($objOrderDetail->product_quantity_refunded > $objOrderDetail->product_quantity) {
|
||||
$objOrderDetail->product_quantity_refunded = $objOrderDetail->product_quantity;
|
||||
}
|
||||
|
||||
if (!$hasOrderDiscountOrPayment) {
|
||||
// reduce room amount from order and order detail
|
||||
$objOrderDetail->total_price_tax_incl -= Tools::processPriceRounding(
|
||||
$this->total_price_tax_incl,
|
||||
1,
|
||||
$objOrder->round_type,
|
||||
$objOrder->round_mode
|
||||
);
|
||||
|
||||
$objOrderDetail->total_price_tax_excl -= Tools::processPriceRounding(
|
||||
$this->total_price_tax_excl,
|
||||
1,
|
||||
$objOrder->round_type,
|
||||
$objOrder->round_mode
|
||||
);
|
||||
|
||||
if (Validate::isLoadedObject($objOrder = new Order($this->id_order))) {
|
||||
$objOrder->total_paid = Tools::ps_round(
|
||||
($objOrder->total_paid - $reduction_amount['total_price_tax_incl']),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$objOrder->total_paid = $objOrder->total_paid > 0 ? $objOrder->total_paid : 0;
|
||||
|
||||
$objOrder->total_paid_tax_excl = Tools::ps_round(($objOrder->total_paid_tax_excl - $reduction_amount['total_price_tax_excl']),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$objOrder->total_paid_tax_excl = $objOrder->total_paid_tax_excl > 0 ? $objOrder->total_paid_tax_excl : 0;
|
||||
|
||||
$objOrder->total_paid_tax_incl = Tools::ps_round(($objOrder->total_paid_tax_incl - $reduction_amount['total_price_tax_incl']),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$objOrder->total_paid_tax_incl = $objOrder->total_paid_tax_incl > 0 ? $objOrder->total_paid_tax_incl : 0;
|
||||
|
||||
$objOrder->total_products = Tools::ps_round(($objOrder->total_products - $reduction_amount['total_products_tax_excl']),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$objOrder->total_products = $objOrder->total_products > 0 ? $objOrder->total_products : 0;
|
||||
|
||||
$objOrder->total_products_wt = Tools::ps_round(($objOrder->total_products_wt - $reduction_amount['total_products_tax_incl']),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$objOrder->total_products_wt = $objOrder->total_products_wt > 0 ? $objOrder->total_products_wt : 0;
|
||||
|
||||
$objOrder->save();
|
||||
}
|
||||
}
|
||||
|
||||
$objOrderDetail->save();
|
||||
}
|
||||
|
||||
// as refund is completed then set the booking as refunded
|
||||
$this->is_refunded = 1;
|
||||
if (!$hasOrderDiscountOrPayment) {
|
||||
// Reduce room amount from htl_booking_detail
|
||||
$this->is_cancelled = 1;
|
||||
$this->total_price_tax_excl = 0;
|
||||
$this->total_price_tax_incl = 0;
|
||||
}
|
||||
|
||||
$this->save();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
// delete entry from order detail table.
|
||||
|
||||
@@ -101,6 +101,32 @@ class RoomTypeServiceProductPrice extends ObjectModel
|
||||
);
|
||||
}
|
||||
|
||||
public static function getPrice(
|
||||
$idProduct,
|
||||
$idHotel,
|
||||
$idServiceProductOption = null,
|
||||
$useTax = null,
|
||||
$quantity = 1
|
||||
) {
|
||||
$idHotelAddress = Cart::getIdAddressForTaxCalculation($idProduct, $idHotel);
|
||||
$price = ProductCore::getPriceStatic(
|
||||
$idProduct,
|
||||
$useTax,
|
||||
$idServiceProductOption,
|
||||
6,
|
||||
null,
|
||||
false,
|
||||
true,
|
||||
$quantity,
|
||||
false,
|
||||
null,
|
||||
null,
|
||||
$idHotelAddress,
|
||||
);
|
||||
|
||||
return $price;
|
||||
}
|
||||
|
||||
public function getServicePrice(
|
||||
$idProduct,
|
||||
$idProductRoomType,
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a 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
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
|
||||
class ServiceProductOption extends ObjectModel
|
||||
{
|
||||
public $id_service_product_option;
|
||||
public $id_product;
|
||||
public $name;
|
||||
public $price_impact;
|
||||
public $date_add;
|
||||
public $date_upd;
|
||||
|
||||
public static $definition = array(
|
||||
'table' => 'service_product_option',
|
||||
'primary' => 'id_service_product_option',
|
||||
'multilang' => true,
|
||||
'fields' => array(
|
||||
'id_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'price_impact' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true),
|
||||
'name' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'lang' => true, 'required' => true),
|
||||
)
|
||||
);
|
||||
|
||||
public function addProductOption($idProduct, $names, $priceImpact)
|
||||
{
|
||||
if (!is_array($names)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$objServiceProductOption = new ServiceProductOption();
|
||||
$objServiceProductOption->id_product = $idProduct;
|
||||
$objServiceProductOption->price_impact = $priceImpact;
|
||||
foreach($names as $id_lang => $name) {
|
||||
$objServiceProductOption->name[$id_lang] = $name;
|
||||
}
|
||||
$objServiceProductOption->save();
|
||||
}
|
||||
|
||||
public static function productHasOptions($idProduct, $idServiceProductOption = false)
|
||||
{
|
||||
|
||||
$sql = 'SELECT po.`id_service_product_option`
|
||||
FROM `'._DB_PREFIX_.'service_product_option` po
|
||||
WHERE po.`id_product` = '.(int)$idProduct;
|
||||
if ($idServiceProductOption) {
|
||||
$sql .= ' AND po.`id_service_product_option` = '.(int)$idServiceProductOption;
|
||||
}
|
||||
return (bool)Db::getInstance()->getValue($sql);
|
||||
}
|
||||
|
||||
public function getProductOptions($idProduct, $idServiceProductOption = false, $idLang = false)
|
||||
{
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
|
||||
$sql = 'SELECT po.`id_service_product_option`, po.`id_product`, pol.`id_lang`, pol.`name`, po.`price_impact`
|
||||
FROM `'._DB_PREFIX_.'service_product_option` po
|
||||
INNER JOIN `'._DB_PREFIX_.'service_product_option_lang` pol
|
||||
ON (po.`id_service_product_option` = pol.`id_service_product_option`)
|
||||
WHERE po.`id_product` = '.(int)$idProduct.' AND pol.`id_lang` = '.(int)$idLang;
|
||||
|
||||
if ($idServiceProductOption) {
|
||||
$sql .= ' AND po.`id_service_product_option` = '.(int)$idServiceProductOption;
|
||||
return Db::getInstance()->getRow($sql);
|
||||
} else {
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,9 +37,9 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
|
||||
$this->createNewCart();
|
||||
if (isset($this->context->cookie->id_cart)) {
|
||||
$objCart = new Cart($this->context->cookie->id_cart);
|
||||
$objCart = new Cart(74);
|
||||
if (Validate::isLoadedObject($objCart) && !$objCart->orderExists()) {
|
||||
$this->context->cart = $objCart;
|
||||
|
||||
@@ -75,7 +75,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
Guest::setNewGuest($this->context->cookie);
|
||||
}
|
||||
|
||||
$this->context->cart = new Cart();
|
||||
$this->context->cart = new Cart(74);
|
||||
$this->context->cart->gift = 0;
|
||||
$this->context->cart->id_shop = (int) $this->context->shop->id;
|
||||
$this->context->cart->id_lang = (($id_lang = (int) Tools::getValue('id_lang')) ? $id_lang : (int) Configuration::get('PS_LANG_DEFAULT'));
|
||||
@@ -149,6 +149,12 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
$occupancy = array();
|
||||
}
|
||||
|
||||
// if (Tools::getValue('booking_product')) {
|
||||
// $booking_product = Tools::getValue('booking_product');
|
||||
// } else {
|
||||
// $booking_product = 1;
|
||||
// }
|
||||
|
||||
$this->id_cart = (int) $this->context->cart->id;
|
||||
$this->id_guest = (int) $this->context->cookie->id_guest;
|
||||
$this->id_hotel = $id_hotel;
|
||||
@@ -393,7 +399,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
'id_guest' => $this->id_guest,
|
||||
);
|
||||
$objHotelCartBookingData = new HotelCartBookingData();
|
||||
$objHotelServiceProductCartDetail = new HotelServiceProductCartDetail();
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
|
||||
if ($cartProducts = $this->context->cart->getProducts()) {
|
||||
if ($cart_bdata = $objHotelCartBookingData->getCartFormatedBookinInfoByIdCart(
|
||||
@@ -401,7 +407,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
)) {
|
||||
$smartyVars['cart_bdata'] = $cart_bdata;
|
||||
}
|
||||
if ($normalCartProduct = $objHotelServiceProductCartDetail->getHotelProducts($this->context->cart->id)) {
|
||||
if ($normalCartProduct = $objRoomTypeServiceProductCartDetail->getProducts($this->context->cart->id)) {
|
||||
$smartyVars['cart_normal_data'] = $normalCartProduct;
|
||||
}
|
||||
}
|
||||
@@ -596,17 +602,19 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
);
|
||||
$id_product = Tools::getValue('id_product');
|
||||
$quantity = Tools::getValue('qty', 1);
|
||||
$id_cart = $this->context->cart->id;
|
||||
$id_hotel = Tools::getValue('id_hotel');
|
||||
$opt = Tools::getValue('opt', 1);
|
||||
|
||||
if (!Validate::isLoadedObject($this->context->cart)) {
|
||||
$this->createNewCart();
|
||||
}
|
||||
$id_cart = $this->context->cart->id;
|
||||
if ($opt) {
|
||||
// validation for adding product in cart
|
||||
$product = new Product($id_product, true, $this->context->language->id);
|
||||
if (!$product->id || !$product->active) {
|
||||
$this->errors[] = $this->l('This product is no longer available.');
|
||||
}
|
||||
if ($product->booking_product || ($product->service_product_type != Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE)) {
|
||||
if ($product->booking_product || ($product->service_product_type != Product::SERVICE_PRODUCT_STANDALONE)) {
|
||||
// cannot be added without room type or is a booking product.
|
||||
$this->errors[] = $this->l('This product is either a room type or additional service and cannot be added thorugh this method.');
|
||||
} elseif (!$product->allow_multiple_quantity) {
|
||||
@@ -628,16 +636,16 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
|
||||
if (empty($this->errors)) {
|
||||
if ($opt) {
|
||||
$objHotelServiceProductCartDetail = new HotelServiceProductCartDetail();
|
||||
if ($objHotelServiceProductCartDetail->addHotelProductInCart($product->id, $quantity, $id_hotel)) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
if ($objRoomTypeServiceProductCartDetail->addServiceProductInCart($id_cart, $product->id, $quantity, $id_hotel, $quantity)) {
|
||||
$response = array(
|
||||
'status' => true,
|
||||
'total_amount' => $this->context->cart->getOrderTotal()
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$objHotelServiceProductCartDetail = new HotelServiceProductCartDetail();
|
||||
if ($objHotelServiceProductCartDetail->removeProductFromCart($id_product, $id_hotel)) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
if ($objRoomTypeServiceProductCartDetail->removeCartServiceProduct($id_cart, $id_product, false, $id_hotel)) {
|
||||
$response = array(
|
||||
'status' => true,
|
||||
'total_amount' => $this->context->cart->getOrderTotal()
|
||||
@@ -778,7 +786,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
public function assignServiceProductsForm()
|
||||
{
|
||||
$objProduct = new Product();
|
||||
$serviceProducts = $objProduct->getServiceProducts(null, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE);
|
||||
$serviceProducts = $objProduct->getServiceProducts(null, Product::SERVICE_PRODUCT_STANDALONE);
|
||||
$hotelAddressInfo = HotelBranchInformation::getAddress($this->id_hotel);
|
||||
$serviceProducts = Product::getProductsProperties($this->context->language->id, $serviceProducts);
|
||||
$this->context->smarty->assign(array(
|
||||
@@ -954,7 +962,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
'ALLOTMENT_AUTO' => HotelBookingDetail::ALLOTMENT_AUTO,
|
||||
'ALLOTMENT_MANUAL' => HotelBookingDetail::ALLOTMENT_MANUAL,
|
||||
'SERVICE_PRODUCT_WITH_ROOMTYPE' => Product::SERVICE_PRODUCT_WITH_ROOMTYPE,
|
||||
'SERVICE_PRODUCT_WITHOUT_ROOMTYPE' => Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE,
|
||||
'SERVICE_PRODUCT_STANDALONE' => Product::SERVICE_PRODUCT_STANDALONE,
|
||||
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
|
||||
'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'),
|
||||
'occupancy_required_for_booking' => $occupancyRequiredForBooking,
|
||||
|
||||
@@ -216,6 +216,10 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
|
||||
}
|
||||
}
|
||||
|
||||
if ($refundReqProducts = $objOrderReturn->getOrderRefundRequestedProducts($objOrderReturn->id_order, $objOrderReturn->id)){
|
||||
}
|
||||
|
||||
|
||||
$paymentMethods = array();
|
||||
foreach (PaymentModule::getInstalledPaymentModules() as $payment) {
|
||||
$module = Module::getInstanceByName($payment['name']);
|
||||
@@ -235,6 +239,7 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
|
||||
'customer_email' => $objCustomer->email,
|
||||
'orderReturnInfo' => (array)$objOrderReturn,
|
||||
'refundReqBookings' => $refundReqBookings,
|
||||
'refundReqProducts' => $refundReqProducts,
|
||||
'orderInfo' => (array) $objOrder,
|
||||
'orderCurrency' => (array) $orderCurrency,
|
||||
'currentOrderStateInfo' => (array) new OrderState($objOrder->current_state,
|
||||
@@ -352,17 +357,21 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
|
||||
foreach ($idsReturnDetail as $idRetDetail) {
|
||||
$objOrderReturnDetail = new OrderReturnDetail($idRetDetail);
|
||||
// set booking as refunded if return state is refunded/denied
|
||||
$idHtlBooking = $objOrderReturnDetail->id_htl_booking;
|
||||
$reduction_amount = array(
|
||||
'total_price_tax_excl' => 0,
|
||||
'total_price_tax_incl' => 0,
|
||||
'total_products_tax_excl' => 0,
|
||||
'total_products_tax_incl' => 0,
|
||||
);
|
||||
|
||||
$objHtlBooking = new HotelBookingDetail($idHtlBooking);
|
||||
// perform booking refund processes in the booking tables
|
||||
$objHtlBooking->processRefundInBookingTables();
|
||||
if ($idHtlBooking = $objOrderReturnDetail->id_htl_booking) {
|
||||
$objHtlBooking = new HotelBookingDetail($idHtlBooking);
|
||||
// perform booking refund processes in the booking tables
|
||||
$objHtlBooking->processRefundInBookingTables();
|
||||
} elseif ($id_room_type_service_product_order_detail = $objOrderReturnDetail->id_room_type_service_product_order_detail) {
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail($id_room_type_service_product_order_detail);
|
||||
// perform booking refund processes in the service product order tables
|
||||
$objRoomTypeServiceProductOrderDetail->processRefundInTable();
|
||||
}
|
||||
|
||||
// save individual booking amount for every booking refund
|
||||
$refundedAmount = $refundedAmounts[$idRetDetail];
|
||||
@@ -375,22 +384,34 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
|
||||
$totalRefundedAmount += $refundedAmount;
|
||||
|
||||
if (Tools::isSubmit('generateCreditSlip')) {
|
||||
$numDays = $objHtlBooking->getNumberOfDays(
|
||||
$objHtlBooking->date_from,
|
||||
$objHtlBooking->date_to
|
||||
);
|
||||
if ($idHtlBooking = $objOrderReturnDetail->id_htl_booking) {
|
||||
|
||||
$objHtlBooking = new HotelBookingDetail($idHtlBooking);
|
||||
$idOrderDetail = $objHtlBooking->id_order_detail;
|
||||
$numDays = $objHtlBooking->getNumberOfDays(
|
||||
$objHtlBooking->date_from,
|
||||
$objHtlBooking->date_to
|
||||
);
|
||||
|
||||
$bookingList[$idHtlBooking] = array(
|
||||
'id_htl_booking' => $idHtlBooking,
|
||||
'id_order_detail' => $idOrderDetail,
|
||||
'quantity' => $numDays,
|
||||
'num_days' => $numDays,
|
||||
'unit_price' => $refundedAmount / $numDays,
|
||||
'amount' => $refundedAmount,
|
||||
);
|
||||
$objHtlBooking = new HotelBookingDetail($idHtlBooking);
|
||||
$idOrderDetail = $objHtlBooking->id_order_detail;
|
||||
|
||||
$bookingList[$idHtlBooking] = array(
|
||||
'id_htl_booking' => $idHtlBooking,
|
||||
'id_order_detail' => $idOrderDetail,
|
||||
'quantity' => $numDays,
|
||||
'num_days' => $numDays,
|
||||
'unit_price' => $refundedAmount / $numDays,
|
||||
'amount' => $refundedAmount,
|
||||
);
|
||||
} elseif ($id_room_type_service_product_order_detail = $objOrderReturnDetail->id_room_type_service_product_order_detail) {
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail($id_room_type_service_product_order_detail);
|
||||
$bookingList[$idHtlBooking] = array(
|
||||
'id_room_type_service_product_order_detail' => $id_room_type_service_product_order_detail,
|
||||
'id_order_detail' => $objRoomTypeServiceProductOrderDetail->id_order_detail,
|
||||
'quantity' => $objRoomTypeServiceProductOrderDetail->quantity,
|
||||
'unit_price' => $refundedAmount / $objRoomTypeServiceProductOrderDetail->quantity,
|
||||
'amount' => $refundedAmount,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ require_once 'classes/RoomTypeServiceProduct.php';
|
||||
require_once 'classes/RoomTypeServiceProductPrice.php';
|
||||
require_once 'classes/RoomTypeServiceProductCartDetail.php';
|
||||
require_once 'classes/RoomTypeServiceProductOrderDetail.php';
|
||||
require_once 'classes/HotelServiceProductCartDetail.php';
|
||||
require_once 'classes/ServiceProductOption.php';
|
||||
|
||||
|
||||
require_once 'classes/HotelSettingsLink.php';
|
||||
|
||||
@@ -221,6 +221,75 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if isset($refundReqProducts) && $refundReqProducts}
|
||||
<br>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12">
|
||||
<label for="id_refund_state" class="control-label">
|
||||
<p><span title="" data-toggle="tooltip" class="label-tooltip" data-original-title='{l s="List of product requested for refund by the customer." mod='hotelreservationsystem'}'><strong>{l s="Products requested for refund" mod='hotelreservationsystem'}</strong></span> :
|
||||
</p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<table class="table" id="rooms_refund_info">
|
||||
<tr>
|
||||
{if !$isRefundCompleted}
|
||||
<th></th>
|
||||
{/if}
|
||||
<th>{l s='Name' mod='hotelreservationsystem'}</th>
|
||||
<th>{l s='Quantity' mod='hotelreservationsystem'}</th>
|
||||
<th>{l s='Total cost (tax incl.)' mod='hotelreservationsystem'}</th>
|
||||
<th>{l s='Total paid amount (tax incl.)' mod='hotelreservationsystem'}</th>
|
||||
|
||||
{if $hasOrderDiscountOrPayment || $isRefundCompleted}
|
||||
<th>{l s='Refund amount' mod='hotelreservationsystem'}</th>
|
||||
|
||||
{if $isRefundCompleted}
|
||||
<th>{l s='Refund status' mod='hotelreservationsystem'}</th>
|
||||
{/if}
|
||||
{/if}
|
||||
</tr>
|
||||
{foreach $refundReqProducts as $product}
|
||||
<tr>
|
||||
{if !$isRefundCompleted}
|
||||
<td><input type="checkbox" name="id_order_return_detail[]" value="{$product['id_order_return_detail']|escape:'html':'UTF-8'}" checked/></td>
|
||||
{/if}
|
||||
<td>{$product['name']|escape:'htmlall':'UTF-8'}{if isset($product['option_name']) && $product['option_name']} : {$product['option_name']|escape:'htmlall':'UTF-8'}{/if}</td>
|
||||
<td>{$product['quantity']|escape:'htmlall':'UTF-8'}</td>
|
||||
<td>{displayPrice price=$product['total_price_tax_incl'] currency=$orderCurrency['id']}</td>
|
||||
<td>{displayPrice price=$product['paid_amount'] currency=$orderCurrency['id']}</td>
|
||||
{if $hasOrderDiscountOrPayment || $isRefundCompleted}
|
||||
<td>
|
||||
<div class="input-group">
|
||||
{if $isRefundCompleted}
|
||||
{displayPrice price=$product['refunded_amount'] currency=$orderCurrency['id']}
|
||||
{else}
|
||||
<span class="input-group-addon">{$orderCurrency['sign']|escape:'html':'UTF-8'}</span>
|
||||
<input placeholder="" type="text" name="refund_amounts[{$product['id_order_return_detail']|escape:'html':'UTF-8'}]" value="0">
|
||||
<span class="input-group-addon">{l s='tax incl.' mod='hotelreservationsystem'}</span>
|
||||
{/if}
|
||||
</div>
|
||||
</td>
|
||||
{if $isRefundCompleted}
|
||||
<td>
|
||||
{if $product['is_cancelled']}
|
||||
<span class="badge badge-danger">{l s='Cancelled' mod='hotelreservationsystem'}</span>
|
||||
{* used id_customization to check if in this request which bookings are refunded or not*}
|
||||
{else if $product['id_customization']}
|
||||
<span class="badge badge-success">{l s='Refunded' mod='hotelreservationsystem'}</span>
|
||||
{else}
|
||||
<span class="badge badge-danger">{l s='Denied' mod='hotelreservationsystem'}</span>
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
{/if}
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<br>
|
||||
|
||||
{if $isRefundCompleted}
|
||||
|
||||
@@ -126,17 +126,20 @@ class QloHotelReview extends Module
|
||||
{
|
||||
if (Tools::getValue('controller') == 'product') {
|
||||
$idProduct = Tools::getValue('id_product');
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
$roomTypeInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($idProduct);
|
||||
$idHotel = $roomTypeInfo['id_hotel'];
|
||||
$reviewImages = QhrHotelReview::getAllImages($idHotel);
|
||||
|
||||
Media::addJsDef(array('qlo_hotel_review_js_vars' => array(
|
||||
$qlo_hotel_review_js_vars = array(
|
||||
'review_ajax_link' => $this->context->link->getModuleLink($this->name),
|
||||
'review_ajax_token' => $this->secure_key,
|
||||
'raty_img_path' => $this->getPathUri().'views/img/raty',
|
||||
'review_images' => $reviewImages,
|
||||
)));
|
||||
);
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
if ($roomTypeInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($idProduct)) {
|
||||
$idHotel = $roomTypeInfo['id_hotel'];
|
||||
$reviewImages = QhrHotelReview::getAllImages($idHotel);
|
||||
$qlo_hotel_review_js_vars['review_images'] = $reviewImages;
|
||||
|
||||
}
|
||||
Media::addJsDef(array('qlo_hotel_review_js_vars' => $qlo_hotel_review_js_vars));
|
||||
|
||||
|
||||
$this->context->controller->addCSS(_PS_JS_DIR_.'raty/jquery.raty.css');
|
||||
$this->context->controller->addJS(_PS_JS_DIR_.'raty/jquery.raty.js');
|
||||
@@ -215,17 +218,19 @@ class QloHotelReview extends Module
|
||||
|
||||
public function hookDisplayRoomTypeDetailRoomTypeNameAfter($params)
|
||||
{
|
||||
$idProduct = $params['id_product'];
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
$roomTypeInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($idProduct);
|
||||
$idHotel = $roomTypeInfo['id_hotel'];
|
||||
$this->smarty->assign(array(
|
||||
'num_reviews' => QhrHotelReview::getReviewCountByIdHotel($idHotel),
|
||||
'avg_rating' => QhrHotelReview::getAverageRatingByIdHotel($idHotel),
|
||||
'ratting_img_path' => _MODULE_DIR_.'hotelreservationsystem/views/img/Slices/icons-sprite.png',
|
||||
));
|
||||
if ($params['product']->booking_product) {
|
||||
$idProduct = $params['id_product'];
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
$roomTypeInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($idProduct);
|
||||
$idHotel = $roomTypeInfo['id_hotel'];
|
||||
$this->smarty->assign(array(
|
||||
'num_reviews' => QhrHotelReview::getReviewCountByIdHotel($idHotel),
|
||||
'avg_rating' => QhrHotelReview::getAverageRatingByIdHotel($idHotel),
|
||||
'ratting_img_path' => _MODULE_DIR_.'hotelreservationsystem/views/img/Slices/icons-sprite.png',
|
||||
));
|
||||
|
||||
return $this->display(__FILE__, 'room-type-name-after.tpl');
|
||||
return $this->display(__FILE__, 'room-type-name-after.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
public function hookActionRoomBookingStatusUpdateAfter($params)
|
||||
@@ -236,48 +241,51 @@ class QloHotelReview extends Module
|
||||
}
|
||||
}
|
||||
|
||||
public function hookDisplayProductTab()
|
||||
public function hookDisplayProductTab($params)
|
||||
{
|
||||
return $this->display(__FILE__, 'product-tab.tpl');
|
||||
if ($params['product']->booking_product) {
|
||||
return $this->display(__FILE__, 'product-tab.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
public function hookDisplayProductTabContent()
|
||||
public function hookDisplayProductTabContent($params)
|
||||
{
|
||||
$idProduct = Tools::getValue('id_product');
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
$roomTypeInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($idProduct);
|
||||
$idHotel = $roomTypeInfo['id_hotel'];
|
||||
$reviewsAtOnce = (int) Configuration::get('QHR_REVIEWS_AT_ONCE');
|
||||
$reviews = QhrHotelReview::getByHotel(
|
||||
$idHotel,
|
||||
1,
|
||||
$reviewsAtOnce,
|
||||
QhrHotelReview::QHR_SORT_BY_TIME_NEW,
|
||||
$this->context->cookie->id_customer
|
||||
);
|
||||
if ($params['product']->booking_product) {
|
||||
$idProduct = Tools::getValue('id_product');
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
$reviewsAtOnce = (int) Configuration::get('QHR_REVIEWS_AT_ONCE');
|
||||
if ($roomTypeInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($idProduct)) {
|
||||
$idHotel = $roomTypeInfo['id_hotel'];
|
||||
$reviews = QhrHotelReview::getByHotel(
|
||||
$idHotel,
|
||||
1,
|
||||
$reviewsAtOnce,
|
||||
QhrHotelReview::QHR_SORT_BY_TIME_NEW,
|
||||
$this->context->cookie->id_customer
|
||||
);
|
||||
if (is_array($reviews) && count($reviews)) {
|
||||
foreach ($reviews as &$review) {
|
||||
$review['images'] = QhrHotelReview::getImagesById($review['id_hotel_review']);
|
||||
}
|
||||
}
|
||||
$summary = QhrHotelReview::getSummaryByHotel($idHotel);
|
||||
if (is_array($summary['categories']) && count($summary['categories'])) {
|
||||
$summary = QhrHotelReviewHelper::prepareCategoriesData($summary);
|
||||
}
|
||||
|
||||
if (is_array($reviews) && count($reviews)) {
|
||||
foreach ($reviews as &$review) {
|
||||
$review['images'] = QhrHotelReview::getImagesById($review['id_hotel_review']);
|
||||
$hasNextPage = QhrHotelReview::hasNextPage($idHotel, 1, $reviewsAtOnce);
|
||||
|
||||
$this->smarty->assign(array(
|
||||
'id_hotel' => $idHotel,
|
||||
'reviews' => $reviews,
|
||||
'summary' => $summary,
|
||||
'images' => QhrHotelReview::getAllImages($idHotel),
|
||||
'logged' => $this->context->customer->isLogged(true),
|
||||
'show_load_more_btn' => $hasNextPage,
|
||||
));
|
||||
return $this->display(__FILE__, 'product-tab-content.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
$summary = QhrHotelReview::getSummaryByHotel($idHotel);
|
||||
if (is_array($summary['categories']) && count($summary['categories'])) {
|
||||
$summary = QhrHotelReviewHelper::prepareCategoriesData($summary);
|
||||
}
|
||||
|
||||
$hasNextPage = QhrHotelReview::hasNextPage($idHotel, 1, $reviewsAtOnce);
|
||||
|
||||
$this->smarty->assign(array(
|
||||
'id_hotel' => $idHotel,
|
||||
'reviews' => $reviews,
|
||||
'summary' => $summary,
|
||||
'images' => QhrHotelReview::getAllImages($idHotel),
|
||||
'logged' => $this->context->customer->isLogged(true),
|
||||
'show_load_more_btn' => $hasNextPage,
|
||||
));
|
||||
return $this->display(__FILE__, 'product-tab-content.tpl');
|
||||
}
|
||||
|
||||
public function hookActionCleanData($params)
|
||||
|
||||
@@ -21,13 +21,14 @@
|
||||
<table class="product" class="bordered-table" width="100%" cellpadding="4" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="{if $display_product_images}6{else}5{/if}" class="header">{l s='Service Products Details' pdf='true'}</th>
|
||||
<th colspan="{if $display_product_images}7{else}6{/if}" class="header">{l s='Products Details' pdf='true'}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
{if $display_product_images}
|
||||
<th class="product header small">{l s='Image' pdf='true'}</th>
|
||||
{/if}
|
||||
<th class="product header small">{l s='Name' pdf='true'}</th>
|
||||
<th class="product header small">{l s='Hotel' pdf='true'}</th>
|
||||
<th class="product header small">{l s='Tax Rate(s)' pdf='true'}</th>
|
||||
<th class="product header small">{l s='Unit Price' pdf='true'} <br /> {l s='(Tax excl.)' pdf='true'}</th>
|
||||
<th class="product header small">{l s='Qty' pdf='true'}</th>
|
||||
@@ -46,19 +47,22 @@
|
||||
</td>
|
||||
{/if}
|
||||
<td class="product center">
|
||||
{$product.product_name}
|
||||
{$product.product_name}{if isset($product.option_name) && $product.option_name} : {$product.option_name}{/if}
|
||||
</td>
|
||||
<td class="product center">
|
||||
{if isset($product.hotel_name) && $product.hotel_name}{$product.hotel_name}{else}--{/if}
|
||||
</td>
|
||||
<td class="product center">
|
||||
{$product.order_detail_tax_label}
|
||||
</td>
|
||||
<td class="product right">
|
||||
{displayPrice currency=$order->id_currency price=$product.unit_price_tax_excl_including_ecotax}
|
||||
{displayPrice currency=$order->id_currency price=$product.unit_price_tax_excl}
|
||||
</td>
|
||||
<td class="product center">
|
||||
{$product.product_quantity}
|
||||
{$product.quantity}
|
||||
</td>
|
||||
<td class="product right">
|
||||
{displayPrice currency=$order->id_currency price=$product.total_price_tax_excl_including_ecotax}
|
||||
{displayPrice currency=$order->id_currency price=$product.total_price_tax_excl}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
{elseif $label == 'convenience_fee_tax'}
|
||||
{l s='Convenience Fees' pdf='true'}
|
||||
{elseif $label == 'service_products_tax'}
|
||||
{l s='Service Products' pdf='true'}
|
||||
{l s='Products' pdf='true'}
|
||||
{elseif $label == 'shipping_tax'}
|
||||
{l s='Shipping' pdf='true'}
|
||||
{elseif $label == 'ecotax_tax'}
|
||||
|
||||
@@ -24,14 +24,16 @@
|
||||
*}
|
||||
<table id="total-tab" width="100%">
|
||||
|
||||
<tr>
|
||||
<td class="grey" width="70%">
|
||||
{l s='Total Rooms Cost (tax excl.)' pdf='true'}
|
||||
</td>
|
||||
<td class="white" width="30%">
|
||||
{displayPrice currency=$order->id_currency price=$footer.room_price_tax_excl}
|
||||
</td>
|
||||
</tr>
|
||||
{if isset($footer.room_price_tax_excl) && $footer.room_price_tax_excl}
|
||||
<tr>
|
||||
<td class="grey" width="70%">
|
||||
{l s='Total Rooms Cost (tax excl.)' pdf='true'}
|
||||
</td>
|
||||
<td class="white" width="30%">
|
||||
{displayPrice currency=$order->id_currency price=$footer.room_price_tax_excl}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if isset($footer.additional_service_price_tax_excl) && $footer.additional_service_price_tax_excl}
|
||||
<tr>
|
||||
<td class="grey" width="70%">
|
||||
@@ -42,6 +44,16 @@
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if isset($footer.service_products_price_tax_excl) && $footer.service_products_price_tax_excl}
|
||||
<tr>
|
||||
<td class="grey" width="70%">
|
||||
{l s='Total Products cost (tax excl.)' pdf='true'}
|
||||
</td>
|
||||
<td class="white" width="30%">
|
||||
{displayPrice currency=$order->id_currency price=$footer.service_products_price_tax_excl}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if isset($footer.total_convenience_fee_te) && $footer.total_convenience_fee_te}
|
||||
<tr>
|
||||
<td class="grey" width="70%">
|
||||
@@ -73,14 +85,7 @@
|
||||
</tr>
|
||||
{/if} *}
|
||||
|
||||
{* <tr>
|
||||
<td class="grey" width="70%">
|
||||
{l s='Total Service Products cost (tax excl.)' pdf='true'}
|
||||
</td>
|
||||
<td class="white" width="30%">
|
||||
{displayPrice currency=$order->id_currency price=$footer.service_products_price_tax_excl}
|
||||
</td>
|
||||
</tr> *}
|
||||
|
||||
|
||||
{* {if isset($footer.service_products_price_tax_excl) && $footer.service_products_price_tax_excl}
|
||||
<tr>
|
||||
|
||||
@@ -62,10 +62,6 @@
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="12" height="20"> </td>
|
||||
</tr>
|
||||
|
||||
<!-- Product -->
|
||||
<tr>
|
||||
<td colspan="12">
|
||||
|
||||
@@ -25,100 +25,199 @@
|
||||
|
||||
<table class="product" width="100%" cellpadding="4" cellspacing="0">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="product header small" width="35%">{l s='Room Type / Reference' pdf='true'}</th>
|
||||
<th class="product header small" width="35%">{l s='Duration' pdf='true'}</th>
|
||||
<th class="product header small" width="10%">{l s='Num rooms' pdf='true'}</th>
|
||||
{* <th class="product header-right small" width="15%">{l s='Unit price' pdf='true'}<br />{if $tax_excluded_display}{l s='(Tax Excl.)' pdf='true'}{else}{l s='(Tax Incl.)' pdf='true'}{/if}</th> *}
|
||||
<th class="product header-right small" width="20%">{l s='Total Price' pdf='true'}<br />{if $tax_excluded_display}{l s='(Tax Excl.)' pdf='true'}{else}{l s='(Tax Incl.)' pdf='true'}{/if}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{if !isset($order_details) || count($order_details) == 0}
|
||||
<tr class="product" colspan="4">
|
||||
<td class="product center">
|
||||
{l s='No details' pdf='true'}
|
||||
</td>
|
||||
{if $roomsDetails}
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="product header small" width="35%">{l s='Room Type / Reference' pdf='true'}</th>
|
||||
<th class="product header small" width="35%">{l s='Duration' pdf='true'}</th>
|
||||
<th class="product header small" width="10%">{l s='Num rooms' pdf='true'}</th>
|
||||
{* <th class="product header-right small" width="15%">{l s='Unit price' pdf='true'}<br />{if $tax_excluded_display}{l s='(Tax Excl.)' pdf='true'}{else}{l s='(Tax Incl.)' pdf='true'}{/if}</th> *}
|
||||
<th class="product header-right small" width="20%">{l s='Total Price' pdf='true'}<br />{if $tax_excluded_display}{l s='(Tax Excl.)' pdf='true'}{else}{l s='(Tax Incl.)' pdf='true'}{/if}</th>
|
||||
</tr>
|
||||
{else}
|
||||
{foreach $order_details as $order_detail}
|
||||
{cycle values=["color_line_even", "color_line_odd"] assign=bgcolor_class}
|
||||
<tr class="product {$bgcolor_class}">
|
||||
<td class="product left">
|
||||
{$order_detail.product_name}
|
||||
</td>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{if !isset($roomsDetails) || count($roomsDetails) == 0}
|
||||
<tr class="product" colspan="4">
|
||||
<td class="product center">
|
||||
{$order_detail.date_from|date_format:"%d-%m-%Y"} {l s='To' pdf='true'} {$order_detail.date_to|date_format:"%d-%m-%Y"}
|
||||
</td>
|
||||
<td class="product center">
|
||||
{$order_detail.num_rooms}
|
||||
</td>
|
||||
{* <td class="product right">
|
||||
{if $tax_excluded_display}
|
||||
- {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl}
|
||||
{else}
|
||||
- {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_incl}
|
||||
{/if}
|
||||
</td> *}
|
||||
<td class="product right">
|
||||
{if $tax_excluded_display}
|
||||
- {displayPrice currency=$order->id_currency price=$order_detail.total_price_tax_excl}
|
||||
{else}
|
||||
- {displayPrice currency=$order->id_currency price=$order_detail.total_price_tax_incl}
|
||||
{/if}
|
||||
{l s='No details' pdf='true'}
|
||||
</td>
|
||||
</tr>
|
||||
{else}
|
||||
{foreach $roomsDetails as $order_detail}
|
||||
{cycle values=["color_line_even", "color_line_odd"] assign=bgcolor_class}
|
||||
<tr class="product {$bgcolor_class}">
|
||||
<td class="product left">
|
||||
{$order_detail.product_name}
|
||||
</td>
|
||||
<td class="product center">
|
||||
{$order_detail.date_from|date_format:"%d-%m-%Y"} {l s='To' pdf='true'} {$order_detail.date_to|date_format:"%d-%m-%Y"}
|
||||
</td>
|
||||
<td class="product center">
|
||||
{$order_detail.num_rooms}
|
||||
</td>
|
||||
{* <td class="product right">
|
||||
{if $tax_excluded_display}
|
||||
- {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl}
|
||||
{else}
|
||||
- {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_incl}
|
||||
{/if}
|
||||
</td> *}
|
||||
<td class="product right">
|
||||
{if $tax_excluded_display}
|
||||
- {displayPrice currency=$order->id_currency price=$order_detail.total_price_tax_excl}
|
||||
{else}
|
||||
- {displayPrice currency=$order->id_currency price=$order_detail.total_price_tax_incl}
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{foreach $order_detail.customizedDatas as $customizationPerAddress}
|
||||
{foreach $customizationPerAddress as $customizationId => $customization}
|
||||
<tr class="customization_data {$bgcolor_class}">
|
||||
<td>
|
||||
<table style="width: 100%;"><tr><td>
|
||||
{foreach $customization.datas as $customization_types}
|
||||
{if isset($customization.datas[Product::CUSTOMIZE_TEXTFIELD]) && count($customization.datas[Product::CUSTOMIZE_FILE]) > 0}
|
||||
{foreach $customization.datas[Product::CUSTOMIZE_TEXTFIELD] as $customization_infos}
|
||||
{$customization_infos.name}: {$customization_infos.value}
|
||||
{if !$smarty.foreach.custo_foreach.last}<br />{/if}
|
||||
{/foreach}
|
||||
{/if}
|
||||
{foreach $order_detail.customizedDatas as $customizationPerAddress}
|
||||
{foreach $customizationPerAddress as $customizationId => $customization}
|
||||
<tr class="customization_data {$bgcolor_class}">
|
||||
<td>
|
||||
<table style="width: 100%;"><tr><td>
|
||||
{foreach $customization.datas as $customization_types}
|
||||
{if isset($customization.datas[Product::CUSTOMIZE_TEXTFIELD]) && count($customization.datas[Product::CUSTOMIZE_FILE]) > 0}
|
||||
{foreach $customization.datas[Product::CUSTOMIZE_TEXTFIELD] as $customization_infos}
|
||||
{$customization_infos.name}: {$customization_infos.value}
|
||||
{if !$smarty.foreach.custo_foreach.last}<br />{/if}
|
||||
{/foreach}
|
||||
{/if}
|
||||
|
||||
{if isset($customization.datas[Product::CUSTOMIZE_FILE]) && count($customization.datas[Product::CUSTOMIZE_FILE]) > 0}
|
||||
{count($customization.datas[Product::CUSTOMIZE_FILE])} {l s='image(s)' pdf='true'}
|
||||
{/if}
|
||||
{if isset($customization.datas[Product::CUSTOMIZE_FILE]) && count($customization.datas[Product::CUSTOMIZE_FILE]) > 0}
|
||||
{count($customization.datas[Product::CUSTOMIZE_FILE])} {l s='image(s)' pdf='true'}
|
||||
{/if}
|
||||
|
||||
{/foreach}
|
||||
</td></tr></table>
|
||||
</td>
|
||||
{/foreach}
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
||||
<td class="center">({$customization.quantity})</td>
|
||||
<td class="product"></td>
|
||||
<td class="product"></td>
|
||||
</tr>
|
||||
<td class="center">({$customization.quantity})</td>
|
||||
<td class="product"></td>
|
||||
<td class="product"></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{assign var=total_cart_rule value=0}
|
||||
{if is_array($cart_rules) && count($cart_rules)}
|
||||
{foreach $cart_rules as $cart_rule}
|
||||
<tr class="discount">
|
||||
<td class="white left" colspan="3">{$cart_rule.name}</td>
|
||||
<td class="white right">
|
||||
{if $tax_excluded_display}
|
||||
{$total_cart_rule = $total_cart_rule + $cart_rule.value_tax_excl}
|
||||
+ {$cart_rule.value_tax_excl}
|
||||
{else}
|
||||
{$total_cart_rule = $total_cart_rule + $cart_rule.value}
|
||||
+ {$cart_rule.value}
|
||||
{/if}
|
||||
{assign var=total_cart_rule value=0}
|
||||
{if is_array($cart_rules) && count($cart_rules)}
|
||||
{foreach $cart_rules as $cart_rule}
|
||||
<tr class="discount">
|
||||
<td class="white left" colspan="3">{$cart_rule.name}</td>
|
||||
<td class="white right">
|
||||
{if $tax_excluded_display}
|
||||
{$total_cart_rule = $total_cart_rule + $cart_rule.value_tax_excl}
|
||||
+ {$cart_rule.value_tax_excl}
|
||||
{else}
|
||||
{$total_cart_rule = $total_cart_rule + $cart_rule.value}
|
||||
+ {$cart_rule.value}
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{/if}
|
||||
|
||||
</tbody>
|
||||
{/if}
|
||||
|
||||
{if $productsDetails}
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="product header small" width="10%"></th>
|
||||
<th class="product header small" width="35%">{l s='Name / Reference' pdf='true'}</th>
|
||||
<th class="product header small" width="35%">{l s='Quantity' pdf='true'}</th>
|
||||
{* <th class="product header-right small" width="15%">{l s='Unit price' pdf='true'}<br />{if $tax_excluded_display}{l s='(Tax Excl.)' pdf='true'}{else}{l s='(Tax Incl.)' pdf='true'}{/if}</th> *}
|
||||
<th class="product header-right small" width="20%">{l s='Total Price' pdf='true'}<br />{if $tax_excluded_display}{l s='(Tax Excl.)' pdf='true'}{else}{l s='(Tax Incl.)' pdf='true'}{/if}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{if !isset($productsDetails) || count($productsDetails) == 0}
|
||||
<tr class="product" colspan="4">
|
||||
<td class="product center">
|
||||
{l s='No details' pdf='true'}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{/if}
|
||||
{else}
|
||||
{foreach $productsDetails as $order_detail}
|
||||
{cycle values=["color_line_even", "color_line_odd"] assign=bgcolor_class}
|
||||
<tr class="product {$bgcolor_class}">
|
||||
<td class="product center">
|
||||
</td>
|
||||
<td class="product left">
|
||||
{$order_detail.product_name}
|
||||
</td>
|
||||
<td class="product center">
|
||||
{$order_detail.num_rooms}
|
||||
</td>
|
||||
{* <td class="product right">
|
||||
{if $tax_excluded_display}
|
||||
- {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl}
|
||||
{else}
|
||||
- {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_incl}
|
||||
{/if}
|
||||
</td> *}
|
||||
<td class="product right">
|
||||
{if $tax_excluded_display}
|
||||
- {displayPrice currency=$order->id_currency price=$order_detail.total_price_tax_excl}
|
||||
{else}
|
||||
- {displayPrice currency=$order->id_currency price=$order_detail.total_price_tax_incl}
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
{foreach $order_detail.customizedDatas as $customizationPerAddress}
|
||||
{foreach $customizationPerAddress as $customizationId => $customization}
|
||||
<tr class="customization_data {$bgcolor_class}">
|
||||
<td>
|
||||
<table style="width: 100%;"><tr><td>
|
||||
{foreach $customization.datas as $customization_types}
|
||||
{if isset($customization.datas[Product::CUSTOMIZE_TEXTFIELD]) && count($customization.datas[Product::CUSTOMIZE_FILE]) > 0}
|
||||
{foreach $customization.datas[Product::CUSTOMIZE_TEXTFIELD] as $customization_infos}
|
||||
{$customization_infos.name}: {$customization_infos.value}
|
||||
{if !$smarty.foreach.custo_foreach.last}<br />{/if}
|
||||
{/foreach}
|
||||
{/if}
|
||||
|
||||
{if isset($customization.datas[Product::CUSTOMIZE_FILE]) && count($customization.datas[Product::CUSTOMIZE_FILE]) > 0}
|
||||
{count($customization.datas[Product::CUSTOMIZE_FILE])} {l s='image(s)' pdf='true'}
|
||||
{/if}
|
||||
|
||||
{/foreach}
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
||||
<td class="center">({$customization.quantity})</td>
|
||||
<td class="product"></td>
|
||||
<td class="product"></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{/if}
|
||||
|
||||
{assign var=total_cart_rule value=0}
|
||||
{if is_array($cart_rules) && count($cart_rules)}
|
||||
{foreach $cart_rules as $cart_rule}
|
||||
<tr class="discount">
|
||||
<td class="white left" colspan="3">{$cart_rule.name}</td>
|
||||
<td class="white right">
|
||||
{if $tax_excluded_display}
|
||||
{$total_cart_rule = $total_cart_rule + $cart_rule.value_tax_excl}
|
||||
+ {$cart_rule.value_tax_excl}
|
||||
{else}
|
||||
{$total_cart_rule = $total_cart_rule + $cart_rule.value}
|
||||
+ {$cart_rule.value}
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{/if}
|
||||
|
||||
</tbody>
|
||||
{/if}
|
||||
|
||||
</table>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
<p class="hidden">
|
||||
<input type="hidden" name="token" value="{$static_token}" />
|
||||
<input type="hidden" name="id_product" value="{$product->id|intval}" id="product_page_product_id" />
|
||||
<input type="hidden" name="booking_product" value="{$product->booking_product|intval}" id="product_page_booking_product" />
|
||||
<input type="hidden" name="add" value="1" />
|
||||
<input type="hidden" name="id_product_attribute" id="idCombination" value="" />
|
||||
</p>
|
||||
@@ -213,47 +214,113 @@
|
||||
{/if}
|
||||
{/if}
|
||||
{else}
|
||||
{block name='booking_form_associated_hotels'}
|
||||
{if isset($associated_hotels) && $associated_hotels}
|
||||
<div class="form-group">
|
||||
<label class="control-label">{l s='Select Hotel'}</label>
|
||||
<select class="chosen input-hotel" name="service_id_hotel" id="service_id_hotel">
|
||||
{foreach $associated_hotels as $hotel}
|
||||
<option value="{$hotel.id_hotel}" {if isset($service_id_hotel) && $service_id_hotel == $hotel['id_hotel']}selected{elseif $hotel@first}selected{/if}>{$hotel.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
{block name='booking_form_service_product_option'}
|
||||
{if isset($service_product_option) && $service_product_option}
|
||||
<label class="control-label">{l s='Variants'}</label>
|
||||
<div class="product-options-block">
|
||||
{foreach $service_product_option as $option}
|
||||
<div class="form-group">
|
||||
<label for="id_service_product_option{$option['id_service_product_option']}" class="top">
|
||||
<input type="radio" name="id_service_product_option" id="id_service_product_option{$option['id_service_product_option']}" value="{$option['id_service_product_option']}" {if isset($id_service_product_option) && $id_service_product_option == $option['id_service_product_option']}checked="checked"{else if $option@first}checked="checked"{/if}/>
|
||||
{$option['name']}
|
||||
<span class="pull-right">{convertPrice price=$option['price']}</span>
|
||||
</label>
|
||||
</div>
|
||||
{if !$option@last}
|
||||
<hr>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
{block name='booking_form_service_product_quantity'}
|
||||
{if $product->allow_multiple_quantity}
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-6" id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>
|
||||
<label for="quantity_wanted_p">{l s='Quantity'}</label>
|
||||
{* {block name='quantity_field'}
|
||||
{include file="./quantity_field.tpl"}
|
||||
{/block} *}
|
||||
|
||||
{if $product->allow_multiple_quantity}
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-6" id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>
|
||||
<label for="quantity_wanted">{l s='Quantity'}</label>
|
||||
<div class="qty_sec_cont">
|
||||
<div class="qty_input_cont row margin-lr-0">
|
||||
<input autocomplete="off" type="text" min="1" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}">
|
||||
</div>
|
||||
<div class="qty_direction">
|
||||
<a href="#" data-field-qty="qty" class="btn btn-default product_quantity_up">
|
||||
<span>
|
||||
<i class="icon-plus"></i>
|
||||
</span>
|
||||
</a>
|
||||
<a href="#" data-field-qty="qty" class="btn btn-default product_quantity_down">
|
||||
<span>
|
||||
<i class="icon-minus"></i>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="qty_container">
|
||||
<input type="hidden" class="service_product_qty" id="service_product_qty" name="service_product_qty" data-id-product="{$product->id}" data-max_quantity="{if isset($product->max_quantity) && $product->max_quantity}{$product->max_quantity|escape:'html':'UTF-8'}{else}{$product->quantity}{/if}" value="{if isset($quantity)}{$quantity|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}">
|
||||
<div class="qty_count pull-left">
|
||||
<span>{if isset($quantity)}{$quantity|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}</span>
|
||||
</div>
|
||||
<div class="qty_direction pull-left">
|
||||
<a href="#" class="btn btn-default quantity_up service_product_qty_up"><span><i class="icon-plus"></i></span></a>
|
||||
<a href="#" class="btn btn-default quantity_down service_product_qty_down"><span><i class="icon-minus"></i></span></a>
|
||||
</div>
|
||||
</div>
|
||||
<span class="clearfix"></span>
|
||||
</div>
|
||||
<span class="clearfix"></span>
|
||||
</div>
|
||||
<hr class="separator-hr-mg-10">
|
||||
{/if}
|
||||
{/block}
|
||||
{block name='booking_form_actions'}
|
||||
<div id="booking_action_block">
|
||||
<div class="row">
|
||||
{block name='booking_form_total_price'}
|
||||
<div class="total_price_block col-xs-7 form-group">
|
||||
<label class="control-label">{l s='Price'}</label>
|
||||
<p>
|
||||
{convertPrice price=$service_price}
|
||||
{* {if !$priceDisplay || $priceDisplay == 2}
|
||||
{convertPrice price=$product->getPrice(true, $smarty.const.NULL, 6)|floatval}
|
||||
{elseif $priceDisplay == 1}
|
||||
{convertPrice price=$product->getPrice(false, $smarty.const.NULL, 6)|floatval}
|
||||
{/if} *}
|
||||
</p>
|
||||
</div>
|
||||
{/block}
|
||||
{block name='booking_form_available_quantity'}
|
||||
{* {if $product->quantity <= 20}
|
||||
<div class="col-xs-5 form-group text-right num_quantity_alert">
|
||||
<span class="num_searched_avail_rooms">
|
||||
{$product->quantity|escape:'html':'UTF-8'}
|
||||
</span>
|
||||
{l s=' Qty Available!'}
|
||||
</div>
|
||||
{/if} *}
|
||||
{/block}
|
||||
</div>
|
||||
<div>
|
||||
{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || (isset($restricted_country_mode) && $restricted_country_mode) || $PS_CATALOG_MODE}
|
||||
{else}
|
||||
{block name='booking_form_book_now_button'}
|
||||
<p id="add_to_cart" class="buttons_bottom_block no-print">
|
||||
<button type="submit" name="Submit" class="exclusive book_now_submit">
|
||||
<span>
|
||||
{if isset($content_only) && $content_only && (isset($product->customization_required) && $product->customization_required)}{l s='Customize'}{else}{l s='Book Now'}{/if}
|
||||
</span>
|
||||
<span id="booking_action_loader"></span>
|
||||
</button>
|
||||
</p>
|
||||
{/block}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="row">
|
||||
<div class="total_price_block col-xs-7 form-group">
|
||||
<label class="control-label">{l s='Price'}</label>
|
||||
<p>
|
||||
{convertPrice price=$productPrice|floatval}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{/if}
|
||||
{/if}
|
||||
{if $order_date_restrict}
|
||||
{* {if $order_date_restrict}
|
||||
<div class="order_restrict_alert">
|
||||
<span>{l s='You can\'t book rooms after %s.' sprintf=[{dateFormat date=$max_order_date full=0}]}</span>
|
||||
</div>
|
||||
{/if}
|
||||
{/if} *}
|
||||
</form>
|
||||
{/block}
|
||||
</div>
|
||||
|
||||
@@ -127,7 +127,8 @@
|
||||
<p>{$product['name']|escape:'html':'UTF-8'}</p>
|
||||
{if $product.allow_multiple_quantity}
|
||||
<div class="qty_container">
|
||||
<input type="text" class="form-control qty" id="qty_{$product.id_product}" name="service_product_qty_{$product.id_product}" data-id-product="{$product.id_product}" data-max_quantity="{$product.max_quantity}" value="{if isset($cartRoom['selected_service']) && $cartRoom['selected_service'] && ($product['id_product']|array_key_exists:$cartRoom['selected_service'])}{$cartRoom['selected_service'][$product['id_product']]['quantity']}{else}1{/if}">
|
||||
<input type="text" class="form-control qty" id="qty_{$product.id_product}" name="room_service_product_qty_{$product.id_product}" data-id-product="{$product.id_product}" data-max_quantity="{$product.max_quantity}" value="{if isset($cartRoom['selected_service']) && $cartRoom['selected_service'] && ($product['id_product']|array_key_exists:$cartRoom['selected_service'])}{$cartRoom['selected_service'][$product['id_product']]['quantity']}{else}1{/if}">
|
||||
<input type="hidden" class="qty_hidden" id="qty_{$product.id_product}_hidden" value="{if isset($cartRoom['selected_service']) && $cartRoom['selected_service'] && ($product['id_product']|array_key_exists:$cartRoom['selected_service'])}{$cartRoom['selected_service'][$product['id_product']]['quantity']}{else}0{/if}">
|
||||
<div class="qty_controls">
|
||||
<a href="#" class="qty_up"><span><i class="icon-plus"></i></span></a>
|
||||
<a href="#" class="qty_down"><span><i class="icon-minus"></i></span></a>
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
{*
|
||||
* Since 2010 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="product-detail" data-id-product="{$product.id_product}">
|
||||
<div class="row">
|
||||
{block name='order_hotel_product_image'}
|
||||
<div class="col-xs-3 col-sm-2">
|
||||
<a href="{$link->getProductLink($product.id_product)|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" target="_blank">
|
||||
<img class="img img-responsive img-room-type" src="{$product.cover_img|escape:'html':'UTF-8'}" />
|
||||
</a>
|
||||
</div>
|
||||
{/block}
|
||||
{block name='order_hotel_product_detail'}
|
||||
<div class="col-xs-9 col-sm-10 info-wrap">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<a href="{$link->getProductLink($product.id_product)|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" target="_blank" class="product-name">
|
||||
<h3>{$product.name|escape:'html':'UTF-8'}{if $product.option_name} : {$product.option_name|escape:'html':'UTF-8'}{/if}</h3>
|
||||
</a>
|
||||
|
||||
{if $product['is_refunded'] || $product['is_cancelled']}
|
||||
<div class="num-refunded-rooms">
|
||||
{if $product['is_cancelled']}
|
||||
<span class="badge badge-danger">
|
||||
{l s='Cancelled'}
|
||||
</span>
|
||||
{else}
|
||||
<span class="badge badge-danger">
|
||||
{l s='Refunded'}
|
||||
</span>
|
||||
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<div class="description-list">
|
||||
<dl class="">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Quantity'}</dt>
|
||||
<dd class="col-xs-7">{$product.quantity}</dd>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Unit Price'}</dt>
|
||||
<dd class="col-xs-7">
|
||||
{if $group_use_tax}
|
||||
{displayWtPriceWithCurrency price=$product.unit_price_tax_incl currency=$currency}
|
||||
{else}
|
||||
{displayWtPriceWithCurrency price=$product.unit_price_tax_excl currency=$currency}
|
||||
{/if}
|
||||
</dd>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Total Pricing'}</dt>
|
||||
<dd class="col-xs-7">
|
||||
{if $group_use_tax}
|
||||
{displayWtPriceWithCurrency price=$product.total_price_tax_incl currency=$currency}
|
||||
{else}
|
||||
{displayWtPriceWithCurrency price=$product.total_price_tax_excl currency=$currency}
|
||||
{/if}
|
||||
</dd>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
</div>
|
||||
</div>
|
||||
@@ -17,7 +17,7 @@
|
||||
* @license LICENSE.txt
|
||||
*}
|
||||
|
||||
<div class="booking-room-detail" data-id-product="{$data_v.id_product}" data-date-diff="{$rm_k}">
|
||||
<div class="product-detail" data-id-product="{$data_v.id_product}" data-date-diff="{$rm_k}">
|
||||
<div class="row">
|
||||
{block name='order_room_detail_room_image'}
|
||||
<div class="col-xs-3 col-sm-2">
|
||||
@@ -30,7 +30,7 @@
|
||||
<div class="col-xs-9 col-sm-10 info-wrap">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<a href="{$link->getProductLink($data_v.id_product)|escape:'html':'UTF-8'}" title="{$data_v.name|escape:'html':'UTF-8'}" target="_blank" class="room-type-name">
|
||||
<a href="{$link->getProductLink($data_v.id_product)|escape:'html':'UTF-8'}" title="{$data_v.name|escape:'html':'UTF-8'}" target="_blank" class="product-name">
|
||||
<h3>{$data_v.name|escape:'html':'UTF-8'}</h3>
|
||||
</a>
|
||||
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
{*
|
||||
* Since 2010 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
|
||||
<div class="product-detail" data-id-product="{$product.id_product}">
|
||||
<div class="row">
|
||||
{block name='order_standalone_product_image'}
|
||||
<div class="col-xs-3 col-sm-2">
|
||||
<a href="{$link->getProductLink($product.id_product)|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" target="_blank">
|
||||
<img class="img img-responsive img-room-type" src="{$product.cover_img|escape:'html':'UTF-8'}" />
|
||||
</a>
|
||||
</div>
|
||||
{/block}
|
||||
{block name='order_standalone_product_detail'}
|
||||
<div class="col-xs-9 col-sm-10 info-wrap">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<a href="{$link->getProductLink($product.id_product)|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" target="_blank" class="product-name">
|
||||
<h3>{$product.name|escape:'html':'UTF-8'}{if $product.option_name} : {$product.option_name|escape:'html':'UTF-8'}{/if}</h3>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<div class="description-list">
|
||||
<dl class="">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Quantity'}</dt>
|
||||
<dd class="col-xs-7">{$product.quantity}</dd>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Unit Price'}</dt>
|
||||
<dd class="col-xs-7">
|
||||
{if $group_use_tax}
|
||||
{displayWtPriceWithCurrency price=$product.unit_price_tax_incl currency=$currency}
|
||||
{else}
|
||||
{displayWtPriceWithCurrency price=$product.unit_price_tax_excl currency=$currency}
|
||||
{/if}
|
||||
</dd>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Total Pricing'}</dt>
|
||||
<dd class="col-xs-7">
|
||||
{if $group_use_tax}
|
||||
{displayWtPriceWithCurrency price=$product.total_price_tax_incl currency=$currency}
|
||||
{else}
|
||||
{displayWtPriceWithCurrency price=$product.total_price_tax_excl currency=$currency}
|
||||
{/if}
|
||||
</dd>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
</div>
|
||||
</div>
|
||||
@@ -67,13 +67,13 @@
|
||||
<div class="service-product-actions">
|
||||
{if $service_product.allow_multiple_quantity && $service_product.available_for_order}
|
||||
<div class="qty_container">
|
||||
<input type="hidden" class="service_product_qty" id="service_product_qty_{$service_product.id_product}" name="service_product_qty_{$service_product.id_product}" data-id-product="{$service_product.id_product}" data-max_quantity="{$service_product.max_quantity}" value="{if isset($service_product.quantity_added) && $service_product.quantity_added}{$service_product.quantity_added|escape:'html':'UTF-8'}{else}1{/if}">
|
||||
<input type="hidden" class="room_service_product_qty" id="room_service_product_qty_{$service_product.id_product}" name="room_service_product_qty_{$service_product.id_product}" data-id-product="{$service_product.id_product}" data-max_quantity="{$service_product.max_quantity}" value="{if isset($service_product.quantity_added) && $service_product.quantity_added}{$service_product.quantity_added|escape:'html':'UTF-8'}{else}1{/if}">
|
||||
<div class="qty_count pull-left">
|
||||
<span>{if isset($service_product.quantity_added) && $service_product.quantity_added}{$service_product.quantity_added|escape:'html':'UTF-8'}{else}1{/if}</span>
|
||||
</div>
|
||||
<div class="qty_direction pull-left">
|
||||
<a href="#" class="btn btn-default quantity_up service_product_qty_up"><span><i class="icon-plus"></i></span></a>
|
||||
<a href="#" class="btn btn-default quantity_down service_product_qty_down"><span><i class="icon-minus"></i></span></a>
|
||||
<a href="#" class="btn btn-default quantity_up room_service_product_qty_up"><span><i class="icon-plus"></i></span></a>
|
||||
<a href="#" class="btn btn-default quantity_down room_service_product_qty_down"><span><i class="icon-minus"></i></span></a>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
144
themes/hotel-reservation-theme/cart-total-block.tpl
Normal file
144
themes/hotel-reservation-theme/cart-total-block.tpl
Normal file
@@ -0,0 +1,144 @@
|
||||
{*
|
||||
* Since 2010 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
|
||||
<div class="col-sm-12 card cart_total_detail_block">
|
||||
{if $total_rooms_wt + $total_extra_demands_wt + $total_additional_services_wt + $total_additional_services_auto_add_wt}
|
||||
<p>
|
||||
<span>
|
||||
{l s='Total rooms cost'}
|
||||
{if $display_tax_label}
|
||||
{if $use_taxes && $priceDisplay == 0}
|
||||
{l s='(tax incl)'}
|
||||
{else}
|
||||
{l s='(tax excl)'}
|
||||
{/if}
|
||||
{/if}
|
||||
</span>
|
||||
<span class="cart_total_values">
|
||||
{if $use_taxes && $priceDisplay == 0}
|
||||
{assign var='total_rooms_cost' value=($total_rooms_wt + $total_extra_demands_wt + $total_additional_services_wt + $total_additional_services_auto_add_wt)}
|
||||
{else}
|
||||
{assign var='total_rooms_cost' value=($total_rooms + $total_extra_demands + $total_additional_services + $total_additional_services_auto_add)}
|
||||
{/if}
|
||||
{displayPrice price=$total_rooms_cost}
|
||||
</span>
|
||||
</p>
|
||||
{/if}
|
||||
{if $total_standalone_service_products}
|
||||
<p>
|
||||
<span>
|
||||
{l s='Total products'}
|
||||
{if $display_tax_label}
|
||||
{if $use_taxes && $priceDisplay == 0}
|
||||
{l s='(tax incl)'}
|
||||
{else}
|
||||
{l s='(tax excl)'}
|
||||
{/if}
|
||||
{/if}
|
||||
</span>
|
||||
<span class="cart_total_values">
|
||||
{if $use_taxes && $priceDisplay == 0}
|
||||
{displayPrice price=$total_standalone_service_products_wt}
|
||||
{else}
|
||||
{displayPrice price=$total_standalone_service_products}
|
||||
{/if}
|
||||
</span>
|
||||
</p>
|
||||
{/if}
|
||||
{if $convenience_fee_wt}
|
||||
<p>
|
||||
<span>
|
||||
{l s='Convenience Fees'}
|
||||
{if $display_tax_label}
|
||||
{if $use_taxes && $priceDisplay == 0}
|
||||
{l s='(tax incl)'}
|
||||
{else}
|
||||
{l s='(tax excl)'}
|
||||
{/if}
|
||||
{/if}
|
||||
</span>
|
||||
<span class="cart_total_values">
|
||||
{if $use_taxes && $priceDisplay == 0}
|
||||
{displayPrice price=$convenience_fee_wt}
|
||||
{else}
|
||||
{displayPrice price=$convenience_fee}
|
||||
{/if}
|
||||
</span>
|
||||
</p>
|
||||
{/if}
|
||||
{block name='displayBeforeCartTotalTax'}
|
||||
{hook h='displayBeforeCartTotalTax'}
|
||||
{/block}
|
||||
{if $show_taxes}
|
||||
<p class="cart_total_tax">
|
||||
<span>{l s='Total tax'}</span>
|
||||
<span class="cart_total_values">{displayPrice price=($total_tax_without_discount)}</span>
|
||||
</p>
|
||||
{/if}
|
||||
<p class="total_discount_block {if $total_discounts == 0}unvisible{/if}">
|
||||
<span>
|
||||
{if $display_tax_label}
|
||||
{if $use_taxes && $priceDisplay == 0}
|
||||
{l s='Total Discount (tax incl)'}
|
||||
{else}
|
||||
{l s='Total Discount (tax excl)'}
|
||||
{/if}
|
||||
{else}
|
||||
{l s='Total Discount'}
|
||||
{/if}
|
||||
</span>
|
||||
<span class="cart_total_values">
|
||||
{if $use_taxes && $priceDisplay == 0}
|
||||
{assign var='total_discounts_negative' value=$total_discounts * -1}
|
||||
{else}
|
||||
{assign var='total_discounts_negative' value=$total_discounts_tax_exc * -1}
|
||||
{/if}
|
||||
{displayPrice price=$total_discounts_negative}
|
||||
</span>
|
||||
</p>
|
||||
<hr>
|
||||
<p {if !isset($is_advance_payment) || !$is_advance_payment}class="cart_final_total_block"{/if}>
|
||||
<span class="strong">{l s='Total'}</span>
|
||||
{block name='displayCartTotalPriceLabelTotal'}
|
||||
{hook h="displayCartTotalPriceLabel" type='total'}
|
||||
{/block}
|
||||
<span class="cart_total_values {if isset($is_advance_payment) && $is_advance_payment} strong{/if}">
|
||||
{if $use_taxes}
|
||||
{displayPrice price=$total_price}
|
||||
{else}
|
||||
{displayPrice price=$total_price_without_tax}
|
||||
{/if}
|
||||
</span>
|
||||
</p>
|
||||
{if isset($is_advance_payment) && $is_advance_payment}
|
||||
<hr>
|
||||
<p>
|
||||
<span>{l s='Due Amount'}</span>
|
||||
<span class="cart_total_values">{displayPrice price=$dueAmount}</span>
|
||||
</p>
|
||||
<p class="cart_final_total_block">
|
||||
<span class="strong">{l s='Partially Payable Total'}</span>
|
||||
{block name='displayCartTotalPriceLabelPartial'}
|
||||
{hook h="displayCartTotalPriceLabel" type='partial'}
|
||||
{/block}
|
||||
<span class="cart_total_values">{displayPrice price=$advPaymentAmount}</span>
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -6322,7 +6322,7 @@ table.table_block td {
|
||||
font-size: 17px;
|
||||
line-height: 23px;
|
||||
color: #3a3939;
|
||||
margin-bottom: 0; }
|
||||
margin-bottom: 4px; }
|
||||
.product-name a {
|
||||
font-size: 17px;
|
||||
line-height: 23px;
|
||||
@@ -6538,6 +6538,12 @@ table.table_block td {
|
||||
padding-left: 35px;
|
||||
background-color: #FFF;
|
||||
}
|
||||
.input-hotel, .form-control .input-hotel {
|
||||
background: url("../img/icon/icon-hotel.svg") no-repeat 6px 50%;
|
||||
padding-left: 35px;
|
||||
padding-right: 20px;
|
||||
background-color: #FFF;
|
||||
}
|
||||
.input-occupancy, .form-control .input-occupancy {
|
||||
text-align: left;
|
||||
overflow: hidden;
|
||||
@@ -7595,6 +7601,33 @@ div.star a:hover {
|
||||
text-align: center;
|
||||
width: 57px; }
|
||||
|
||||
.quantity_cont {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
}
|
||||
.quantity_cont .cart_quantity_input {
|
||||
padding: 14px 10px;
|
||||
border: 1px solid #E1E3E7;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
text-align: center;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.quantity_cont .cart_quantity_button {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.quantity_cont .cart_quantity_button a {
|
||||
padding: 1px 5px;
|
||||
border: 0px;
|
||||
border: 1px solid #E1E3E7;
|
||||
color: #333;
|
||||
border-radius: 4px;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.cart_gift_quantity .cart_quantity_input {
|
||||
height: 27px;
|
||||
line-height: 27px;
|
||||
|
||||
@@ -98,6 +98,9 @@
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
display: inline-block; }
|
||||
.cart_block .cart-info .hotel-name {
|
||||
padding-bottom: 4px;
|
||||
margin-top: -8px; }
|
||||
.cart_block .cart-info .quantity-formated {
|
||||
display: inline-block;
|
||||
color: #9c9b9b;
|
||||
@@ -184,8 +187,6 @@
|
||||
width: 100%; } }*/
|
||||
#header .cart_block a {
|
||||
color: #fff; }
|
||||
#header .cart_block a:hover {
|
||||
color: #9c9b9b; }
|
||||
#header .cart_block .cart_block_list .remove_link a,
|
||||
#header .cart_block .cart_block_list .ajax_cart_block_remove_link {
|
||||
color: #fff;
|
||||
@@ -465,18 +466,18 @@
|
||||
/*# sourceMappingURL=blockcart.css.map */
|
||||
|
||||
|
||||
.remove_rooms_from_cart_link {
|
||||
.ajax_remove_product_option, .remove_rooms_from_cart_link {
|
||||
color: #777;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%; }
|
||||
.remove_rooms_from_cart_link:before {
|
||||
.ajax_remove_product_option:before, .remove_rooms_from_cart_link:before {
|
||||
display: inline-block;
|
||||
content: "\f057";
|
||||
font-family: "FontAwesome";
|
||||
font-size: 18px;
|
||||
line-height: 18px; }
|
||||
.remove_rooms_from_cart_link:hover {
|
||||
.ajax_remove_product_option:hover, .remove_rooms_from_cart_link:hover {
|
||||
color: #515151; }
|
||||
|
||||
.badge_style {
|
||||
|
||||
@@ -17,6 +17,11 @@
|
||||
* @license LICENSE.txt
|
||||
*/
|
||||
|
||||
.order-confirmation-column {
|
||||
font-size: 16px;
|
||||
line-height: 23px;
|
||||
color: #3C3C3C;
|
||||
}
|
||||
.fancybox-wrap.fancybox-extra-services .card {
|
||||
width: 650px;
|
||||
margin-bottom: 0;
|
||||
@@ -70,6 +75,10 @@
|
||||
padding: 18px;
|
||||
}
|
||||
|
||||
.order-product-summary .card .card-body {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.card .card-body .card-title {
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
@@ -113,6 +122,29 @@
|
||||
}
|
||||
/* card-tabs - end */
|
||||
|
||||
.product-detail {
|
||||
padding: 18px;
|
||||
position: relative;
|
||||
}
|
||||
.product-detail:not(:last-of-type) {
|
||||
border-bottom: 1px solid #E5E5E5;
|
||||
}
|
||||
.product-detail .product-name a {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
.product-detail dt {
|
||||
margin: 7px 0;
|
||||
font-weight: 400;
|
||||
}
|
||||
.product-detail dd {
|
||||
margin: 7px 0;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
#rooms_extra_services .card-body{
|
||||
padding: 0px 18px;
|
||||
}
|
||||
@@ -213,3 +245,18 @@
|
||||
.price-info-tooltip-cont .list-row p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.table.table-summary.table-sm td {
|
||||
padding: 8px 0;
|
||||
}
|
||||
.table.table-summary td {
|
||||
border-top: none;
|
||||
/* font-size: 16px; */
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
font-weight: normal;
|
||||
border-radius: 2px;
|
||||
}
|
||||
@@ -245,17 +245,17 @@
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.room-details .card-header {
|
||||
.room-details .card-header, .service-product-details .card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.room-details .card-header .booking-actions-wrap {
|
||||
.room-details .card-header .booking-actions-wrap, .service-product-details .card-header .booking-actions-wrap {
|
||||
margin: -6px 0;
|
||||
}
|
||||
|
||||
.room-details .card-header .booking-actions-wrap .col-xs-12 {
|
||||
.room-details .card-header .booking-actions-wrap .col-xs-12, .service-product-details .card-header .booking-actions-wrap .col-xs-12 {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
@@ -268,17 +268,17 @@
|
||||
padding: 18px;
|
||||
}
|
||||
|
||||
.room-details .booking-room-detail {
|
||||
.product-detail {
|
||||
padding: 18px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.room-details .booking-room-detail:not(:last-of-type) {
|
||||
.product-detail:not(:last-of-type) {
|
||||
border-bottom: 1px solid #E5E5E5;
|
||||
}
|
||||
|
||||
@media (min-width: 576px) {
|
||||
.booking-room-detail .num-refunded-rooms {
|
||||
.product-detail .num-refunded-rooms {
|
||||
float: right;
|
||||
display: inline-block;
|
||||
}
|
||||
@@ -295,32 +295,32 @@
|
||||
margin-left: -10px;
|
||||
}
|
||||
|
||||
.booking-room-detail .num-refunded-rooms {
|
||||
.product-detail .num-refunded-rooms {
|
||||
display: block;
|
||||
float: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) and (max-width: 1200px) {
|
||||
.room-details .card-header .booking-actions-wrap .col-xs-12 {
|
||||
.room-details .card-header .booking-actions-wrap .col-xs-12, .service-product-details .card-header .booking-actions-wrap .col-xs-12 {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.booking-room-detail .description-list dt {
|
||||
.product-detail .description-list dt {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.booking-room-detail .description-list dd {
|
||||
.product-detail .description-list dd {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.booking-room-detail .img-room-type {
|
||||
.product-detail .img-room-type {
|
||||
width: 100%;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.booking-room-detail .room-type-name h3 {
|
||||
.product-detail .product-name h3 {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
font-size: 20px;
|
||||
@@ -328,12 +328,12 @@
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.booking-room-detail .order-price-info {
|
||||
.product-detail .order-price-info {
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
|
||||
.booking-room-detail .num-refunded-rooms .badge {
|
||||
.product-detail .num-refunded-rooms .badge {
|
||||
padding: 5px;
|
||||
font-weight: normal;
|
||||
font-size: 12px;
|
||||
@@ -341,7 +341,7 @@
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.booking-room-detail .btn-view-extra-services {
|
||||
.product-detail .btn-view-extra-services {
|
||||
color: #167BFF;
|
||||
}
|
||||
|
||||
@@ -715,18 +715,18 @@
|
||||
padding-left: 6px;
|
||||
}
|
||||
|
||||
#order-detail #order_refund_request {
|
||||
#order-detail .order_refund_request {
|
||||
background-color: #ff4b4b;
|
||||
border: 1px solid #ff4b4b;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
#order-detail #order_refund_request:focus,
|
||||
#order-detail #order_refund_request:hover {
|
||||
#order-detail .order_refund_request:focus,
|
||||
#order-detail .order_refund_request:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
#order-detail #order_refund_request_submit {
|
||||
#order-detail .order_refund_request_submit {
|
||||
background-color: #36BA46;
|
||||
border: 1px solid #36BA46;
|
||||
color: #fff;
|
||||
|
||||
@@ -1372,6 +1372,26 @@ Quick View Styles
|
||||
color: #333;
|
||||
border: 1px solid #d6d4d4;
|
||||
}
|
||||
#product select.input-hotel {
|
||||
max-width: 100%;
|
||||
background-color: #fff;
|
||||
height: 48px;
|
||||
border-radius: 4px;
|
||||
padding-left: 35px;
|
||||
padding-right: 20px;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.13);
|
||||
border: 1px solid #999999;
|
||||
}
|
||||
|
||||
.product-options-block {
|
||||
margin-top: 20px;
|
||||
}
|
||||
.product-options-block div.radio span {
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.room_demands_container .room_demand_block {
|
||||
margin-bottom: 15px;
|
||||
color: #333;
|
||||
|
||||
@@ -445,7 +445,7 @@ p.payment_module a {
|
||||
|
||||
/* order-detail - start */
|
||||
@media (min-width: 576px) {
|
||||
.booking-room-detail .num-refunded-rooms {
|
||||
.product-detail .num-refunded-rooms {
|
||||
float: left !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,20 +23,36 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
var ajax_pre_check_var = '';
|
||||
|
||||
$(document).ready(function(){
|
||||
$('.cart_quantity_up').off('click').on('click', function(e){
|
||||
$(document).on('click', '.cart_quantity_up', function(e){
|
||||
e.preventDefault();
|
||||
upQuantity($(this).attr('id').replace('cart_quantity_up_', ''));
|
||||
$('#' + $(this).attr('id').replace('_up_', '_down_')).removeClass('disabled');
|
||||
// var prefix = "";
|
||||
|
||||
// if (typeof(cart) == 'undefined' || cart)
|
||||
// prefix = '.order-detail-content ';
|
||||
// else
|
||||
// prefix = '#fancybox-content ';
|
||||
// var id = $(this).attr('id').replace('cart_quantity_up_', 'quantity_')
|
||||
// var input = $(prefix + 'input[name=' + id + ']').val(parseInt($(prefix + 'input[name=' + id + ']').val()) + 1);
|
||||
|
||||
// updateQty(1, 1, input)
|
||||
});
|
||||
$('.cart_quantity_down').off('click').on('click', function(e){
|
||||
$(document).on('click', '.cart_quantity_down', function(e){
|
||||
e.preventDefault();
|
||||
downQuantity($(this).attr('id').replace('cart_quantity_down_', ''));
|
||||
});
|
||||
$('.cart_quantity_delete' ).off('click').on('click', function(e){
|
||||
$(document).on('click', '.cart_quantity_delete', function(e){
|
||||
e.preventDefault();
|
||||
deleteProductFromSummary($(this).attr('id'));
|
||||
});
|
||||
$(document).on('click', '.cart_room_delete', function(e){
|
||||
e.preventDefault();
|
||||
deleteRoomFromSummary(this);
|
||||
});
|
||||
$('.cart_address_delivery').on('change', function(e){
|
||||
changeAddressDelivery($(this));
|
||||
});
|
||||
@@ -376,12 +392,11 @@ function updateQty(val, cart, el)
|
||||
var prefix = "";
|
||||
|
||||
if (typeof(cart) == 'undefined' || cart)
|
||||
prefix = '#order-detail-content ';
|
||||
prefix = '.order-detail-content ';
|
||||
else
|
||||
prefix = '#fancybox-content ';
|
||||
|
||||
var id = $(el).attr('name');
|
||||
|
||||
var exp = new RegExp("^[0-9]+$");
|
||||
|
||||
if (exp.test(val) == true)
|
||||
@@ -390,11 +405,13 @@ function updateQty(val, cart, el)
|
||||
var input = $(prefix + 'input[name=' + id + ']').val();
|
||||
var QtyToUp = parseInt(input) - parseInt(hidden);
|
||||
|
||||
var [productId, id_service_product_option, id_hotel] = getRequestData(id.replace('quantity_', ''));
|
||||
|
||||
if (parseInt(QtyToUp) > 0)
|
||||
upQuantity(id.replace('quantity_', ''), QtyToUp);
|
||||
updateQuantityRequest(productId, 'up', id_service_product_option, id_hotel, QtyToUp)
|
||||
else if(parseInt(QtyToUp) < 0)
|
||||
downQuantity(id.replace('quantity_', ''), QtyToUp);
|
||||
}
|
||||
updateQuantityRequest(productId, 'down', id_service_product_option, id_hotel, QtyToUp)
|
||||
}
|
||||
else
|
||||
$(prefix + 'input[name=' + id + ']').val($(prefix + 'input[name=' + id + '_hidden]').val());
|
||||
|
||||
@@ -417,7 +434,15 @@ function deleteProductFromSummary(id)
|
||||
customizationId = parseInt(ids[2]);
|
||||
if (typeof(ids[3]) !== 'undefined')
|
||||
id_address_delivery = parseInt(ids[3]);
|
||||
$.ajax({
|
||||
|
||||
var id_service_product_option = 0;
|
||||
var id_hotel = 0;
|
||||
|
||||
var [productId, id_service_product_option, id_hotel] = getRequestData(id);
|
||||
if (ajax_pre_check_var) {
|
||||
ajax_pre_check_var.abort();
|
||||
}
|
||||
ajax_pre_check_var = $.ajax({
|
||||
type: 'POST',
|
||||
headers: { "cache-control": "no-cache" },
|
||||
url: baseUri + '?rand=' + new Date().getTime(),
|
||||
@@ -427,6 +452,8 @@ function deleteProductFromSummary(id)
|
||||
data: 'controller=cart'
|
||||
+ '&ajax=true&delete=true&summary=true'
|
||||
+ '&id_product='+productId
|
||||
+ '&id_service_product_option=' + id_service_product_option
|
||||
+ '&id_hotel=' + id_hotel
|
||||
+ '&ipa='+productAttributeId
|
||||
+ '&id_address_delivery='+id_address_delivery
|
||||
+ ((customizationId !== 0) ? '&id_customization=' + customizationId : '')
|
||||
@@ -519,6 +546,7 @@ function deleteProductFromSummary(id)
|
||||
});
|
||||
}
|
||||
updateCartSummary(jsonData.summary);
|
||||
updateOpcData();
|
||||
if (window.ajaxCart != undefined)
|
||||
ajaxCart.updateCart(jsonData);
|
||||
updateCustomizedDatas(jsonData.customizedDatas);
|
||||
@@ -552,6 +580,74 @@ function deleteProductFromSummary(id)
|
||||
});
|
||||
}
|
||||
|
||||
function deleteRoomFromSummary(el)
|
||||
{
|
||||
var id_product = $(el).data('id_product');
|
||||
var date_from = $(el).data('date_from');
|
||||
var date_to = $(el).data('date_to');
|
||||
var qty = $(el).data('qty');
|
||||
if (ajax_pre_check_var) {
|
||||
ajax_pre_check_var.abort();
|
||||
}
|
||||
ajax_pre_check_var = $.ajax({
|
||||
type: 'POST',
|
||||
headers: { "cache-control": "no-cache" },
|
||||
url: baseUri + '?rand=' + new Date().getTime(),
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType: 'json',
|
||||
data: 'controller=cart'
|
||||
+ '&ajax=true&add=true&summary=true'
|
||||
+ '&op=down'
|
||||
+ '&qty='+qty
|
||||
+ '&id_product='+id_product
|
||||
+ '&dateFrom='+date_from
|
||||
+ '&dateTo='+date_to
|
||||
+ '&token=' + static_token
|
||||
+ '&allow_refresh=1',
|
||||
success: function(jsonData)
|
||||
{
|
||||
if (jsonData.hasError) {
|
||||
var errors = '';
|
||||
for(var error in jsonData.errors)
|
||||
//IE6 bug fix
|
||||
if(error !== 'indexOf')
|
||||
errors += $('<div />').html(jsonData.errors[error]).text() + "\n";
|
||||
if (!!$.prototype.fancybox)
|
||||
$.fancybox.open([
|
||||
{
|
||||
type: 'inline',
|
||||
autoScale: true,
|
||||
minHeight: 30,
|
||||
content: '<p class="fancybox-error">' + errors + '</p>'
|
||||
}],
|
||||
{
|
||||
padding: 0
|
||||
});
|
||||
else
|
||||
alert(errors);
|
||||
} else {
|
||||
if (jsonData.refresh)
|
||||
{
|
||||
location.reload();
|
||||
return;
|
||||
}
|
||||
updateCartSummary(jsonData.summary);
|
||||
updateOpcData();
|
||||
if (window.ajaxCart != undefined)
|
||||
ajaxCart.updateCart(jsonData);
|
||||
updateCustomizedDatas(jsonData.customizedDatas);
|
||||
updateHookShoppingCart(jsonData.HOOK_SHOPPING_CART);
|
||||
updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA);
|
||||
if (typeof(getCarrierListAndUpdate) !== 'undefined' && jsonData.summary.products.length > 0)
|
||||
getCarrierListAndUpdate();
|
||||
if (typeof(updatePaymentMethodsDisplay) !== 'undefined')
|
||||
updatePaymentMethodsDisplay();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function refreshOddRow()
|
||||
{
|
||||
var odd_class = 'odd';
|
||||
@@ -574,26 +670,28 @@ function refreshOddRow()
|
||||
});
|
||||
$('.cart_item:last-child, .customization:last-child').addClass('last_item');
|
||||
}
|
||||
var timer = '';
|
||||
function debounce(func, delay) {
|
||||
if (ajax_pre_check_var) {
|
||||
ajax_pre_check_var.abort();
|
||||
}
|
||||
|
||||
function upQuantity(id, qty)
|
||||
// return function() {
|
||||
const context = this;
|
||||
const args = arguments;
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(function() {
|
||||
func.apply(context, args);
|
||||
}, delay);
|
||||
// };
|
||||
}
|
||||
|
||||
function updateQuantityRequest(productId, op, id_service_product_option, id_hotel, qty)
|
||||
{
|
||||
if (typeof(qty) == 'undefined' || !qty)
|
||||
qty = 1;
|
||||
var customizationId = 0;
|
||||
var productId = 0;
|
||||
var productAttributeId = 0;
|
||||
var id_address_delivery = 0;
|
||||
var ids = 0;
|
||||
ids = id.split('_');
|
||||
productId = parseInt(ids[0]);
|
||||
if (typeof(ids[1]) !== 'undefined')
|
||||
productAttributeId = parseInt(ids[1]);
|
||||
if (typeof(ids[2]) !== 'undefined' && ids[2] !== 'nocustom')
|
||||
customizationId = parseInt(ids[2]);
|
||||
if (typeof(ids[3]) !== 'undefined')
|
||||
id_address_delivery = parseInt(ids[3]);
|
||||
|
||||
$.ajax({
|
||||
if (ajax_pre_check_var) {
|
||||
ajax_pre_check_var.abort();
|
||||
}
|
||||
ajax_pre_check_var = $.ajax({
|
||||
type: 'POST',
|
||||
headers: { "cache-control": "no-cache" },
|
||||
url: baseUri + '?rand=' + new Date().getTime(),
|
||||
@@ -606,10 +704,10 @@ function upQuantity(id, qty)
|
||||
+ '&getproductprice=true'
|
||||
+ '&summary=true'
|
||||
+ '&id_product=' + productId
|
||||
+ '&ipa=' + productAttributeId
|
||||
+ '&id_address_delivery=' + id_address_delivery
|
||||
+ ((customizationId !== 0) ? '&id_customization=' + customizationId : '')
|
||||
+ '&id_service_product_option=' + id_service_product_option
|
||||
+ '&id_hotel=' + id_hotel
|
||||
+ '&qty=' + qty
|
||||
+ '&op=' + op
|
||||
+ '&token=' + static_token
|
||||
+ '&allow_refresh=1',
|
||||
success: function(jsonData)
|
||||
@@ -622,18 +720,18 @@ function upQuantity(id, qty)
|
||||
if(error !== 'indexOf')
|
||||
errors += $('<div />').html(jsonData.errors[error]).text() + "\n";
|
||||
if (!!$.prototype.fancybox)
|
||||
$.fancybox.open([
|
||||
{
|
||||
type: 'inline',
|
||||
autoScale: true,
|
||||
minHeight: 30,
|
||||
content: '<p class="fancybox-error">' + errors + '</p>'
|
||||
}],
|
||||
$.fancybox.open([
|
||||
{
|
||||
padding: 0
|
||||
});
|
||||
type: 'inline',
|
||||
autoScale: true,
|
||||
minHeight: 30,
|
||||
content: '<p class="fancybox-error">' + errors + '</p>'
|
||||
}],
|
||||
{
|
||||
padding: 0
|
||||
});
|
||||
else
|
||||
alert(errors);
|
||||
alert(errors);
|
||||
$('input[name=quantity_'+ id +']').val($('input[name=quantity_'+ id +'_hidden]').val());
|
||||
}
|
||||
else
|
||||
@@ -641,10 +739,11 @@ function upQuantity(id, qty)
|
||||
if (jsonData.refresh)
|
||||
window.location.href = window.location.href;
|
||||
updateCartSummary(jsonData.summary);
|
||||
updateOpcData();
|
||||
if (window.ajaxCart != undefined)
|
||||
ajaxCart.updateCart(jsonData);
|
||||
if (customizationId !== 0)
|
||||
updateCustomizedDatas(jsonData.customizedDatas);
|
||||
// if (customizationId !== 0)
|
||||
// updateCustomizedDatas(jsonData.customizedDatas);
|
||||
updateHookShoppingCart(jsonData.HOOK_SHOPPING_CART);
|
||||
updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA);
|
||||
if (typeof(getCarrierListAndUpdate) !== 'undefined')
|
||||
@@ -658,23 +757,56 @@ function upQuantity(id, qty)
|
||||
{
|
||||
error = "TECHNICAL ERROR: unable to save update quantity \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus;
|
||||
if (!!$.prototype.fancybox)
|
||||
$.fancybox.open([
|
||||
{
|
||||
type: 'inline',
|
||||
autoScale: true,
|
||||
minHeight: 30,
|
||||
content: '<p class="fancybox-error">' + error + '</p>'
|
||||
}],
|
||||
$.fancybox.open([
|
||||
{
|
||||
padding: 0
|
||||
});
|
||||
type: 'inline',
|
||||
autoScale: true,
|
||||
minHeight: 30,
|
||||
content: '<p class="fancybox-error">' + error + '</p>'
|
||||
}],
|
||||
{
|
||||
padding: 0
|
||||
});
|
||||
else
|
||||
alert(error);
|
||||
alert(error);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getRequestData(id)
|
||||
{
|
||||
var ids = 0;
|
||||
ids = id.split('_');
|
||||
productId = parseInt(ids[0]);
|
||||
id_service_product_option = 0;
|
||||
id_hotel = 0;
|
||||
if (typeof(ids[1]) !== 'undefined')
|
||||
id_service_product_option = parseInt(ids[1]);
|
||||
if (typeof(ids[2]) !== 'undefined' && ids[2] !== 'nocustom')
|
||||
id_hotel = parseInt(ids[2]);
|
||||
|
||||
return [productId, id_service_product_option, id_hotel];
|
||||
}
|
||||
|
||||
function upQuantity(id, qty)
|
||||
{
|
||||
if (typeof(qty) == 'undefined' || !qty)
|
||||
qty = 1;
|
||||
var productId = 0;
|
||||
var id_service_product_option = 0;
|
||||
var id_hotel = 0;
|
||||
|
||||
var [productId, id_service_product_option, id_hotel] = getRequestData(id);
|
||||
if (typeof(cart) == 'undefined' || cart)
|
||||
prefix = '.order-detail-content ';
|
||||
else
|
||||
prefix = '#fancybox-content ';
|
||||
updateQuantityRequest(productId, 'up', id_service_product_option, id_hotel, qty)
|
||||
$(prefix + 'input[name=quantity_' + id + ']').val(parseInt($(prefix + 'input[name=quantity_' + id + ']').val()) + parseInt(qty));
|
||||
$(prefix + 'input[name=quantity_' + id + '_hidden]').val(parseInt($(prefix + 'input[name=quantity_' + id + ']').val()) + parseInt(qty));
|
||||
}
|
||||
|
||||
function downQuantity(id, qty)
|
||||
{
|
||||
var val = $('input[name=quantity_' + id + ']').val();
|
||||
@@ -687,95 +819,97 @@ function downQuantity(id, qty)
|
||||
else if (qty < 0)
|
||||
qty = -qty;
|
||||
|
||||
var customizationId = 0;
|
||||
var productId = 0;
|
||||
var productAttributeId = 0;
|
||||
var id_address_delivery = 0;
|
||||
var ids = 0;
|
||||
var id_service_product_option = 0;
|
||||
var id_hotel = 0;
|
||||
var [productId, id_service_product_option, id_hotel] = getRequestData(id);
|
||||
|
||||
ids = id.split('_');
|
||||
productId = parseInt(ids[0]);
|
||||
if (typeof(ids[1]) !== 'undefined')
|
||||
productAttributeId = parseInt(ids[1]);
|
||||
if (typeof(ids[2]) !== 'undefined' && ids[2] !== 'nocustom')
|
||||
customizationId = parseInt(ids[2]);
|
||||
if (typeof(ids[3]) !== 'undefined')
|
||||
id_address_delivery = parseInt(ids[3]);
|
||||
if (typeof(cart) == 'undefined' || cart)
|
||||
prefix = '.order-detail-content ';
|
||||
else
|
||||
prefix = '#fancybox-content ';
|
||||
|
||||
if (newVal > 0 || $('#product_' + id + '_gift').length)
|
||||
{
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
headers: { "cache-control": "no-cache" },
|
||||
url: baseUri + '?rand=' + new Date().getTime(),
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType: 'json',
|
||||
data: 'controller=cart'
|
||||
+ '&ajax=true'
|
||||
+ '&add=true'
|
||||
+ '&getproductprice=true'
|
||||
+ '&summary=true'
|
||||
+ '&id_product='+productId
|
||||
+ '&ipa='+productAttributeId
|
||||
+ '&id_address_delivery='+id_address_delivery
|
||||
+ '&op=down'
|
||||
+ ((customizationId !== 0) ? '&id_customization='+customizationId : '')
|
||||
+ '&qty='+qty
|
||||
+ '&token='+static_token
|
||||
+ '&allow_refresh=1',
|
||||
success: function(jsonData)
|
||||
{
|
||||
if (jsonData.hasError)
|
||||
{
|
||||
var errors = '';
|
||||
for(var error in jsonData.errors)
|
||||
//IE6 bug fix
|
||||
if(error !== 'indexOf')
|
||||
errors += $('<div />').html(jsonData.errors[error]).text() + "\n";
|
||||
if (!!$.prototype.fancybox)
|
||||
$.fancybox.open([
|
||||
{
|
||||
type: 'inline',
|
||||
autoScale: true,
|
||||
minHeight: 30,
|
||||
content: '<p class="fancybox-error">' + errors + '</p>'
|
||||
}],
|
||||
{
|
||||
padding: 0
|
||||
});
|
||||
else
|
||||
alert(errors);
|
||||
$('input[name=quantity_' + id + ']').val($('input[name=quantity_' + id + '_hidden]').val());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (jsonData.refresh)
|
||||
window.location.href = window.location.href;
|
||||
updateCartSummary(jsonData.summary);
|
||||
updateQuantityRequest(productId, 'down', id_service_product_option, id_hotel, qty)
|
||||
$(prefix + 'input[name=quantity_' + id + ']').val(newVal);
|
||||
$(prefix + 'input[name=quantity_' + id + '_hidden]').val(newVal);
|
||||
// if (ajax_pre_check_var) {
|
||||
// ajax_pre_check_var.abort();
|
||||
// }
|
||||
// const debouncedAjax = debounce(function(data) {
|
||||
// ajax_pre_check_var = $.ajax({
|
||||
// type: 'POST',
|
||||
// headers: { "cache-control": "no-cache" },
|
||||
// url: baseUri + '?rand=' + new Date().getTime(),
|
||||
// async: true,
|
||||
// cache: false,
|
||||
// dataType: 'json',
|
||||
// data: 'controller=cart'
|
||||
// + '&ajax=true'
|
||||
// + '&add=true'
|
||||
// + '&getproductprice=true'
|
||||
// + '&summary=true'
|
||||
// + '&id_product='+productId
|
||||
// + '&ipa='+productAttributeId
|
||||
// + '&id_address_delivery='+id_address_delivery
|
||||
// + '&op=down'
|
||||
// + ((customizationId !== 0) ? '&id_customization='+customizationId : '')
|
||||
// + '&qty='+qty
|
||||
// + '&token='+static_token
|
||||
// + '&allow_refresh=1',
|
||||
// success: function(jsonData)
|
||||
// {
|
||||
// if (jsonData.hasError)
|
||||
// {
|
||||
// var errors = '';
|
||||
// for(var error in jsonData.errors)
|
||||
// //IE6 bug fix
|
||||
// if(error !== 'indexOf')
|
||||
// errors += $('<div />').html(jsonData.errors[error]).text() + "\n";
|
||||
// if (!!$.prototype.fancybox)
|
||||
// $.fancybox.open([
|
||||
// {
|
||||
// type: 'inline',
|
||||
// autoScale: true,
|
||||
// minHeight: 30,
|
||||
// content: '<p class="fancybox-error">' + errors + '</p>'
|
||||
// }],
|
||||
// {
|
||||
// padding: 0
|
||||
// });
|
||||
// else
|
||||
// alert(errors);
|
||||
// $('input[name=quantity_' + id + ']').val($('input[name=quantity_' + id + '_hidden]').val());
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (jsonData.refresh)
|
||||
// window.location.href = window.location.href;
|
||||
// updateCartSummary(jsonData.summary);
|
||||
// updateOpcData();
|
||||
// if (window.ajaxCart !== undefined)
|
||||
// ajaxCart.updateCart(jsonData);
|
||||
// if (customizationId !== 0)
|
||||
// updateCustomizedDatas(jsonData.customizedDatas);
|
||||
// updateHookShoppingCart(jsonData.HOOK_SHOPPING_CART);
|
||||
// updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA);
|
||||
|
||||
if (window.ajaxCart !== undefined)
|
||||
ajaxCart.updateCart(jsonData);
|
||||
if (customizationId !== 0)
|
||||
updateCustomizedDatas(jsonData.customizedDatas);
|
||||
updateHookShoppingCart(jsonData.HOOK_SHOPPING_CART);
|
||||
updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA);
|
||||
|
||||
if (newVal == 0)
|
||||
$('#product_' + id).hide();
|
||||
|
||||
if (typeof(getCarrierListAndUpdate) !== 'undefined')
|
||||
getCarrierListAndUpdate();
|
||||
if (typeof(updatePaymentMethodsDisplay) !== 'undefined')
|
||||
updatePaymentMethodsDisplay();
|
||||
}
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
||||
if (textStatus !== 'abort')
|
||||
alert("TECHNICAL ERROR: unable to save update quantity \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
|
||||
}
|
||||
});
|
||||
// if (newVal == 0)
|
||||
// $('#product_' + id).hide();
|
||||
|
||||
// if (typeof(getCarrierListAndUpdate) !== 'undefined')
|
||||
// getCarrierListAndUpdate();
|
||||
// if (typeof(updatePaymentMethodsDisplay) !== 'undefined')
|
||||
// updatePaymentMethodsDisplay();
|
||||
// }
|
||||
// },
|
||||
// error: function(XMLHttpRequest, textStatus, errorThrown) {
|
||||
// if (textStatus !== 'abort')
|
||||
// alert("TECHNICAL ERROR: unable to save update quantity \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
|
||||
// }
|
||||
// });
|
||||
// }, 200);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -866,10 +1000,12 @@ function updateCartSummary(json)
|
||||
var key_for_blockcart_nocustom = product_list[i].id_product + '_' + product_list[i].id_product_attribute + '_' + ((product_list[i].id_customization && product_list[i].quantity_without_customization != product_list[i].quantity)? 'nocustom' : '0') + '_' + product_list[i].id_address_delivery;
|
||||
|
||||
$('#product_price_' + key_for_blockcart).html('<li class="' + current_price_class + '">' + current_price + '</li>' + initial_price_text);
|
||||
if (typeof(product_list[i].customizationQuantityTotal) !== 'undefined' && product_list[i].customizationQuantityTotal > 0)
|
||||
if (typeof(product_list[i].customizationQuantityTotal) !== 'undefined' && product_list[i].customizationQuantityTotal > 0) {
|
||||
$('#total_product_price_' + key_for_blockcart).html(formatCurrency(product_customization_total, currencyFormat, currencySign, currencyBlank));
|
||||
else
|
||||
}
|
||||
else {
|
||||
$('#total_product_price_' + key_for_blockcart).html(formatCurrency(product_total, currencyFormat, currencySign, currencyBlank));
|
||||
}
|
||||
if (product_list[i].quantity_without_customization != product_list[i].quantity)
|
||||
$('#total_product_price_' + key_for_blockcart_nocustom).html(formatCurrency(product_total, currencyFormat, currencySign, currencyBlank));
|
||||
|
||||
|
||||
@@ -127,17 +127,16 @@ var ajaxCart = {
|
||||
dateFormat: 'DD-MM-YYYY',
|
||||
dateFormatFull: 'DD-MM-YYYY HH:mm:ss',
|
||||
nb_total_products: 0,
|
||||
//override every button in the page in relation to the cart
|
||||
overrideButtonsInThePage: function() {
|
||||
_overrideButtonsInThePage: function () {
|
||||
//for every 'add' buttons...
|
||||
$(document).off('click', '.ajax_add_to_cart_button').on('click', '.ajax_add_to_cart_button', function(e) {
|
||||
$(document).off('click', '.ajax_add_to_cart_button').on('click', '.ajax_add_to_cart_button', function (e) {
|
||||
e.preventDefault();
|
||||
var idProduct = parseInt($(this).data('id-product'));
|
||||
var idProductAttribute = parseInt($(this).data('id-product-attribute'));
|
||||
|
||||
var dateFrom = $(this).attr('cat_rm_check_in');
|
||||
var dateTo = $(this).attr('cat_rm_check_out');
|
||||
var occupancy = getBookingOccupancyDetails($(this).closest('.booking_room_fields'));
|
||||
var occupancy = getBookingOccupancyDetails($(this).closest('.booking_room_fields'), true);
|
||||
/* By Webkul
|
||||
* Note : In our case minimalQuantity is taken from Qty. field
|
||||
*/
|
||||
@@ -147,25 +146,30 @@ var ajaxCart = {
|
||||
// if (!minimalQuantity)
|
||||
// minimalQuantity = 1;
|
||||
if ($(this).prop('disabled') != 'disabled' && occupancy)
|
||||
ajaxCart.add(idProduct, idProductAttribute, false, this, occupancy, null, dateFrom, dateTo);
|
||||
ajaxCart.add(idProduct, false, idProductAttribute, false, this, occupancy, null, dateFrom, dateTo, 1);
|
||||
});
|
||||
//for product page 'add' button...
|
||||
if ($('.cart_block').length) {
|
||||
$(document).off('click', '#add_to_cart button').on('click', '#add_to_cart button', function(e) {
|
||||
$(document).off('click', '#add_to_cart button').on('click', '#add_to_cart button', function (e) {
|
||||
e.preventDefault();
|
||||
var booking_product = $('#product_page_booking_product').val()
|
||||
|
||||
var date_from = $('#room_check_in').val();
|
||||
var date_to = $('#room_check_out').val();
|
||||
var occupancy = getBookingOccupancyDetails($(this).closest('.booking_room_fields'));
|
||||
var id_hotel = $('#service_id_hotel').length ? $('#service_id_hotel').val() : 0;
|
||||
var occupancy = getBookingOccupancyDetails($(this).closest('.booking_room_fields'), parseInt(booking_product));
|
||||
|
||||
if (occupancy) {
|
||||
ajaxCart.add($('#product_page_product_id').val(), $('#idCombination').val(), true, null, occupancy, null, date_from, date_to);
|
||||
ajaxCart.add($('#product_page_product_id').val(), id_hotel, $('[name="id_service_product_option"]:checked').val(), true, null, occupancy, null, date_from, date_to, booking_product);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* By webkul to delete a single room from cart datewise
|
||||
*/
|
||||
$(document).on('click', '.rooms_remove_container .remove_rooms_from_cart_link', function(e) {
|
||||
$(document).on('click', '.rooms_remove_container .remove_rooms_from_cart_link', function (e) {
|
||||
e.preventDefault();
|
||||
var id_product = $(this).attr('id_product');
|
||||
// this condition is added by webkul to delete a single room form current cart.
|
||||
@@ -181,8 +185,16 @@ var ajaxCart = {
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.ajax_remove_product_option', function (e) {
|
||||
e.preventDefault();
|
||||
var id_product = $(this).attr('id_product');
|
||||
var id_hotel = $(this).attr('id_hotel');
|
||||
var id_service_product_option = $(this).attr('id_service_product_option');
|
||||
ajaxCart.remove(id_product, id_hotel, id_service_product_option);
|
||||
});
|
||||
|
||||
//for 'delete' buttons in the cart block...
|
||||
$(document).off('click', '.cart_block_list .ajax_cart_block_remove_link').on('click', '.cart_block_list .ajax_cart_block_remove_link', function(e) {
|
||||
$(document).off('click', '.cart_block_list .ajax_cart_block_remove_link').on('click', '.cart_block_list .ajax_cart_block_remove_link', function (e) {
|
||||
e.preventDefault();
|
||||
// Customized product management
|
||||
var customizationId = 0;
|
||||
@@ -190,15 +202,16 @@ var ajaxCart = {
|
||||
var productAttributeId = 0;
|
||||
var customizableProductDiv = $($(this).parent().parent()).find("div[data-id^=deleteCustomizableProduct_]");
|
||||
var idAddressDelivery = false;
|
||||
var idHotel = 0;
|
||||
|
||||
if (customizableProductDiv && $(customizableProductDiv).length) {
|
||||
var ids = customizableProductDiv.data('id').split('_');
|
||||
if (typeof(ids[1]) != 'undefined') {
|
||||
if (typeof (ids[1]) != 'undefined') {
|
||||
customizationId = parseInt(ids[1]);
|
||||
productId = parseInt(ids[2]);
|
||||
if (typeof(ids[3]) != 'undefined')
|
||||
if (typeof (ids[3]) != 'undefined')
|
||||
productAttributeId = parseInt(ids[3]);
|
||||
if (typeof(ids[4]) != 'undefined')
|
||||
if (typeof (ids[4]) != 'undefined')
|
||||
idAddressDelivery = parseInt(ids[4]);
|
||||
}
|
||||
}
|
||||
@@ -206,15 +219,17 @@ var ajaxCart = {
|
||||
// Common product management
|
||||
if (!customizationId) {
|
||||
//retrieve idProduct and idCombination from the displayed product in the block cart
|
||||
var firstCut = $(this).parent().parent().data('id').replace('cart_block_product_', '');
|
||||
var firstCut = $(this).closest('dt').data('id').replace('cart_block_product_', '');
|
||||
firstCut = firstCut.replace('deleteCustomizableProduct_', '');
|
||||
ids = firstCut.split('_');
|
||||
productId = parseInt(ids[0]);
|
||||
|
||||
if (typeof(ids[1]) != 'undefined')
|
||||
if (typeof (ids[1]) != 'undefined')
|
||||
productAttributeId = parseInt(ids[1]);
|
||||
if (typeof(ids[2]) != 'undefined')
|
||||
if (typeof (ids[2]) != 'undefined')
|
||||
idAddressDelivery = parseInt(ids[2]);
|
||||
if (typeof (ids[3]) != 'undefined')
|
||||
idHotel = parseInt(ids[3]);
|
||||
}
|
||||
|
||||
/*by webkul*/
|
||||
@@ -231,9 +246,15 @@ var ajaxCart = {
|
||||
}
|
||||
|
||||
// Removing product from the cart
|
||||
ajaxCart.remove(productId, productAttributeId, customizationId, idAddressDelivery, dateFrom, dateTo);
|
||||
ajaxCart.remove(productId, idHotel, productAttributeId, customizationId, idAddressDelivery, dateFrom, dateTo);
|
||||
});
|
||||
},
|
||||
get overrideButtonsInThePage() {
|
||||
return this._overrideButtonsInThePage;
|
||||
},
|
||||
set overrideButtonsInThePage(value) {
|
||||
this._overrideButtonsInThePage = value;
|
||||
},
|
||||
|
||||
// try to expand the cart
|
||||
expand: function() {
|
||||
@@ -324,7 +345,7 @@ var ajaxCart = {
|
||||
// close fancybox
|
||||
updateFancyBox: function() {},
|
||||
// add a product in the cart via ajax
|
||||
add: function(idProduct, idCombination, addedFromProductPage, callerElement, occupancy, whishlist, dateFrom, dateTo) {
|
||||
add: function(idProduct, idHotel, idCombination, addedFromProductPage, callerElement, occupancy, whishlist, dateFrom, dateTo, booking_product) {
|
||||
if (addedFromProductPage && !checkCustomizations()) {
|
||||
if (contentOnly) {
|
||||
var productUrl = window.document.location.href + '';
|
||||
@@ -366,24 +387,35 @@ var ajaxCart = {
|
||||
req.append('token', static_token);
|
||||
req.append('id_customization', ((typeof customizationId !== 'undefined') ? customizationId : 0));
|
||||
if (parseInt(idCombination) && idCombination != null){
|
||||
req.append('ipa', parseInt(idCombination));
|
||||
req.append('id_service_product_option', parseInt(idCombination));
|
||||
}
|
||||
req.append('id_hotel', idHotel);
|
||||
|
||||
// get the selected extra demands by customer
|
||||
if (typeof dateFrom != 'undefined')
|
||||
req.append('dateFrom', dateFrom);
|
||||
if (typeof dateTo != 'undefined')
|
||||
req.append('dateTo', dateTo);
|
||||
if (parseInt(booking_product)) {
|
||||
// get the selected extra demands by customer
|
||||
if (typeof dateFrom != 'undefined')
|
||||
req.append('dateFrom', dateFrom);
|
||||
if (typeof dateTo != 'undefined')
|
||||
req.append('dateTo', dateTo);
|
||||
|
||||
if (occupancy_required_for_booking) {
|
||||
req.append('occupancy', JSON.stringify(occupancy));
|
||||
if (occupancy_required_for_booking) {
|
||||
console.log(JSON.stringify(occupancy));
|
||||
|
||||
req.append('occupancy', JSON.stringify(occupancy));
|
||||
} else {
|
||||
req.append('qty', ((occupancy && occupancy != null) ? occupancy : '1'));
|
||||
}
|
||||
|
||||
var roomDemands = getRoomsExtraDemands();
|
||||
req.append('roomDemands', JSON.stringify(roomDemands) );
|
||||
req.append('serviceProducts', JSON.stringify(getRoomsServiceProducts()) );
|
||||
} else {
|
||||
req.append('qty', ((occupancy && occupancy != null) ? occupancy : '1'));
|
||||
// if (parseInt(idCombination) && idCombination != null){
|
||||
// req.append('id_service_product_option', parseInt(idCombination));
|
||||
// }
|
||||
}
|
||||
|
||||
var roomDemands = getRoomsExtraDemands();
|
||||
req.append('roomDemands', JSON.stringify(roomDemands) );
|
||||
req.append('serviceProducts', JSON.stringify(getRoomsServiceProducts()) );
|
||||
|
||||
//send the ajax request to the server
|
||||
$.ajax({
|
||||
@@ -402,11 +434,12 @@ var ajaxCart = {
|
||||
/*by webkul checking and setting availability of rooms*/
|
||||
/*for product page add to cart quantity management*/
|
||||
if (pagename == 'product') {
|
||||
resetRoomtypeServices();
|
||||
|
||||
if (jsonData.avail_rooms == 0) {
|
||||
disableRoomTypeDemands(1);
|
||||
}
|
||||
resetRoomtypeServices();
|
||||
|
||||
BookingForm.refresh(true);
|
||||
}
|
||||
|
||||
@@ -652,7 +685,7 @@ var ajaxCart = {
|
||||
},
|
||||
|
||||
//remove a product from the cart via ajax
|
||||
remove: function(idProduct, idCombination, customizationId, idAddressDelivery, dateFrom, dateTo) {
|
||||
remove: function(idProduct, idHotel, idCombination, customizationId, idAddressDelivery, dateFrom, dateTo) {
|
||||
//send the ajax request to the server
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
@@ -663,7 +696,7 @@ var ajaxCart = {
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType: "json",
|
||||
data: 'controller=cart&delete=1&dateFrom=' + dateFrom + '&dateTo=' + dateTo + '&id_product=' + idProduct + '&ipa=' + ((idCombination != null && parseInt(idCombination)) ? idCombination : '') + ((customizationId && customizationId != null) ? '&id_customization=' + customizationId : '') + '&id_address_delivery=' + idAddressDelivery + '&token=' + static_token + '&ajax=true',
|
||||
data: 'controller=cart&delete=1&dateFrom=' + dateFrom + '&dateTo=' + dateTo + '&id_product=' + idProduct + '&id_hotel=' + idHotel + '&id_service_product_option=' + ((idCombination != null && parseInt(idCombination)) ? idCombination : '') + ((customizationId && customizationId != null) ? '&id_customization=' + customizationId : '') + '&id_address_delivery=' + idAddressDelivery + '&token=' + static_token + '&ajax=true',
|
||||
success: function(jsonData) {
|
||||
if (pagename == 'product') {
|
||||
disableRoomTypeDemands(0);
|
||||
@@ -691,7 +724,7 @@ var ajaxCart = {
|
||||
}
|
||||
}
|
||||
if (pagename == 'orderopc') {
|
||||
location.reload();
|
||||
updateOpcData();
|
||||
}
|
||||
|
||||
ajaxCart.updateCart(jsonData);
|
||||
@@ -740,10 +773,18 @@ var ajaxCart = {
|
||||
for (aProduct in jsonData.products) {
|
||||
//we've called the variable aProduct because IE6 bug if this variable is called product
|
||||
//if product has attributes
|
||||
if (jsonData.products[aProduct]['id'] == ids[0] && (!ids[1] || jsonData.products[aProduct]['idCombination'] == ids[1])) {
|
||||
stayInTheCart = true;
|
||||
// update the product customization display (when the product is still in the cart)
|
||||
ajaxCart.hideOldProductCustomizations(jsonData.products[aProduct], domIdProduct);
|
||||
if (parseInt(jsonData.products[aProduct]['service_product_type']) == SERVICE_PRODUCT_lINKED_WITH_HOTEL) {
|
||||
$.each(jsonData.products[aProduct]['hotel_wise_data'], function() {
|
||||
if (!ids[3] || (ids[3] == this.id_hotel)) {
|
||||
stayInTheCart = true;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (jsonData.products[aProduct]['id'] == ids[0] && (!ids[1] || jsonData.products[aProduct]['idCombination'] == ids[1])) {
|
||||
stayInTheCart = true;
|
||||
// update the product customization display (when the product is still in the cart)
|
||||
ajaxCart.hideOldProductCustomizations(jsonData.products[aProduct], domIdProduct);
|
||||
}
|
||||
}
|
||||
}
|
||||
//remove product if it's no more in the cart
|
||||
@@ -858,7 +899,7 @@ var ajaxCart = {
|
||||
$(jsonData.products).each(function(key, value) {
|
||||
//fix ie6 bug (one more item 'undefined' in IE6)
|
||||
if (this.id != undefined) {
|
||||
if (!this.booking_product && this.service_product_type != 2) {
|
||||
if (!this.booking_product && parseInt(this.service_product_type) == SERVICE_PRODUCT_WITH_ROOMTYPE) {
|
||||
return;
|
||||
}
|
||||
//create a container for listing the products and hide the 'no product in the cart' message (only if the cart was empty)
|
||||
@@ -866,171 +907,254 @@ var ajaxCart = {
|
||||
$('.cart_block_no_products').before('<dl class="products"></dl>');
|
||||
$('.cart_block_no_products').hide();
|
||||
}
|
||||
//if product is not in the displayed cart, add a new product's line
|
||||
var domIdProduct = this.id + '_' + (this.idCombination ? this.idCombination : '0') + '_' + (this.idAddressDelivery ? this.idAddressDelivery : '0');
|
||||
var domIdProductAttribute = this.id + '_' + (this.idCombination ? this.idCombination : '0');
|
||||
|
||||
var productId = parseInt(this.id);
|
||||
|
||||
if ($('dt[data-id="cart_block_product_' + domIdProduct + '"]').length == 0) {
|
||||
var productAttributeId = (this.hasAttributes ? parseInt(this.attributes) : 0);
|
||||
var content = '<dt class="unvisible" data-id="cart_block_product_' + domIdProduct + '">';
|
||||
var name = $.trim($('<span />').html(this.name).text());
|
||||
name = (name.length > 30 ? name.substring(0, 27) + '...' : name);
|
||||
content += '<a class="cart-images" href="' + this.link + '" title="' + name + '"><img src="' + this.image_cart + '" alt="' + this.name + '"></a>';
|
||||
|
||||
content += '<div class="cart-info">';
|
||||
content += '<div class="product-name">';
|
||||
content += '<a href="' + this.link + '" title="' + this.name + '" class="cart_block_product_name">' + name + '</a>';
|
||||
content += '</div>';
|
||||
|
||||
if (this.hasAttributes)
|
||||
content += '<div class="product-atributes"><a href="' + this.link + '" title="' + this.name + '">' + this.attributes + '</a></div>';
|
||||
|
||||
if (typeof(freeProductTranslation) != 'undefined') {
|
||||
content += '<div class="cart-info-sec rm_product_info_' + productId + '">';
|
||||
content += '<span class="product_info_label">Price:</span>';
|
||||
content += '<span class="price product_info_data" ttl_prod_price="' + this.bookingData.total_room_type_amount + '"> ';
|
||||
content += formatCurrency(parseFloat(this.bookingData.total_room_type_amount), currency_format, currency_sign, currency_blank);
|
||||
content += '</span>';
|
||||
content += '</div>';
|
||||
}
|
||||
content += '<div class="cart-info-sec rm_product_info_' + productId + '">';
|
||||
content += '<span class="product_info_label">' + total_qty_txt + ':</span>';
|
||||
content += '<span class="quantity-formated">';
|
||||
content += '<span class="quantity product_info_data">';
|
||||
if (this.booking_product)
|
||||
content += this.bookingData.total_num_rooms;
|
||||
else
|
||||
content += this.cart_quantity;
|
||||
content += '</span>';
|
||||
content += '</span>';
|
||||
content += '</div>';
|
||||
content += '</div>';
|
||||
|
||||
|
||||
if (typeof(this.is_gift) == 'undefined' || this.is_gift == 0)
|
||||
content += '<span class="remove_link"><a rel="nofollow" class="ajax_cart_block_remove_link" href="' + baseUri + '?controller=cart&delete=1&id_product=' + productId + '&token=' + static_token + (this.hasAttributes ? '&ipa=' + parseInt(this.idCombination) : '') + '"> </a></span>';
|
||||
else
|
||||
content += '<span class="remove_link"></span>';
|
||||
|
||||
|
||||
content += '<div style="clear:both;"></div>';
|
||||
// data for rooms only
|
||||
if (this.booking_product) {
|
||||
content += '<div id="booking_dates_container_' + productId + '" class="cart_prod_cont">';
|
||||
content += '<div class="table-responsive">';
|
||||
content += '<table class="table">';
|
||||
content += '<tbody>';
|
||||
content += '<tr>';
|
||||
content += '<th>' + duration_txt + '</th>';
|
||||
content += '<th>' + qty_txt + '.</th>';
|
||||
content += '<th>' + price_txt + '</th>';
|
||||
content += '<th> </th>';
|
||||
content += '</tr>';
|
||||
|
||||
if (this.bookingData.date_diff !== 'undefined') {
|
||||
$.each(this.bookingData.date_diff, function(date_diff_k, date_diff_v) {
|
||||
from = $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_form));
|
||||
to = $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_to));
|
||||
let dateFormatToUse = from == to ? ajaxCart.dateFormatFull : ajaxCart.dateFormat;
|
||||
content += '<tr class="rooms_remove_container">';
|
||||
content += '<td>' + moment(new Date(date_diff_v.data_form)).format(dateFormatToUse) + ' - ' + moment(new Date(date_diff_v.data_to)).format(dateFormatToUse) + '</td>';
|
||||
content += '<td class="num_rooms_in_date">' + date_diff_v.num_rm + '</td>';
|
||||
content += '<td>' + formatCurrency(parseFloat(date_diff_v.amount) + parseFloat(date_diff_v.demand_price), currency_format, currency_sign, currency_blank) + '</td>';
|
||||
content += '<td>';
|
||||
content += '<a class="remove_rooms_from_cart_link" href="#" rm_price=' + date_diff_v.amount + ' id_product=' + productId + ' date_from=' + date_diff_v.data_form + ' date_to=' + date_diff_v.data_to + ' num_rooms=' + date_diff_v.num_rm + ' title="' + remove_rm_title + '"></a>';
|
||||
content += '</td>';
|
||||
content += '</tr>';
|
||||
});
|
||||
}
|
||||
content += '</tbody>';
|
||||
content += '</table>';
|
||||
content += '</div>';
|
||||
content += '</div>';
|
||||
}
|
||||
content += '</dt>';
|
||||
|
||||
if (this.hasAttributes)
|
||||
content += '<dd data-id="cart_block_combination_of_' + domIdProduct + '" class="unvisible">';
|
||||
if (this.hasCustomizedDatas)
|
||||
content += ajaxCart.displayNewCustomizedDatas(this);
|
||||
if (this.hasAttributes) content += '</dd>';
|
||||
|
||||
$('.cart_block dl.products').append(content);
|
||||
}
|
||||
//else update the product's line
|
||||
else {
|
||||
//by webkul to update rooms information on new room add to cart
|
||||
if (this.booking_product) {
|
||||
var booking_dates_content = '';
|
||||
// $("#booking_dates_container_"+this.id).empty();
|
||||
|
||||
$("#booking_dates_container_" + this.id).find("table.table tbody tr.rooms_remove_container").remove();
|
||||
|
||||
var product_price_float = this.price_float;
|
||||
if (this.bookingData.date_diff !== 'undefined') {
|
||||
$.each(this.bookingData.date_diff, function(date_diff_k1, date_diff_v1) {
|
||||
from = $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_form));
|
||||
to = $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_to));
|
||||
let dateFormatToUse = from == to ? ajaxCart.dateFormatFull : ajaxCart.dateFormat;
|
||||
booking_dates_content += '<tr class="rooms_remove_container">';
|
||||
booking_dates_content += '<td>' + moment(new Date(date_diff_v1.data_form)).format(dateFormatToUse) + ' - ' + moment(new Date(date_diff_v1.data_to)).format(dateFormatToUse) + '</td>';
|
||||
booking_dates_content += '<td class="num_rooms_in_date">' + date_diff_v1.num_rm + '</td>';
|
||||
booking_dates_content += '<td>' + formatCurrency(parseFloat(date_diff_v1.amount) + parseFloat(date_diff_v1.demand_price), currency_format, currency_sign, currency_blank) + '</td>';
|
||||
booking_dates_content += '<td>';
|
||||
booking_dates_content += '<a class="remove_rooms_from_cart_link" href="#" rm_price=' + date_diff_v1.amount + ' id_product=' + productId + ' date_from=' + date_diff_v1.data_form + ' date_to=' + date_diff_v1.data_to + ' num_rooms=' + date_diff_v1.num_rm + ' title="' + remove_rm_title + '"></a>';
|
||||
booking_dates_content += '</td>';
|
||||
booking_dates_content += '</tr>';
|
||||
});
|
||||
}
|
||||
|
||||
$("#booking_dates_container_" + this.id).find("table.table tbody").append(booking_dates_content);
|
||||
}
|
||||
//end
|
||||
|
||||
var jsonProduct = this;
|
||||
if ($.trim($('dt[data-id="cart_block_product_' + domIdProduct + '"] .quantity').html()) != jsonProduct.quantity || $.trim($('dt[data-id="cart_block_product_' + domIdProduct + '"] .price').html()) != jsonProduct.priceByLine) {
|
||||
// Usual product
|
||||
if (!this.is_gift) {
|
||||
$('dt[data-id="cart_block_product_' + domIdProduct + '"] .price').text(formatCurrency(parseFloat(this.bookingData.total_room_type_amount), currency_format, currency_sign, currency_blank));
|
||||
$('dt[data-id="cart_block_product_' + domIdProduct + '"] .price').attr('ttl_prod_price', this.bookingData.total_room_type_amount);
|
||||
} else
|
||||
$('dt[data-id="cart_block_product_' + domIdProduct + '"] .price').html(freeProductTranslation);
|
||||
|
||||
//cart_booking_data[key].total_num_rooms argument sent to update num of rooms instead of quantity
|
||||
if (this.booking_product) {
|
||||
ajaxCart.updateProductQuantity(jsonProduct, this.bookingData.total_num_rooms);
|
||||
} else {
|
||||
ajaxCart.updateProductQuantity(jsonProduct, jsonProduct.quantity);
|
||||
}
|
||||
|
||||
// Customized product
|
||||
if (jsonProduct.hasCustomizedDatas) {
|
||||
customizationFormatedDatas = ajaxCart.displayNewCustomizedDatas(jsonProduct);
|
||||
if (!$('ul[data-id="customization_' + domIdProductAttribute + '"]').length) {
|
||||
if (jsonProduct.hasAttributes)
|
||||
$('dd[data-id="cart_block_combination_of_' + domIdProduct + '"]').append(customizationFormatedDatas);
|
||||
else
|
||||
$('.cart_block dl.products').append(customizationFormatedDatas);
|
||||
} else {
|
||||
$('ul[data-id="customization_' + domIdProductAttribute + '"]').html('');
|
||||
$('ul[data-id="customization_' + domIdProductAttribute + '"]').append(customizationFormatedDatas);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$('.cart_block dl.products .unvisible').slideDown(450).removeClass('unvisible');
|
||||
|
||||
var removeLinks = $('dt[data-id="cart_block_product_' + domIdProduct + '"]').find('a.ajax_cart_block_remove_link');
|
||||
if (this.hasCustomizedDatas && removeLinks.length)
|
||||
$(removeLinks).each(function() {
|
||||
$(this).remove();
|
||||
if (parseInt(this.service_product_type) == SERVICE_PRODUCT_lINKED_WITH_HOTEL) {
|
||||
$(value.hotel_wise_data).each(function(i, val) {
|
||||
ajaxCart.addProductRow(value, val);
|
||||
});
|
||||
} else {
|
||||
ajaxCart.addProductRow(value);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
addProductRow: function(product, hotel_wise_data) {
|
||||
//if product is not in the displayed cart, add a new product's line
|
||||
var domIdProduct = product.id + '_' + (product.idCombination ? product.idCombination : '0') + '_' + (product.idAddressDelivery ? product.idAddressDelivery : '0') + '_' + ((hotel_wise_data && hotel_wise_data.id_hotel) ? hotel_wise_data.id_hotel : '0');
|
||||
var domIdProductAttribute = product.id + '_' + (product.idCombination ? product.idCombination : '0');
|
||||
var productId = parseInt(product.id);
|
||||
|
||||
if ($('dt[data-id="cart_block_product_' + domIdProduct + '"]').length == 0) {
|
||||
var productAttributeId = (product.hasAttributes ? parseInt(product.attributes) : 0);
|
||||
var content = '<dt class="unvisible" data-id="cart_block_product_' + domIdProduct + '">';
|
||||
var name = $.trim($('<span />').html(product.name).text());
|
||||
name = (name.length > 30 ? name.substring(0, 27) + '...' : name);
|
||||
content += '<a class="cart-images" href="' + product.link + '" title="' + name + '"><img src="' + product.image_cart + '" alt="' + product.name + '"></a>';
|
||||
|
||||
content += '<div class="cart-info">';
|
||||
content += '<div class="product-name">';
|
||||
content += '<a href="' + product.link + '" title="' + product.name + '" class="cart_block_product_name">' + name + '</a>';
|
||||
content += '</div>';
|
||||
if (parseInt(product.service_product_type) == SERVICE_PRODUCT_lINKED_WITH_HOTEL) {
|
||||
content += '<div class="hotel-name">' + hotel_wise_data.hotel_name + '</div>';
|
||||
}
|
||||
|
||||
if (product.hasAttributes)
|
||||
content += '<div class="product-atributes"><a href="' + product.link + '" title="' + product.name + '">' + product.attributes + '</a></div>';
|
||||
|
||||
if (typeof(freeProductTranslation) != 'undefined') {
|
||||
content += '<div class="cart-info-sec rm_product_info_' + productId + '">';
|
||||
content += '<span class="product_info_label">Price:</span>';
|
||||
content += '<span class="price product_info_data"> ';
|
||||
if (product.booking_product) {
|
||||
content += formatCurrency(parseFloat(product.bookingData.total_room_type_amount), currency_format, currency_sign, currency_blank);
|
||||
}else if (parseInt(product.service_product_type) == SERVICE_PRODUCT_lINKED_WITH_HOTEL) {
|
||||
content += formatCurrency(parseFloat(hotel_wise_data.amount), currency_format, currency_sign, currency_blank);
|
||||
} else {
|
||||
content += formatCurrency(parseFloat(product.amount), currency_format, currency_sign, currency_blank);
|
||||
}
|
||||
content += '</span>';
|
||||
content += '</div>';
|
||||
}
|
||||
content += '<div class="cart-info-sec rm_product_info_' + productId + '">';
|
||||
content += '<span class="product_info_label">' + total_qty_txt + ':</span>';
|
||||
content += '<span class="quantity-formated">';
|
||||
content += '<span class="quantity product_info_data">';
|
||||
if (product.booking_product)
|
||||
content += product.bookingData.total_num_rooms;
|
||||
else if (hotel_wise_data && hotel_wise_data.total_qty)
|
||||
content += hotel_wise_data.total_qty;
|
||||
else
|
||||
content += product.cart_quantity;
|
||||
content += '</span>';
|
||||
content += '</span>';
|
||||
content += '</div>';
|
||||
content += '</div>';
|
||||
|
||||
|
||||
if (typeof(product.is_gift) == 'undefined' || product.is_gift == 0)
|
||||
content += '<span class="remove_link"><a rel="nofollow" class="ajax_cart_block_remove_link" href="' + baseUri + '?controller=cart&delete=1&id_product=' + productId + '&token=' + static_token + (product.hasAttributes ? '&ipa=' + parseInt(product.idCombination) : '') + (hotel_wise_data && hotel_wise_data.id_hotel ? '&id_hotel=' + parseInt(hotel_wise_data.id_hotel) : '') + '"> </a></span>';
|
||||
else
|
||||
content += '<span class="remove_link"></span>';
|
||||
|
||||
|
||||
content += '<div style="clear:both;"></div>';
|
||||
// data for rooms only
|
||||
if (product.booking_product) {
|
||||
content += '<div id="booking_dates_container_' + productId + '" class="cart_prod_cont">';
|
||||
content += '<div class="table-responsive">';
|
||||
content += '<table class="table">';
|
||||
content += '<tbody>';
|
||||
content += '<tr>';
|
||||
content += '<th>' + duration_txt + '</th>';
|
||||
content += '<th>' + qty_txt + '.</th>';
|
||||
content += '<th>' + price_txt + '</th>';
|
||||
content += '<th> </th>';
|
||||
content += '</tr>';
|
||||
|
||||
if (product.bookingData.date_diff !== 'undefined') {
|
||||
$.each(product.bookingData.date_diff, function(date_diff_k, date_diff_v) {
|
||||
from = $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_form));
|
||||
to = $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_to));
|
||||
let dateFormatToUse = from == to ? ajaxCart.dateFormatFull : ajaxCart.dateFormat;
|
||||
content += '<tr class="rooms_remove_container">';
|
||||
content += '<td>' + moment(new Date(date_diff_v.data_form)).format(dateFormatToUse) + ' - ' + moment(new Date(date_diff_v.data_to)).format(dateFormatToUse) + '</td>';
|
||||
content += '<td class="num_rooms_in_date">' + date_diff_v.num_rm + '</td>';
|
||||
content += '<td>' + formatCurrency(parseFloat(date_diff_v.amount) + parseFloat(date_diff_v.demand_price), currency_format, currency_sign, currency_blank) + '</td>';
|
||||
content += '<td>';
|
||||
content += '<a class="remove_rooms_from_cart_link" href="#" rm_price=' + date_diff_v.amount + ' id_product=' + productId + ' date_from=' + date_diff_v.data_form + ' date_to=' + date_diff_v.data_to + ' num_rooms=' + date_diff_v.num_rm + ' title="' + remove_rm_title + '"></a>';
|
||||
content += '</td>';
|
||||
content += '</tr>';
|
||||
});
|
||||
}
|
||||
content += '</tbody>';
|
||||
content += '</table>';
|
||||
content += '</div>';
|
||||
content += '</div>';
|
||||
} else if (product.hasOptions) {
|
||||
content += '<div class="table-responsive cart_prod_cont">';
|
||||
content += '<table class="table">';
|
||||
content += '<tbody>';
|
||||
content += '<tr>';
|
||||
content += '<th>' + variant_txt + '</th>';
|
||||
content += '<th>' + qty_txt + '.</th>';
|
||||
content += '<th>' + price_txt + '</th>';
|
||||
content += '<th> </th>';
|
||||
content += '</tr>';
|
||||
if (parseInt(product.service_product_type) == SERVICE_PRODUCT_lINKED_WITH_HOTEL) {
|
||||
if (hotel_wise_data.options !== 'undefined') {
|
||||
var options = hotel_wise_data.options;
|
||||
}
|
||||
} else if (parseInt(product.service_product_type) == SERVICE_PRODUCT_STANDALONE) {
|
||||
if (product.options !== 'undefined') {
|
||||
var options = product.options;
|
||||
}
|
||||
}
|
||||
if (options !== 'undefined') {
|
||||
$.each(options, function(data_k, data_v) {
|
||||
content += '<tr class="product_option_row">';
|
||||
content += '<td>' + data_v.option_name + '</td>';
|
||||
content += '<td>' + data_v.quantity + '</td>';
|
||||
content += '<td>' + formatCurrency(parseFloat(data_v.total_price_tax_excl), currency_format, currency_sign, currency_blank) + '</td>';
|
||||
content += '<td class="text-right"><a class="ajax_remove_product_option" href="#" id_product="' + product.id_product + '" id_hotel="' + data_v.id_hotel + '" id_service_product_option="' + data_v.id_service_product_option + '" title="' + remove_rm_title + '"> </a></td>';
|
||||
content += '</tr>';
|
||||
});
|
||||
}
|
||||
content += '</tbody>';
|
||||
content += '</table>';
|
||||
content += '</div>';
|
||||
}
|
||||
content += '</dt>';
|
||||
|
||||
if (product.hasAttributes)
|
||||
content += '<dd data-id="cart_block_combination_of_' + domIdProduct + '" class="unvisible">';
|
||||
if (product.hasCustomizedDatas)
|
||||
content += ajaxCart.displayNewCustomizedDatas(product);
|
||||
if (product.hasAttributes) content += '</dd>';
|
||||
|
||||
$('.cart_block dl.products').append(content);
|
||||
}
|
||||
//else update the product's line
|
||||
else {
|
||||
//by webkul to update rooms information on new room add to cart
|
||||
if (product.booking_product) {
|
||||
var booking_dates_content = '';
|
||||
// $("#booking_dates_container_"+product.id).empty();
|
||||
|
||||
$("#booking_dates_container_" + product.id).find("table.table tbody tr.rooms_remove_container").remove();
|
||||
|
||||
var product_price_float = product.price_float;
|
||||
if (product.bookingData.date_diff !== 'undefined') {
|
||||
$.each(product.bookingData.date_diff, function(date_diff_k1, date_diff_v1) {
|
||||
from = $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_form));
|
||||
to = $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_to));
|
||||
let dateFormatToUse = from == to ? ajaxCart.dateFormatFull : ajaxCart.dateFormat;
|
||||
booking_dates_content += '<tr class="rooms_remove_container">';
|
||||
booking_dates_content += '<td>' + moment(new Date(date_diff_v1.data_form)).format(dateFormatToUse) + ' - ' + moment(new Date(date_diff_v1.data_to)).format(dateFormatToUse) + '</td>';
|
||||
booking_dates_content += '<td class="num_rooms_in_date">' + date_diff_v1.num_rm + '</td>';
|
||||
booking_dates_content += '<td>' + formatCurrency(parseFloat(date_diff_v1.amount) + parseFloat(date_diff_v1.demand_price), currency_format, currency_sign, currency_blank) + '</td>';
|
||||
booking_dates_content += '<td>';
|
||||
booking_dates_content += '<a class="remove_rooms_from_cart_link" href="#" rm_price=' + date_diff_v1.amount + ' id_product=' + productId + ' date_from=' + date_diff_v1.data_form + ' date_to=' + date_diff_v1.data_to + ' num_rooms=' + date_diff_v1.num_rm + ' title="' + remove_rm_title + '"></a>';
|
||||
booking_dates_content += '</td>';
|
||||
booking_dates_content += '</tr>';
|
||||
});
|
||||
}
|
||||
|
||||
$("#booking_dates_container_" + product.id).find("table.table tbody").append(booking_dates_content);
|
||||
} else if (product.hasOptions) {
|
||||
$('dt[data-id="cart_block_product_' + domIdProduct + '"] .cart_prod_cont tr.product_option_row').remove();
|
||||
var product_options_content = '';
|
||||
if (parseInt(product.service_product_type) == SERVICE_PRODUCT_lINKED_WITH_HOTEL) {
|
||||
if (hotel_wise_data.options !== 'undefined') {
|
||||
var options = hotel_wise_data.options;
|
||||
}
|
||||
} else if (parseInt(product.service_product_type) == SERVICE_PRODUCT_STANDALONE) {
|
||||
if (product.options !== 'undefined') {
|
||||
var options = product.options;
|
||||
}
|
||||
}
|
||||
if (options !== 'undefined') {
|
||||
$.each(options, function(data_k, data_v) {
|
||||
product_options_content += '<tr class="product_option_row">';
|
||||
product_options_content += '<td>' + data_v.option_name + '</td>';
|
||||
product_options_content += '<td>' + data_v.quantity + '</td>';
|
||||
product_options_content += '<td>' + formatCurrency(parseFloat(data_v.total_price_tax_excl), currency_format, currency_sign, currency_blank) + '</td>';
|
||||
product_options_content += '<td class="text-right"><a class="ajax_remove_product_option" href="#" id_product="' + product.id_product + '" id_hotel="' + data_v.id_hotel + '" id_service_product_option="' + data_v.id_service_product_option + '" title="' + remove_rm_title + '"> </a></td>';
|
||||
product_options_content += '</tr>';
|
||||
});
|
||||
}
|
||||
$('dt[data-id="cart_block_product_' + domIdProduct + '"] .cart_prod_cont table tbody').append(product_options_content);
|
||||
|
||||
}
|
||||
//end
|
||||
|
||||
var jsonProduct = product;
|
||||
if ($.trim($('dt[data-id="cart_block_product_' + domIdProduct + '"] .quantity').html()) != jsonProduct.quantity || $.trim($('dt[data-id="cart_block_product_' + domIdProduct + '"] .price').html()) != jsonProduct.priceByLine) {
|
||||
// Usual product
|
||||
if (!product.is_gift) {
|
||||
if (product.booking_product) {
|
||||
$('dt[data-id="cart_block_product_' + domIdProduct + '"] .price').text(formatCurrency(parseFloat(product.bookingData.total_room_type_amount), currency_format, currency_sign, currency_blank));
|
||||
} else if (parseInt(product.service_product_type) == SERVICE_PRODUCT_lINKED_WITH_HOTEL) {
|
||||
$('dt[data-id="cart_block_product_' + domIdProduct + '"] .price').text(formatCurrency(parseFloat(hotel_wise_data.amount), currency_format, currency_sign, currency_blank));
|
||||
} else {
|
||||
$('dt[data-id="cart_block_product_' + domIdProduct + '"] .price').text(formatCurrency(parseFloat(product.amount), currency_format, currency_sign, currency_blank));
|
||||
}
|
||||
} else
|
||||
$('dt[data-id="cart_block_product_' + domIdProduct + '"] .price').html(freeProductTranslation);
|
||||
|
||||
//cart_booking_data[key].total_num_rooms argument sent to update num of rooms instead of quantity
|
||||
if (product.booking_product) {
|
||||
ajaxCart.updateProductQuantity(jsonProduct, product.bookingData.total_num_rooms);
|
||||
} else if (parseInt(product.service_product_type) == SERVICE_PRODUCT_lINKED_WITH_HOTEL && hotel_wise_data && hotel_wise_data.total_qty) {
|
||||
ajaxCart.updateProductQuantity(jsonProduct, hotel_wise_data.total_qty);
|
||||
} else {
|
||||
ajaxCart.updateProductQuantity(jsonProduct, jsonProduct.cart_quantity);
|
||||
}
|
||||
|
||||
// Customized product
|
||||
if (jsonProduct.hasCustomizedDatas) {
|
||||
customizationFormatedDatas = ajaxCart.displayNewCustomizedDatas(jsonProduct);
|
||||
if (!$('ul[data-id="customization_' + domIdProductAttribute + '"]').length) {
|
||||
if (jsonProduct.hasAttributes)
|
||||
$('dd[data-id="cart_block_combination_of_' + domIdProduct + '"]').append(customizationFormatedDatas);
|
||||
else
|
||||
$('.cart_block dl.products').append(customizationFormatedDatas);
|
||||
} else {
|
||||
$('ul[data-id="customization_' + domIdProductAttribute + '"]').html('');
|
||||
$('ul[data-id="customization_' + domIdProductAttribute + '"]').append(customizationFormatedDatas);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$('.cart_block dl.products .unvisible').slideDown(450).removeClass('unvisible');
|
||||
|
||||
var removeLinks = $('dt[data-id="cart_block_product_' + domIdProduct + '"]').find('a.ajax_cart_block_remove_link');
|
||||
if (product.hasCustomizedDatas && removeLinks.length)
|
||||
$(removeLinks).each(function() {
|
||||
$(product).remove();
|
||||
});
|
||||
},
|
||||
|
||||
displayNewCustomizedDatas: function(product) {
|
||||
var content = '';
|
||||
var productId = parseInt(product.id);
|
||||
@@ -1085,7 +1209,7 @@ var ajaxCart = {
|
||||
// change text labels according to product type
|
||||
$('#layer_cart .layer_cart_room_txt').hide();
|
||||
$('#layer_cart .layer_cart_product_txt').hide();
|
||||
if(product.booking_product) {
|
||||
if(parseInt(product.booking_product)) {
|
||||
$('#layer_cart .layer_cart_room_txt').show();
|
||||
} else {
|
||||
$('#layer_cart .layer_cart_product_txt').show();
|
||||
@@ -1101,22 +1225,30 @@ var ajaxCart = {
|
||||
$('#layer_cart_product_time_duration').text(
|
||||
product.date_from + ' - ' + product.date_to
|
||||
);
|
||||
|
||||
let rooms = 0;
|
||||
let adults = 0;
|
||||
let children = 0;
|
||||
let room_quantity_text = '';
|
||||
if (occupancy_required_for_booking) {
|
||||
$.each(product.occupancy, function(index, val) {
|
||||
rooms++;
|
||||
adults += parseInt(val.adults);
|
||||
children += parseInt(val.children);
|
||||
});
|
||||
room_quantity_text = getRoomTypeGuestOccupancyFormated(adults, children, rooms);
|
||||
$('#layer_cart_product_hotel_name').parent().hide();
|
||||
var product_quantity_text = '';
|
||||
if(parseInt(product.booking_product)) {
|
||||
let rooms = 0;
|
||||
let adults = 0;
|
||||
let children = 0;
|
||||
if (occupancy_required_for_booking) {
|
||||
$.each(product.occupancy, function(index, val) {
|
||||
rooms++;
|
||||
adults += parseInt(val.adults);
|
||||
children += parseInt(val.children);
|
||||
});
|
||||
product_quantity_text = getRoomTypeGuestOccupancyFormated(adults, children, rooms);
|
||||
} else {
|
||||
product_quantity_text = product.occupancy;
|
||||
}
|
||||
} else {
|
||||
room_quantity_text = product.occupancy;
|
||||
product_quantity_text = product.qty;
|
||||
$('#layer_cart_product_unit_price').text(product.unit_price);
|
||||
if (product.hotel_name) {
|
||||
$('#layer_cart_product_hotel_name').text(product.hotel_name).parent().show();
|
||||
}
|
||||
}
|
||||
$('#layer_cart_product_quantity').text(room_quantity_text);
|
||||
$('#layer_cart_product_quantity').text(product_quantity_text);
|
||||
|
||||
$('.layer_cart_img').html('<img class="layer_cart_img img-responsive" src="' + product.image + '" alt="' + product.name + '" title="' + product.name + '" />');
|
||||
|
||||
@@ -1188,8 +1320,18 @@ var ajaxCart = {
|
||||
$('.ajax_block_cart_total').text(jsonData.total);
|
||||
$('.ajax_block_cart_total').attr('total_cart_price', jsonData.totalToPay);
|
||||
|
||||
$('.ajax_block_room_total').text(jsonData.room_total);
|
||||
$('.ajax_block_nornal_products_total').text(jsonData.normalProductsTotal);
|
||||
$('.ajax_block_room_total').text(jsonData.room_total_format);
|
||||
if (jsonData.room_total) {
|
||||
$('.ajax_block_room_total').parent().show();
|
||||
} else {
|
||||
$('.ajax_block_room_total').parent().hide();
|
||||
}
|
||||
$('.ajax_block_product_total').text(jsonData.normal_products_total_format);
|
||||
if (jsonData.normal_products_total) {
|
||||
$('.ajax_block_product_total').parent().show();
|
||||
} else {
|
||||
$('.ajax_block_product_total').parent().hide();
|
||||
}
|
||||
$('.ajax_cart_convenience_fee').text(jsonData.total_convenience_fee_format);
|
||||
if (jsonData.total_convenience_fee) {
|
||||
$('.ajax_cart_convenience_fee').parent().show();
|
||||
@@ -1325,44 +1467,48 @@ function getRoomsServiceProducts()
|
||||
return serviceProducts;
|
||||
}
|
||||
|
||||
function getBookingOccupancyDetails(bookingform)
|
||||
function getBookingOccupancyDetails(bookingform, booking_product)
|
||||
{
|
||||
let occupancy;
|
||||
if (occupancy_required_for_booking) {
|
||||
$('.booking_guest_occupancy_conatiner .dropdown').removeClass('open');
|
||||
let selected_occupancy = $(bookingform).find(".occupancy_info_block.selected")
|
||||
if (selected_occupancy.length) {
|
||||
occupancy = [];
|
||||
$(selected_occupancy).each(function(ind, element) {
|
||||
if (parseInt($(element).find('.num_adults').val())) {
|
||||
let child_ages = [];
|
||||
$(element).find('.guest_child_age').each(function(index) {
|
||||
if ($(this).val() > -1) {
|
||||
child_ages.push($(this).val());
|
||||
}
|
||||
});
|
||||
if ($(element).find('.num_children').val()) {
|
||||
if (child_ages.length != $(element).find('.num_children').val()) {
|
||||
$(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open')
|
||||
occupancy = false;
|
||||
if (booking_product) {
|
||||
if (occupancy_required_for_booking) {
|
||||
$('.booking_guest_occupancy_conatiner .dropdown').removeClass('open');
|
||||
let selected_occupancy = $(bookingform).find(".occupancy_info_block.selected")
|
||||
if (selected_occupancy.length) {
|
||||
occupancy = [];
|
||||
$(selected_occupancy).each(function(ind, element) {
|
||||
if (parseInt($(element).find('.num_adults').val())) {
|
||||
let child_ages = [];
|
||||
$(element).find('.guest_child_age').each(function(index) {
|
||||
if ($(this).val() > -1) {
|
||||
child_ages.push($(this).val());
|
||||
}
|
||||
});
|
||||
if ($(element).find('.num_children').val()) {
|
||||
if (child_ages.length != $(element).find('.num_children').val()) {
|
||||
$(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open')
|
||||
occupancy = false;
|
||||
}
|
||||
}
|
||||
occupancy.push({
|
||||
'adults': $(element).find('.num_adults').val(),
|
||||
'children': $(element).find('.num_children').val(),
|
||||
'child_ages': child_ages
|
||||
});
|
||||
} else {
|
||||
$(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open')
|
||||
occupancy = false;
|
||||
}
|
||||
occupancy.push({
|
||||
'adults': $(element).find('.num_adults').val(),
|
||||
'children': $(element).find('.num_children').val(),
|
||||
'child_ages': child_ages
|
||||
});
|
||||
} else {
|
||||
$(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open')
|
||||
occupancy = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
$(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open')
|
||||
occupancy = false;
|
||||
}
|
||||
} else {
|
||||
$(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open')
|
||||
occupancy = false;
|
||||
occupancy = parseInt($(bookingform).find(".quantity_wanted").val());
|
||||
}
|
||||
} else {
|
||||
occupancy = parseInt($(bookingform).find(".quantity_wanted").val());
|
||||
occupancy = parseInt($('#service_product_qty').val());
|
||||
}
|
||||
|
||||
return occupancy;
|
||||
|
||||
@@ -78,7 +78,7 @@ function initPriceTooltip() {
|
||||
if ($('.order-price-info').length) {
|
||||
$('.order-price-info').each(function () {
|
||||
$(this).tooltip({
|
||||
content: $(this).closest('td').find('.price-info-container').html(),
|
||||
content: $(this).closest('dd').find('.price-info-container').html(),
|
||||
items: 'span',
|
||||
trigger: 'hover',
|
||||
tooltipClass: 'price-tootip',
|
||||
|
||||
@@ -283,7 +283,7 @@ const BookingRefundManager = {
|
||||
},
|
||||
}
|
||||
|
||||
$(document).on('click', '#order_refund_request', function(e) {
|
||||
$(document).on('click', '.order_refund_request', function(e) {
|
||||
e.preventDefault();
|
||||
BookingRefundManager.show();
|
||||
});
|
||||
|
||||
@@ -581,10 +581,11 @@ $(document).ready(function()
|
||||
maxWidth : '100%',
|
||||
'hideOnContentClick': false,
|
||||
afterClose: function() {
|
||||
if (result.reload) {
|
||||
// reload so that changes prices will reflect everywhere
|
||||
location.reload();
|
||||
}
|
||||
updateOpcData();
|
||||
// if (result.reload) {
|
||||
// // reload so that changes prices will reflect everywhere
|
||||
// location.reload();
|
||||
// }
|
||||
},
|
||||
});
|
||||
},
|
||||
@@ -593,13 +594,30 @@ $(document).ready(function()
|
||||
|
||||
function updateServiceProducts(element)
|
||||
{
|
||||
var operator = $(element).is(':checked') ? 'up' : 'down';
|
||||
var id_product = $(element).val();
|
||||
var id_cart_booking = $(element).data('id_cart_booking');
|
||||
var qty = $(element).closest('.room_demand_block').find('input.qty').val();
|
||||
var qty = $(element).closest('.room_demand_block').find('input.qty');
|
||||
if (typeof(qty) == 'undefined') {
|
||||
qty = 1;
|
||||
}
|
||||
var qty_hidden = $(element).closest('.room_demand_block').find('input.qty_hidden');
|
||||
var update_qty = parseInt($(qty).val()) - parseInt($(qty_hidden).val());
|
||||
var checked = $(element).is(':checked');
|
||||
|
||||
console.log(checked);
|
||||
|
||||
if (checked) {
|
||||
if (update_qty > 0) {
|
||||
var operator = 'up';
|
||||
} else {
|
||||
var operator = 'down'
|
||||
}
|
||||
} else {
|
||||
var operator = 'down';
|
||||
update_qty = 0;
|
||||
}
|
||||
|
||||
$(qty_hidden).val($(qty).val());
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
headers: {
|
||||
@@ -612,7 +630,7 @@ $(document).ready(function()
|
||||
operator: operator,
|
||||
id_product: id_product,
|
||||
id_cart_booking: id_cart_booking,
|
||||
qty: qty,
|
||||
qty: Math.abs(update_qty),
|
||||
updateServiceProduct: true,
|
||||
controller: 'cart',
|
||||
ajax: true,
|
||||
@@ -673,6 +691,44 @@ function updatePaymentMethodsDisplay()
|
||||
});
|
||||
}
|
||||
|
||||
function updateShoppingCart(json)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function updateOpcData()
|
||||
{
|
||||
var checked = '';
|
||||
if ($('#cgv:checked').length !== 0)
|
||||
checked = 1;
|
||||
else
|
||||
checked = 0;
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
headers: { "cache-control": "no-cache" },
|
||||
url: orderOpcUrl + '?rand=' + new Date().getTime(),
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType : 'JSON',
|
||||
data: 'ajax=true&method=getOpcData&token=' + static_token ,
|
||||
success: function(response)
|
||||
{
|
||||
if (response.success) {
|
||||
$('.cart_total_detail_block').replaceWith(response.cart_total_block);
|
||||
$('#collapse-shopping-cart .card-body').html(response.shopping_cart);
|
||||
$('.cart_quantity_input').typeWatch({
|
||||
highlight: true, wait: 600, captureLength: 0, callback: function(val){
|
||||
updateQty(val, true, this.el);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateAddressSelection(is_adv_api)
|
||||
{
|
||||
var idAddress_delivery = $('#opc_id_address_delivery').val();
|
||||
|
||||
@@ -1109,22 +1109,22 @@ $(document).ready(function() {
|
||||
removeRoomtypeProduct(this);
|
||||
});
|
||||
|
||||
$(document).on('click', '.service_product_qty_up', function(e) {
|
||||
$(document).on('click', '.room_service_product_qty_up', function(e) {
|
||||
e.preventDefault();
|
||||
qtyfield = $(this).closest('.qty_container').find('input.service_product_qty');
|
||||
qtyfield = $(this).closest('.qty_container').find('input.room_service_product_qty');
|
||||
var newQuantity = parseInt(qtyfield.val()) + 1;
|
||||
if (qtyfield.data('max_quantity') && qtyfield.data('max_quantity') < newQuantity) {
|
||||
newQuantity = qtyfield.data('max_quantity');
|
||||
}
|
||||
$(this).closest('.qty_container').find('.qty_count span').text(newQuantity);
|
||||
qtyfield.val(newQuantity);
|
||||
updateServiceQuantity(this);
|
||||
updateRoomServiceQuantity(this);
|
||||
});
|
||||
|
||||
// The button to decrement the product value
|
||||
$(document).on('click', '.service_product_qty_down', function(e) {
|
||||
$(document).on('click', '.room_service_product_qty_down', function(e) {
|
||||
e.preventDefault();
|
||||
qtyfield = $(this).closest('.qty_container').find('input.service_product_qty');
|
||||
qtyfield = $(this).closest('.qty_container').find('input.room_service_product_qty');
|
||||
var currentVal = parseInt(qtyfield.val());
|
||||
if (!isNaN(currentVal) && currentVal > 1) {
|
||||
$(this).closest('.qty_container').find('.qty_count span').text(currentVal - 1);
|
||||
@@ -1133,7 +1133,7 @@ $(document).ready(function() {
|
||||
$(this).closest('.qty_container').find('.qty_count span').text(1);
|
||||
qtyfield.val(1);
|
||||
}
|
||||
updateServiceQuantity(this);
|
||||
updateRoomServiceQuantity(this);
|
||||
});
|
||||
|
||||
var ajax_check_var = '';
|
||||
@@ -1200,6 +1200,46 @@ $(document).ready(function() {
|
||||
});
|
||||
});
|
||||
|
||||
var timer = '';
|
||||
// service Products
|
||||
$(document).on('click', '.service_product_qty_up', function(e) {
|
||||
e.preventDefault();
|
||||
qtyfield = $(this).closest('.qty_container').find('input.service_product_qty');
|
||||
var newQuantity = parseInt(qtyfield.val()) + 1;
|
||||
if (qtyfield.data('max_quantity') && qtyfield.data('max_quantity') < newQuantity) {
|
||||
newQuantity = qtyfield.data('max_quantity');
|
||||
}
|
||||
$(this).closest('.qty_container').find('.qty_count span').text(newQuantity);
|
||||
qtyfield.val(newQuantity);
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(function() {
|
||||
BookingForm.refresh()
|
||||
}, 500);
|
||||
});
|
||||
|
||||
// The button to decrement the product value
|
||||
$(document).on('click', '.service_product_qty_down', function(e) {
|
||||
e.preventDefault();
|
||||
qtyfield = $(this).closest('.qty_container').find('input.service_product_qty');
|
||||
var currentVal = parseInt(qtyfield.val());
|
||||
if (!isNaN(currentVal) && currentVal > 1) {
|
||||
$(this).closest('.qty_container').find('.qty_count span').text(currentVal - 1);
|
||||
qtyfield.val(currentVal - 1);
|
||||
} else {
|
||||
$(this).closest('.qty_container').find('.qty_count span').text(1);
|
||||
qtyfield.val(1);
|
||||
}
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(function() {
|
||||
BookingForm.refresh()
|
||||
}, 500);
|
||||
});
|
||||
|
||||
$(document).on('change', 'input[name="id_service_product_option"]', function(e) {
|
||||
BookingForm.refresh()
|
||||
});
|
||||
|
||||
|
||||
function abortRunningAjax() {
|
||||
if (ajax_check_var) {
|
||||
ajax_check_var.abort();
|
||||
@@ -1208,7 +1248,7 @@ $(document).ready(function() {
|
||||
});
|
||||
function addProductToRoomType(that) {
|
||||
var id_product = $(that).data('id-product');
|
||||
var qty = $('input#service_product_qty_'+id_product).val();
|
||||
var qty = $('input#room_service_product_qty_'+id_product).val();
|
||||
if (typeof(qty) == 'undefined') {
|
||||
qty = 1;
|
||||
}
|
||||
@@ -1234,7 +1274,7 @@ function addProductToRoomType(that) {
|
||||
function removeRoomtypeProduct(that) {
|
||||
var id_product = $(that).data('id-product');
|
||||
$(document).find('input#service_product_'+ id_product).remove();
|
||||
$('.select_room_service_'+ id_product).closest('.service_product_action_block').find('input.service_product_qty').val(1);
|
||||
$('.select_room_service_'+ id_product).closest('.service_product_action_block').find('input.room_service_product_qty').val(1);
|
||||
$('.select_room_service_'+ id_product).closest('.service_product_action_block').find('.qty_count span').text(1);
|
||||
$(that).prop('disabled', true);
|
||||
BookingForm.refresh().then(function (res) {
|
||||
@@ -1243,11 +1283,11 @@ function removeRoomtypeProduct(that) {
|
||||
});
|
||||
}
|
||||
|
||||
function updateServiceQuantity(that) {
|
||||
function updateRoomServiceQuantity(that) {
|
||||
var buttonElement = $(that).closest('.service_product_action_block').find('.btn-service-product');
|
||||
if ($(buttonElement).hasClass('remove_roomtype_product')) {
|
||||
var id_product = $(buttonElement).data('id-product');
|
||||
var newQuantity = parseInt($('#service_product_qty_'+id_product).val());
|
||||
var newQuantity = parseInt($('#room_service_product_qty_'+id_product).val());
|
||||
var oldQuantity = parseInt($('#service_product_'+id_product).val());
|
||||
if (newQuantity != oldQuantity) {
|
||||
$('#service_product_'+id_product).val(newQuantity);
|
||||
@@ -1285,6 +1325,11 @@ function initMap() {
|
||||
var BookingForm = {
|
||||
currentRequest: null,
|
||||
init: function() {
|
||||
$('form#booking-form input[type="radio"]').uniform();
|
||||
$('select.input-hotel').chosen({
|
||||
disable_search: true,
|
||||
width: '100%',
|
||||
});
|
||||
this.currentRequest = null;
|
||||
BookingForm.initDatepicker(max_order_date, preparation_time, $('#room_check_in').val(), $('#room_check_out').val());
|
||||
// initialize tootltip for extra service
|
||||
@@ -1338,59 +1383,61 @@ var BookingForm = {
|
||||
$(document).trigger("QloApps:afterBookingFormInit");
|
||||
},
|
||||
initDatepicker: function(max_order_date, preparation_time, dateFrom, dateTo) {
|
||||
let start_date = new Date();
|
||||
if (preparation_time) {
|
||||
start_date.setDate(start_date.getDate() + parseInt(preparation_time));
|
||||
start_date.setHours(0, 0, 0, 0);
|
||||
if (dateFrom && new Date(dateFrom + ' 00:00:00') < start_date) {
|
||||
dateFrom = $.datepicker.formatDate('yy-mm-dd', start_date);
|
||||
if (new Date(dateTo + ' 00:00:00') <= start_date) {
|
||||
dateTo = new Date(start_date);
|
||||
dateTo.setDate(start_date.getDate() + 1);
|
||||
dateTo = $.datepicker.formatDate('yy-mm-dd', dateTo);
|
||||
if ($('#room_date_range').length) {
|
||||
let start_date = new Date();
|
||||
if (preparation_time) {
|
||||
start_date.setDate(start_date.getDate() + parseInt(preparation_time));
|
||||
start_date.setHours(0, 0, 0, 0);
|
||||
if (dateFrom && new Date(dateFrom + ' 00:00:00') < start_date) {
|
||||
dateFrom = $.datepicker.formatDate('yy-mm-dd', start_date);
|
||||
if (new Date(dateTo + ' 00:00:00') <= start_date) {
|
||||
dateTo = new Date(start_date);
|
||||
dateTo.setDate(start_date.getDate() + 1);
|
||||
dateTo = $.datepicker.formatDate('yy-mm-dd', dateTo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (max_order_date) {
|
||||
max_order_date = $.datepicker.parseDate('yy-mm-dd', max_order_date );
|
||||
} else {
|
||||
max_order_date = false;
|
||||
}
|
||||
if (typeof $('#room_date_range').data('dateRangePicker') != 'undefined') {
|
||||
if (max_order_date) {
|
||||
if ($.datepicker.parseDate('yy-mm-dd', $('#room_check_out').val()) < max_order_date) {
|
||||
dateFrom = $('#room_check_in').val();
|
||||
dateTo = $('#room_check_out').val();
|
||||
max_order_date = $.datepicker.parseDate('yy-mm-dd', max_order_date );
|
||||
} else {
|
||||
max_order_date = false;
|
||||
}
|
||||
if (typeof $('#room_date_range').data('dateRangePicker') != 'undefined') {
|
||||
if (max_order_date) {
|
||||
if ($.datepicker.parseDate('yy-mm-dd', $('#room_check_out').val()) < max_order_date) {
|
||||
dateFrom = $('#room_check_in').val();
|
||||
dateTo = $('#room_check_out').val();
|
||||
}
|
||||
}
|
||||
$('#room_date_range').data('dateRangePicker').clear();
|
||||
$('#room_date_range').data('dateRangePicker').destroy();
|
||||
$("#room_date_range").off("datepicker-change");
|
||||
}
|
||||
$('#room_date_range').data('dateRangePicker').clear();
|
||||
$('#room_date_range').data('dateRangePicker').destroy();
|
||||
$("#room_date_range").off("datepicker-change");
|
||||
}
|
||||
|
||||
if (max_order_date) {
|
||||
max_order_date = $.datepicker.formatDate('dd-mm-yy', max_order_date);
|
||||
}
|
||||
$('#room_date_range').dateRangePicker({
|
||||
endDate: max_order_date,
|
||||
startDate: start_date,
|
||||
}).on('datepicker-change', function(event,obj){
|
||||
$('#room_check_in').val($.datepicker.formatDate('yy-mm-dd', obj.date1));
|
||||
$('#room_check_out').val($.datepicker.formatDate('yy-mm-dd', obj.date2));
|
||||
BookingForm.refresh();
|
||||
});
|
||||
|
||||
$('body button').on('click', '', function() {
|
||||
if (!$(this).closest('.date-picker-wrapper').length) {
|
||||
$('#room_date_range').data('dateRangePicker').close();
|
||||
if (max_order_date) {
|
||||
max_order_date = $.datepicker.formatDate('dd-mm-yy', max_order_date);
|
||||
}
|
||||
$('#room_date_range').dateRangePicker({
|
||||
endDate: max_order_date,
|
||||
startDate: start_date,
|
||||
}).on('datepicker-change', function(event,obj){
|
||||
$('#room_check_in').val($.datepicker.formatDate('yy-mm-dd', obj.date1));
|
||||
$('#room_check_out').val($.datepicker.formatDate('yy-mm-dd', obj.date2));
|
||||
BookingForm.refresh();
|
||||
});
|
||||
|
||||
$('body button').on('click', '', function() {
|
||||
if (!$(this).closest('.date-picker-wrapper').length) {
|
||||
$('#room_date_range').data('dateRangePicker').close();
|
||||
}
|
||||
});
|
||||
if (dateFrom && dateTo) {
|
||||
$('#room_date_range').data('dateRangePicker').setDateRange(
|
||||
$.datepicker.formatDate('dd-mm-yy', $.datepicker.parseDate('yy-mm-dd', dateFrom)),
|
||||
$.datepicker.formatDate('dd-mm-yy', $.datepicker.parseDate('yy-mm-dd', dateTo))
|
||||
);
|
||||
}
|
||||
});
|
||||
if (dateFrom && dateTo) {
|
||||
$('#room_date_range').data('dateRangePicker').setDateRange(
|
||||
$.datepicker.formatDate('dd-mm-yy', $.datepicker.parseDate('yy-mm-dd', dateFrom)),
|
||||
$.datepicker.formatDate('dd-mm-yy', $.datepicker.parseDate('yy-mm-dd', dateTo))
|
||||
);
|
||||
}
|
||||
},
|
||||
getFormData: function () {
|
||||
|
||||
@@ -63,117 +63,14 @@
|
||||
<dl class="products">
|
||||
{foreach from=$products key=data_k item='product' name='myLoop'}
|
||||
{* only show products that are booking or global without room *}
|
||||
{if $product.booking_product || ($product.service_product_type == Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE)}
|
||||
{assign var='productId' value=$product.id_product}
|
||||
{assign var='productAttributeId' value=$product.id_product_attribute}
|
||||
<dt data-id="cart_block_product_{$product.id_product|intval}_{if $product.id_product_attribute}{$product.id_product_attribute|intval}{else}0{/if}_{if $product.id_address_delivery}{$product.id_address_delivery|intval}{else}0{/if}" class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}">
|
||||
<a class="cart-images" href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category)|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'cart_default')}" alt="{$product.name|escape:'html':'UTF-8'}" /></a>
|
||||
<div class="cart-info">
|
||||
{block name='blockcart_shopping_cart_product_name'}
|
||||
<div class="product-name">
|
||||
<!-- quantity changed for number of rooms -->
|
||||
<!-- <span class="quantity-formated"><span class="quantity">{$cart_booking_data[$data_k]['total_num_rooms']}</span> x </span> -->
|
||||
<a class="cart_block_product_name" href="{$link->getProductLink($product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}">{$product.name|truncate:30:'...':true|escape:'html':'UTF-8'}</a>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
{if isset($product.attributes_small)}
|
||||
<div class="product-atributes">
|
||||
<a href="{$link->getProductLink($product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'html':'UTF-8'}" title="{l s='Product detail' mod='blockcart'}">{$product.attributes_small}</a>
|
||||
</div>
|
||||
{/if}
|
||||
{block name='blockcart_shopping_cart_product_total_price'}
|
||||
<div class="cart-info-sec rm_product_info_{$product.id_product}">
|
||||
<span class="product_info_label">{l s='Price' mod='blockcart'}:</span>
|
||||
<span class="price product_info_data" ttl_prod_price="{$product.bookingData.total_room_type_amount}">
|
||||
{if !isset($product.is_gift) || !$product.is_gift}
|
||||
{displayWtPrice p="`$product.bookingData.total_room_type_amount`"}
|
||||
<div id="hookDisplayProductPriceBlock-price">
|
||||
{block name='displayProductPriceBlock'}
|
||||
{hook h="displayProductPriceBlock" product=$product type="price" from="blockcart"}
|
||||
{/block}
|
||||
</div>
|
||||
{else}
|
||||
{l s='Free!' mod='blockcart'}
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
{block name='blockcart_shopping_cart_product_quantity'}
|
||||
<div class="cart-info-sec rm_product_info_{$product.id_product}">
|
||||
<span class="product_info_label">{l s='Total Qty.' mod='blockcart'}:</span>
|
||||
<span class="quantity-formated">
|
||||
{if $product.booking_product}
|
||||
<span class="quantity product_info_data">{$product.bookingData['total_num_rooms']}</span>
|
||||
{else}
|
||||
<span class="quantity product_info_data">{$product.cart_quantity}</span>
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
{/block}
|
||||
</div>
|
||||
<span class="remove_link">
|
||||
{if !isset($customizedDatas.$productId.$productAttributeId) && (!isset($product.is_gift) || !$product.is_gift)}
|
||||
<a class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery|intval}&token={$static_token}")|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='remove this product from my cart' mod='blockcart'}"> </a>
|
||||
{/if}
|
||||
</span>
|
||||
<div style="clear:both"></div>
|
||||
{if $product.booking_product}
|
||||
{block name='blockcart_shopping_cart_dates'}
|
||||
<div id="booking_dates_container_{$product.id_product}" class="cart_prod_cont">
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>{l s='Duration' mod='blockcart'}</th>
|
||||
<th>{l s='Qty.' mod='blockcart'}</th>
|
||||
<th>{l s='Price' mod='blockcart'}</th>
|
||||
<th> <!-- {l s='Remove' mod='blockcart'} --></th>
|
||||
</tr>
|
||||
{foreach from=$product.bookingData['date_diff'] key=data_k1 item=data_v}
|
||||
<tr class="rooms_remove_container">
|
||||
{assign var="is_full_date" value=($show_full_date && ($data_v['data_form']|date_format:'%D' == $data_v['data_to']|date_format:'%D'))}
|
||||
<td>
|
||||
{dateFormat date=$data_v['data_form'] full=$is_full_date} - {dateFormat date=$data_v['data_to'] full=$is_full_date}
|
||||
</td>
|
||||
<td class="num_rooms_in_date">{$data_v['num_rm']}</td>
|
||||
<td>{convertPrice price=($data_v['amount'] + $data_v['demand_price'])}</td>
|
||||
<td><a class="remove_rooms_from_cart_link" href="#" rm_price="{$data_v['amount']}" id_product="{$product.id_product|intval}" date_from="{$data_v['data_form']}" date_to="{$data_v['data_to']}" num_rooms="{$data_v['num_rm']}" title="{l s='remove this room from my cart' mod='blockcart'}"></a></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{/if}
|
||||
</dt>
|
||||
{if isset($product.attributes_small)}
|
||||
<dd data-id="cart_block_combination_of_{$product.id_product|intval}{if $product.id_product_attribute}_{$product.id_product_attribute|intval}{/if}_{$product.id_address_delivery|intval}" class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}">
|
||||
{if $product.booking_product || ($product.service_product_type == Product::SERVICE_PRODUCT_STANDALONE)|| ($product.service_product_type == Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL)}
|
||||
{if $product.service_product_type == Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL}
|
||||
{foreach $product.hotel_wise_data as $hotel_wise_data}
|
||||
{include file="./cartrow.tpl" hotel_wise_data=$hotel_wise_data}
|
||||
{/foreach}
|
||||
{else}
|
||||
{include file="./cartrow.tpl" hotel_wise_data=false}
|
||||
{/if}
|
||||
<!-- Customizable datas -->
|
||||
{if isset($customizedDatas.$productId.$productAttributeId[$product.id_address_delivery])}
|
||||
{if !isset($product.attributes_small)}
|
||||
<dd data-id="cart_block_combination_of_{$product.id_product|intval}_{if $product.id_product_attribute}{$product.id_product_attribute|intval}{else}0{/if}_{if $product.id_address_delivery}{$product.id_address_delivery|intval}{else}0{/if}" class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}">
|
||||
{/if}
|
||||
<ul class="cart_block_customizations" data-id="customization_{$productId}_{$productAttributeId}">
|
||||
{foreach from=$customizedDatas.$productId.$productAttributeId[$product.id_address_delivery] key='id_customization' item='customization' name='customizations'}
|
||||
<li name="customization">
|
||||
<div data-id="deleteCustomizableProduct_{$id_customization|intval}_{$product.id_product|intval}_{$product.id_product_attribute|intval}_{$product.id_address_delivery|intval}" class="deleteCustomizableProduct">
|
||||
<a class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_customization={$id_customization|intval}&token={$static_token}")|escape:'html':'UTF-8'}" rel="nofollow"> </a>
|
||||
</div>
|
||||
{if isset($customization.datas.$CUSTOMIZE_TEXTFIELD.0)}
|
||||
{$customization.datas.$CUSTOMIZE_TEXTFIELD.0.value|replace:"<br />":" "|truncate:28:'...'|escape:'html':'UTF-8'}
|
||||
{else}
|
||||
{l s='Customization #%d:' sprintf=$id_customization|intval mod='blockcart'}
|
||||
{/if}
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{if !isset($product.attributes_small)}</dd>{/if}
|
||||
{/if}
|
||||
{if isset($product.attributes_small)}</dd>{/if}
|
||||
{/if}
|
||||
{/foreach}
|
||||
</dl>
|
||||
@@ -300,7 +197,7 @@
|
||||
<i class="icon-check"></i>{l s='Room successfully added to your cart' mod='blockcart'}
|
||||
</h2>
|
||||
<h2 class="layer_cart_product_txt">
|
||||
<i class="icon-check"></i>{l s='Item successfully added to your cart' mod='blockcart'}
|
||||
<i class="icon-check"></i>{l s='Product successfully added to your cart' mod='blockcart'}
|
||||
</h2>
|
||||
{/block}
|
||||
{block name='blockcart_layer_cart_product_image'}
|
||||
@@ -315,6 +212,14 @@
|
||||
<strong class="dark">{l s='Time Duration' mod='blockcart'} - </strong>
|
||||
<span id="layer_cart_product_time_duration"></span>
|
||||
</div>
|
||||
<div>
|
||||
<strong class="dark layer_cart_product_txt">{l s='Hotel Name' mod='blockcart'} - </strong>
|
||||
<span id="layer_cart_product_hotel_name"></span>
|
||||
</div>
|
||||
<div>
|
||||
<strong class="dark layer_cart_product_txt">{l s='Unit Price' mod='blockcart'} - </strong>
|
||||
<span id="layer_cart_product_unit_price"></span>
|
||||
</div>
|
||||
<div>
|
||||
<strong class="dark layer_cart_room_txt">{if isset($occupancy_required_for_booking) && $occupancy_required_for_booking}{l s='Room occupancy' mod='blockcart'}{else}{l s='Rooms quantity added' mod='blockcart'}{/if} - </strong>
|
||||
<strong class="dark layer_cart_product_txt">{l s='Quantity' mod='blockcart'} - </strong>
|
||||
@@ -345,7 +250,7 @@
|
||||
</h2>
|
||||
{/block}
|
||||
|
||||
{block name='blockcart_layer_cart_total_price'}
|
||||
{block name='blockcart_layer_cart_room_total_price'}
|
||||
<div class="layer_cart_row">
|
||||
<strong class="dark">
|
||||
{l s='Total Rooms Cost in cart' mod='blockcart'}
|
||||
@@ -364,6 +269,25 @@
|
||||
</span>
|
||||
</div>
|
||||
{/block}
|
||||
{block name='blockcart_layer_cart_product_total_price'}
|
||||
<div class="layer_cart_row">
|
||||
<strong class="dark">
|
||||
{l s='Total Product Cost in cart' mod='blockcart'}
|
||||
{if $display_tax_label}
|
||||
{if $priceDisplay == 1}
|
||||
{l s='(tax excl.)' mod='blockcart'}
|
||||
{else}
|
||||
{l s='(tax incl.)' mod='blockcart'}
|
||||
{/if}
|
||||
{/if}
|
||||
</strong>
|
||||
<span class="ajax_block_product_total pull-right">
|
||||
{if $cart_qties > 0}
|
||||
{convertPrice price=$cart->getOrderTotal(false, Cart::ONLY_PRODUCTS)}
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
<!-- {if $show_wrapping}
|
||||
<div class="layer_cart_row">
|
||||
@@ -476,6 +400,9 @@
|
||||
{addJsDef generated_date=$smarty.now|intval}
|
||||
{addJsDef ajax_allowed=$ajax_allowed|boolval}
|
||||
{addJsDef hasDeliveryAddress=(isset($cart->id_address_delivery) && $cart->id_address_delivery)}
|
||||
{addJsDef SERVICE_PRODUCT_WITH_ROOMTYPE=Product::SERVICE_PRODUCT_WITH_ROOMTYPE}
|
||||
{addJsDef SERVICE_PRODUCT_STANDALONE=Product::SERVICE_PRODUCT_STANDALONE}
|
||||
{addJsDef SERVICE_PRODUCT_lINKED_WITH_HOTEL=Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL}
|
||||
|
||||
{addJsDefL name=customizationIdMessage}{l s='Customization #' mod='blockcart' js=1}{/addJsDefL}
|
||||
{addJsDefL name=removingLinkText}{l s='remove this product from my cart' mod='blockcart' js=1}{/addJsDefL}
|
||||
@@ -498,6 +425,7 @@
|
||||
{addJsDefL name=children_txt}{l s='Children' mod='blockcart' js=1}{/addJsDefL}
|
||||
{addJsDefL name=price_txt}{l s='Price' mod='blockcart' js=1}{/addJsDefL}
|
||||
{addJsDefL name=total_qty_txt}{l s='Total Qty.' mod='blockcart' js=1}{/addJsDefL}
|
||||
{addJsDefL name=variant_txt}{l s='Variant' mod='blockcart' js=1}{/addJsDefL}
|
||||
{addJsDefL name=qty_txt}{l s='Qty' mod='blockcart' js=1}{/addJsDefL}
|
||||
{addJsDefL name=duration_txt}{l s='Duration' mod='blockcart' js=1}{/addJsDefL}
|
||||
{addJsDefL name=capacity_txt}{l s='Capacity' mod='blockcart' js=1}{/addJsDefL}
|
||||
|
||||
154
themes/hotel-reservation-theme/modules/blockcart/cartrow.tpl
Normal file
154
themes/hotel-reservation-theme/modules/blockcart/cartrow.tpl
Normal file
@@ -0,0 +1,154 @@
|
||||
{assign var='productId' value=$product.id_product}
|
||||
{assign var='productAttributeId' value=$product.id_product_attribute}
|
||||
<dt data-id="cart_block_product_{$product.id_product|intval}_{if $product.id_product_attribute}{$product.id_product_attribute|intval}{else}0{/if}_{if $product.id_address_delivery}{$product.id_address_delivery|intval}{else}0{/if}_{if isset($hotel_wise_data.id_hotel) && $hotel_wise_data.id_hotel}{$hotel_wise_data.id_hotel}{else}0{/if}" class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}">
|
||||
<a class="cart-images" href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category)|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'cart_default')}" alt="{$product.name|escape:'html':'UTF-8'}" /></a>
|
||||
<div class="cart-info">
|
||||
{block name='blockcart_shopping_cart_product_name'}
|
||||
<div class="product-name">
|
||||
{* <!-- quantity changed for number of rooms -->
|
||||
<!-- <span class="quantity-formated"><span class="quantity">{$cart_booking_data[$data_k]['total_num_rooms']}</span> x </span> --> *}
|
||||
<a class="cart_block_product_name" href="{$link->getProductLink($product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}">{$product.name|truncate:30:'...':true|escape:'html':'UTF-8'}</a>
|
||||
</div>
|
||||
{/block}
|
||||
{block name='blockcart_shopping_cart_hotel_name'}
|
||||
{if $product.service_product_type == Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL}
|
||||
<div class="hotel-name">
|
||||
{$hotel_wise_data.hotel_name|escape:'html':'UTF-8'}
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
{if isset($product.attributes_small)}
|
||||
<div class="product-atributes">
|
||||
<a href="{$link->getProductLink($product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'html':'UTF-8'}" title="{l s='Product detail' mod='blockcart'}">{$product.attributes_small}</a>
|
||||
</div>
|
||||
{/if}
|
||||
{block name='blockcart_shopping_cart_product_total_price'}
|
||||
<div class="cart-info-sec rm_product_info_{$product.id_product}">
|
||||
<span class="product_info_label">{l s='Price' mod='blockcart'}:</span>
|
||||
<span class="price product_info_data">
|
||||
{if !isset($product.is_gift) || !$product.is_gift}
|
||||
{if $product.booking_product}
|
||||
{displayWtPrice p="`$product.bookingData.total_room_type_amount`"}
|
||||
{else if $product.service_product_type == Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL}
|
||||
{if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice p="`$hotel_wise_data.total_price_tax_excl`"}{else}{displayWtPrice p="`$hotel_wise_data.total_price_tax_incl`"}{/if}
|
||||
{else}
|
||||
{if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice p="`$product.total_price_tax_excl`"}{else}{displayWtPrice p="`$product.total_price_tax_incl`"}{/if}
|
||||
{/if}
|
||||
<div id="hookDisplayProductPriceBlock-price">
|
||||
{block name='displayProductPriceBlock'}
|
||||
{hook h="displayProductPriceBlock" product=$product type="price" from="blockcart"}
|
||||
{/block}
|
||||
</div>
|
||||
{else}
|
||||
{l s='Free!' mod='blockcart'}
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
{block name='blockcart_shopping_cart_product_quantity'}
|
||||
<div class="cart-info-sec rm_product_info_{$product.id_product}">
|
||||
<span class="product_info_label">{l s='Total Qty.' mod='blockcart'}:</span>
|
||||
<span class="quantity-formated">
|
||||
{if $product.booking_product}
|
||||
<span class="quantity product_info_data">{$product.bookingData['total_num_rooms']}</span>
|
||||
{else}
|
||||
{if $product.service_product_type == Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL}
|
||||
<span class="quantity product_info_data">{$hotel_wise_data.total_qty}</span>
|
||||
{elseif $product.service_product_type == Product::SERVICE_PRODUCT_STANDALONE}
|
||||
<span class="quantity product_info_data">{$product.cart_quantity}</span>
|
||||
{/if}
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
{/block}
|
||||
</div>
|
||||
<span class="remove_link">
|
||||
{if !isset($customizedDatas.$productId.$productAttributeId) && (!isset($product.is_gift) || !$product.is_gift)}
|
||||
<a class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery|intval}&token={$static_token}")|escape:'html':'UTF-8'}{if isset($hotel_wise_data) && $hotel_wise_data.id_hotel}&id_hotel={$hotel_wise_data.id_hotel|escape:'html':'UTF-8'}{/if}" rel="nofollow" title="{l s='remove this product from my cart' mod='blockcart'}"> </a>
|
||||
{/if}
|
||||
</span>
|
||||
<div style="clear:both"></div>
|
||||
{if $product.booking_product}
|
||||
{block name='blockcart_shopping_cart_dates'}
|
||||
<div id="booking_dates_container_{$product.id_product}" class="cart_prod_cont">
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>{l s='Duration' mod='blockcart'}</th>
|
||||
<th>{l s='Qty.' mod='blockcart'}</th>
|
||||
<th>{l s='Price' mod='blockcart'}</th>
|
||||
<th> <!-- {l s='Remove' mod='blockcart'} --></th>
|
||||
</tr>
|
||||
{foreach from=$product.bookingData['date_diff'] key=data_k1 item=data_v}
|
||||
<tr class="rooms_remove_container">
|
||||
{assign var="is_full_date" value=($show_full_date && ($data_v['data_form']|date_format:'%D' == $data_v['data_to']|date_format:'%D'))}
|
||||
<td>
|
||||
{dateFormat date=$data_v['data_form'] full=$is_full_date} - {dateFormat date=$data_v['data_to'] full=$is_full_date}
|
||||
</td>
|
||||
<td class="num_rooms_in_date">{$data_v['num_rm']}</td>
|
||||
<td>{convertPrice price=($data_v['amount'] + $data_v['demand_price'])}</td>
|
||||
<td><a class="remove_rooms_from_cart_link" href="#" rm_price="{$data_v['amount']}" id_product="{$product.id_product|intval}" date_from="{$data_v['data_form']}" date_to="{$data_v['data_to']}" num_rooms="{$data_v['num_rm']}" title="{l s='remove this room from my cart' mod='blockcart'}"></a></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{else if $product.hasOptions}
|
||||
{block name='blockcart_shopping_cart_options'}
|
||||
{if $product.service_product_type == Product::SERVICE_PRODUCT_lINKED_WITH_HOTEL}
|
||||
{assign var='options' value=$hotel_wise_data.options}
|
||||
{else if $product.service_product_type == Product::SERVICE_PRODUCT_STANDALONE}
|
||||
{assign var='options' value=$product.options}
|
||||
{/if}
|
||||
<div class="table-responsive cart_prod_cont">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>{l s='Variant' mod='blockcart'}</th>
|
||||
<th>{l s='Qty.' mod='blockcart'}</th>
|
||||
<th>{l s='Price' mod='blockcart'}</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
{foreach from=$options item=data_v}
|
||||
<tr class="product_option_row">
|
||||
<td>{$data_v.option_name}</td>
|
||||
<td>{$data_v['quantity']}</td>
|
||||
<td>{convertPrice price=($data_v['total_price_tax_excl'])}</td>
|
||||
<td class="text-right"><a class="ajax_remove_product_option" href="#" id_product="{$product.id_product|intval}" id_hotel="{$data_v.id_hotel|intval}" id_service_product_option="{$data_v.id_service_product_option|intval}" title="{l s='remove this product from my cart' mod='blockcart'}"> </a></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{/block}
|
||||
{/if}
|
||||
</dt>
|
||||
{if isset($product.attributes_small)}
|
||||
<dd data-id="cart_block_combination_of_{$product.id_product|intval}{if $product.id_product_attribute}_{$product.id_product_attribute|intval}{/if}_{$product.id_address_delivery|intval}" class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}">
|
||||
{/if}
|
||||
<!-- Customizable datas -->
|
||||
{if isset($customizedDatas.$productId.$productAttributeId[$product.id_address_delivery])}
|
||||
{if !isset($product.attributes_small)}
|
||||
<dd data-id="cart_block_combination_of_{$product.id_product|intval}_{if $product.id_product_attribute}{$product.id_product_attribute|intval}{else}0{/if}_{if $product.id_address_delivery}{$product.id_address_delivery|intval}{else}0{/if}" class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}">
|
||||
{/if}
|
||||
<ul class="cart_block_customizations" data-id="customization_{$productId}_{$productAttributeId}">
|
||||
{foreach from=$customizedDatas.$productId.$productAttributeId[$product.id_address_delivery] key='id_customization' item='customization' name='customizations'}
|
||||
<li name="customization">
|
||||
<div data-id="deleteCustomizableProduct_{$id_customization|intval}_{$product.id_product|intval}_{$product.id_product_attribute|intval}_{$product.id_address_delivery|intval}" class="deleteCustomizableProduct">
|
||||
<a class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_customization={$id_customization|intval}&token={$static_token}")|escape:'html':'UTF-8'}" rel="nofollow"> </a>
|
||||
</div>
|
||||
{if isset($customization.datas.$CUSTOMIZE_TEXTFIELD.0)}
|
||||
{$customization.datas.$CUSTOMIZE_TEXTFIELD.0.value|replace:"<br />":" "|truncate:28:'...'|escape:'html':'UTF-8'}
|
||||
{else}
|
||||
{l s='Customization #%d:' sprintf=$id_customization|intval mod='blockcart'}
|
||||
{/if}
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{if !isset($product.attributes_small)}</dd>{/if}
|
||||
{/if}
|
||||
{if isset($product.attributes_small)}</dd>{/if}
|
||||
@@ -42,7 +42,7 @@
|
||||
<li><a href="{$link->getPageLink('address', true)|escape:'html':'UTF-8'}" title="{l s='Address'}"><i class="icon-building"></i><span>{l s='Address'}</span></a></li>
|
||||
<li><a href="{$link->getPageLink('history', true)|escape:'html':'UTF-8'}" title="{l s='Bookings'}"><i class="icon-list-ol"></i><span>{l s='Bookings'}</span></a></li>
|
||||
{if $refundAllowed}
|
||||
<li><a href="{$link->getPageLink('order-follow', true)|escape:'html':'UTF-8'}" title="{l s='Booking refund requests'}"><i class="icon-refresh"></i><span>{l s='Booking refund requests'}</span></a></li>
|
||||
<li><a href="{$link->getPageLink('order-follow', true)|escape:'html':'UTF-8'}" title="{l s='Refund requests'}"><i class="icon-refresh"></i><span>{l s='Refund requests'}</span></a></li>
|
||||
{/if}
|
||||
<li><a href="{$link->getPageLink('order-slip', true)|escape:'html':'UTF-8'}" title="{l s='Credit slips'}"><i class="icon-file-o"></i><span>{l s='Credit slips'}</span></a></li>
|
||||
<li><a href="{$link->getPageLink('identity', true)|escape:'html':'UTF-8'}" title="{l s='Personal information'}"><i class="icon-user"></i><span>{l s='Personal information'}</span></a></li>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
{block name='order_confirmation'}
|
||||
{capture name=path}{l s='Order confirmation'}{/capture}
|
||||
{block name='order_confirmation_heading'}
|
||||
<h1 class="page-heading">{l s='Order confirmation'}</h1>
|
||||
<h1 class="page-heading">{l s='Booking confirmation'} : <span class="bold">{$order->reference}</span></h1>
|
||||
{/block}
|
||||
|
||||
{assign var='current_step' value='payment'}
|
||||
@@ -41,13 +41,17 @@
|
||||
{block name='displayOrderConfirmation'}
|
||||
{$HOOK_ORDER_CONFIRMATION}
|
||||
{/block}
|
||||
<div class="box">
|
||||
{block name='displayPaymentReturn'}
|
||||
{$HOOK_PAYMENT_RETURN}
|
||||
{/block}
|
||||
|
||||
<div class="order-confirmation-column">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{block name='displayPaymentReturn'}
|
||||
{$HOOK_PAYMENT_RETURN}
|
||||
{/block}
|
||||
</div>
|
||||
</div>
|
||||
{if isset($order->id) && $order->id}
|
||||
{if $is_guest}
|
||||
<p>{l s='Your Order Reference is:'} <span class="bold">{$order->reference}</span></p>
|
||||
<p class="cart_navigation exclusive">
|
||||
<a class="button-exclusive btn btn-default" href="{$link->getPageLink('guest-tracking', true, NULL, "id_order={$reference_order|urlencode}&email={$email|urlencode}")|escape:'html':'UTF-8'}" title="{l s='Follow my order'}"><i class="icon-chevron-left"></i>{l s='Follow my order'}</a>
|
||||
</p>
|
||||
@@ -55,8 +59,6 @@
|
||||
{if isset($is_free_order) && $is_free_order}
|
||||
<p class="alert alert-success">{l s='Your'} {if $total_rooms_booked > 1}{l s='bookings have'}{else}{l s='booking has'}{/if} {l s='been created successfully!'}</p><br />
|
||||
{/if}
|
||||
<p><strong>{l s='Order Status :'}</strong> <span>{l s='Confirmed'}</span></p>
|
||||
<p><strong>{l s='Order Reference :'}</strong> <span class="bold">{$order->reference}</span></p>
|
||||
{if $any_back_order}
|
||||
{if $shw_bo_msg}
|
||||
<br>
|
||||
@@ -66,357 +68,465 @@
|
||||
</p>
|
||||
{/if}
|
||||
{/if}
|
||||
<hr>
|
||||
{block name='order_detail_heading'}
|
||||
<p><strong>{l s='Order Details -'}</strong></p>
|
||||
{/block}
|
||||
{block name='order_details'}
|
||||
<div id="order-detail-content" class="">
|
||||
<table class="table table-bordered">
|
||||
{if isset($cart_htl_data)}
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="cart_product">{l s='Room Image'}</th>
|
||||
<th class="cart_description">{l s='Room Description'}</th>
|
||||
<th>{l s='Hotel Name'}</th>
|
||||
<th>{l s='Rooms'}</th>
|
||||
<th>{l s='Check-in Date'}</th>
|
||||
<th>{l s='Check-out Date'}</th>
|
||||
<th>{l s='Extra Services'}</th>
|
||||
<th class="cart_total">{l s='Total'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$cart_htl_data key=data_k item=data_v}
|
||||
{foreach from=$data_v['date_diff'] key=rm_k item=rm_v}
|
||||
<tr class="table_body">
|
||||
{block name='order_detail_room_type_image'}
|
||||
<td class="cart_product">
|
||||
<a href="{$link->getProductLink($data_v['id_product'])}">
|
||||
<img src="{$data_v['cover_img']}" class="img-responsive"/>
|
||||
</a>
|
||||
</td>
|
||||
{/block}
|
||||
{block name='order_detail_room_type_name'}
|
||||
<td class="cart_description">
|
||||
<p class="product-name">
|
||||
<a href="{$link->getProductLink($data_v['id_product'])}">
|
||||
{$data_v['name']}
|
||||
</a>
|
||||
</p>
|
||||
</td>
|
||||
{/block}
|
||||
{block name='order_detail_room_type_hotel_name'}
|
||||
<td>
|
||||
{$data_v['hotel_name']}
|
||||
{block name='displayOrderConfirmationHotelNameAfter'}
|
||||
{hook h="displayOrderConfirmationHotelNameAfter" id_product=$data_v['id_product']}
|
||||
{/block}
|
||||
</td>
|
||||
{/block}
|
||||
{block name='order_detail_room_type_guest'}
|
||||
<td class="text-center">
|
||||
<p>
|
||||
{if $rm_v['adults'] <= 9}0{$rm_v['adults']}{else}{$rm_v['adults']}{/if} {if $rm_v['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $rm_v['children']}, {if $rm_v['children'] <= 9}0{$rm_v['children']}{else} {$rm_v['children']}{/if} {if $rm_v['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}<br>{if $rm_v['num_rm'] <= 9}0{/if}{$rm_v['num_rm']} {if $rm_v['num_rm'] > 1}{l s='Rooms'}{else}{l s='Room'}{/if}
|
||||
</p>
|
||||
</td>
|
||||
{/block}
|
||||
{assign var="is_full_date" value=($show_full_date && ($rm_v['data_form']|date_format:'%D' == $rm_v['data_to']|date_format:'%D'))}
|
||||
{block name='order_detail_room_type_check_in'}
|
||||
<td class="text-center">
|
||||
<p>
|
||||
{dateFormat date=$rm_v['data_form'] full=$is_full_date}
|
||||
</p>
|
||||
</td>
|
||||
{/block}
|
||||
{block name='order_detail_room_type_check_out'}
|
||||
<td class="text-center">
|
||||
<p>
|
||||
{dateFormat date=$rm_v['data_to'] full=$is_full_date}
|
||||
</p>
|
||||
</td>
|
||||
{/block}
|
||||
{block name='order_detail_room_type_extra_demands'}
|
||||
<td>
|
||||
<p class="text-center">
|
||||
{if (isset($rm_v['extra_demands']) && $rm_v['extra_demands']) || isset($rm_v['additional_services']) && $rm_v['additional_services']}
|
||||
<a data-date_from="{$rm_v['data_form']}" data-date_to="{$rm_v['data_to']}" data-id_product="{$data_v['id_product']}" data-id_order="{$data_v['id_order']}" data-action="{$link->getPageLink('order-detail')}" class="open_rooms_extra_services_panel" href="#rooms_type_extra_services_form">
|
||||
{/if}
|
||||
{if $group_use_tax}
|
||||
{displayWtPriceWithCurrency price=($rm_v['extra_demands_price_ti'] + $rm_v['additional_services_price_ti']) currency=$objOrderCurrency}
|
||||
{else}
|
||||
{displayWtPriceWithCurrency price=($rm_v['extra_demands_price_te'] + $rm_v['additional_services_price_te']) currency=$objOrderCurrency}
|
||||
{/if}
|
||||
{if (isset($rm_v['extra_demands']) && $rm_v['extra_demands']) || isset($rm_v['additional_services']) && $rm_v['additional_services']}
|
||||
<div class="row">
|
||||
<div class="col-md-8 order-product-summary">
|
||||
{if isset($cart_htl_data)}
|
||||
<div class="card">
|
||||
<div class="card-header">{l s='Room Details'}</div>
|
||||
<div class="card-body">
|
||||
{foreach from=$cart_htl_data key=data_k item=data_v}
|
||||
{foreach from=$data_v['date_diff'] key=rm_k item=rm_v}
|
||||
<div class="product-detail" data-id-product="{$data_v.id_product}" data-date-diff="{$rm_k}">
|
||||
<div class="row">
|
||||
<div class="col-xs-3 col-sm-2">
|
||||
<a href="{$link->getProductLink($data_v['id_product'])}">
|
||||
<img src="{$data_v['cover_img']}" class="img-responsive"/>
|
||||
</a>
|
||||
{/if}
|
||||
</p>
|
||||
</td>
|
||||
{/block}
|
||||
{block name='order_confirmation_cart_total'}
|
||||
<td class="cart_total text-left">
|
||||
<p class="text-left">
|
||||
{if $group_use_tax}
|
||||
{displayWtPriceWithCurrency price=($rm_v['amount_tax_incl'] + $rm_v['extra_demands_price_ti'] + $rm_v['additional_services_price_ti'] + $rm_v['additional_services_price_auto_add_ti']) currency=$objOrderCurrency}
|
||||
{else}
|
||||
{displayWtPriceWithCurrency price=($rm_v['amount_tax_excl'] + $rm_v['extra_demands_price_te'] + $rm_v['additional_services_price_te'] + $rm_v['additional_services_price_auto_add_te']) currency=$objOrderCurrency}
|
||||
{/if}
|
||||
{if (isset($rm_v['extra_demands']) && $rm_v['extra_demands']) || isset($rm_v['additional_services']) && $rm_v['additional_services']}
|
||||
<span class="order-price-info">
|
||||
<img src="{$img_dir}icon/icon-info.svg" />
|
||||
</span>
|
||||
<div class="price-info-container" style="display:none">
|
||||
<div class="price-info-tooltip-cont">
|
||||
<div class="list-row">
|
||||
<div>
|
||||
<p>{l s='Room cost'} : </p>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<p>
|
||||
{if $group_use_tax}
|
||||
{displayWtPriceWithCurrency price=($rm_v['amount_tax_incl'] + $rm_v['additional_services_price_auto_add_ti']) currency=$objOrderCurrency}
|
||||
{else}
|
||||
{displayWtPriceWithCurrency price=($rm_v['amount_tax_excl'] + $rm_v['additional_services_price_auto_add_te']) currency=$objOrderCurrency}
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-9 col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<p class="product-name">
|
||||
<a href="{$link->getProductLink($data_v['id_product'])}">
|
||||
{$data_v['name']}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
{assign var="is_full_date" value=($show_full_date && ($rm_v['data_form']|date_format:'%D' == $rm_v['data_to']|date_format:'%D'))}
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Check-in'}</dt>
|
||||
<dd class="col-xs-7">{dateFormat date=$rm_v.data_form full=$is_full_date}</dd>
|
||||
</div>
|
||||
<div class="list-row">
|
||||
<div>
|
||||
<p>{l s='Service cost'} : </p>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<p>
|
||||
{if $group_use_tax}
|
||||
{displayWtPriceWithCurrency price=($rm_v['extra_demands_price_ti'] + $rm_v['additional_services_price_ti']) currency=$objOrderCurrency}
|
||||
{else}
|
||||
{displayWtPriceWithCurrency price=($rm_v['extra_demands_price_te'] + $rm_v['additional_services_price_te']) currency=$objOrderCurrency}
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Check-out'}</dt>
|
||||
<dd class="col-xs-7">{dateFormat date=$rm_v.data_to full=$is_full_date}</dd>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Rooms'}</dt>
|
||||
<dd class="col-xs-7">{$rm_v.num_rm|string_format:'%02d'}</dd>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Guests'}</dt>
|
||||
<dd class="col-xs-7">
|
||||
{$rm_v.adults|string_format:'%02d'} {if $rm_v.adults > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $rm_v.children}, {$rm_v.children|string_format:'%02d'} {if $rm_v.children > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
|
||||
</dd>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Extra Services'}</dt>
|
||||
<dd class="col-xs-7">
|
||||
{if (isset($rm_v['extra_demands']) && $rm_v['extra_demands']) || isset($rm_v['additional_services']) && $rm_v['additional_services']}
|
||||
<a data-date_from="{$rm_v['data_form']}" data-date_to="{$rm_v['data_to']}" data-id_product="{$data_v['id_product']}" data-id_order="{$data_v['id_order']}" data-action="{$link->getPageLink('order-detail')}" class="open_rooms_extra_services_panel" href="#rooms_type_extra_services_form">
|
||||
{/if}
|
||||
{if $group_use_tax}
|
||||
{displayWtPriceWithCurrency price=($rm_v['extra_demands_price_ti'] + $rm_v['additional_services_price_ti']) currency=$objOrderCurrency}
|
||||
{else}
|
||||
{displayWtPriceWithCurrency price=($rm_v['extra_demands_price_te'] + $rm_v['additional_services_price_te']) currency=$objOrderCurrency}
|
||||
{/if}
|
||||
{if (isset($rm_v['extra_demands']) && $rm_v['extra_demands']) || isset($rm_v['additional_services']) && $rm_v['additional_services']}
|
||||
</a>
|
||||
{/if}
|
||||
</dd>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Total Price'}</dt>
|
||||
<dd class="col-xs-7">
|
||||
{if $group_use_tax}
|
||||
{displayWtPriceWithCurrency price=($rm_v['amount_tax_incl'] + $rm_v['extra_demands_price_ti'] + $rm_v['additional_services_price_ti'] + $rm_v['additional_services_price_auto_add_ti']) currency=$objOrderCurrency}
|
||||
{else}
|
||||
{displayWtPriceWithCurrency price=($rm_v['amount_tax_excl'] + $rm_v['extra_demands_price_te'] + $rm_v['additional_services_price_te'] + $rm_v['additional_services_price_auto_add_te']) currency=$objOrderCurrency}
|
||||
{/if}
|
||||
{if (isset($rm_v['extra_demands']) && $rm_v['extra_demands']) || isset($rm_v['additional_services']) && $rm_v['additional_services']}
|
||||
<span class="order-price-info">
|
||||
<img src="{$img_dir}icon/icon-info.svg" />
|
||||
</span>
|
||||
<div class="price-info-container" style="display:none">
|
||||
<div class="price-info-tooltip-cont">
|
||||
<div class="list-row">
|
||||
<div>
|
||||
<p>{l s='Room cost'} : </p>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<p>
|
||||
{if $group_use_tax}
|
||||
{displayWtPriceWithCurrency price=($rm_v['amount_tax_incl'] + $rm_v['additional_services_price_auto_add_ti']) currency=$objOrderCurrency}
|
||||
{else}
|
||||
{displayWtPriceWithCurrency price=($rm_v['amount_tax_excl'] + $rm_v['additional_services_price_auto_add_te']) currency=$objOrderCurrency}
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-row">
|
||||
<div>
|
||||
<p>{l s='Service cost'} : </p>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<p>
|
||||
{if $group_use_tax}
|
||||
{displayWtPriceWithCurrency price=($rm_v['extra_demands_price_ti'] + $rm_v['additional_services_price_ti']) currency=$objOrderCurrency}
|
||||
{else}
|
||||
{displayWtPriceWithCurrency price=($rm_v['extra_demands_price_te'] + $rm_v['additional_services_price_te']) currency=$objOrderCurrency}
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</dd>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($cart_standalone_service_products) || isset($cart_hotel_service_products)}
|
||||
<div class="card">
|
||||
<div class="card-header">{l s='Product Details'}</div>
|
||||
<div class="card-body">
|
||||
{if isset($cart_hotel_service_products)}
|
||||
{foreach from=$cart_hotel_service_products key=data_k item=product}
|
||||
<div class="product-detail" data-id-product="{$product.id_product}">
|
||||
<div class="row">
|
||||
{block name='order_hotel_product_image'}
|
||||
<div class="col-xs-3 col-sm-2">
|
||||
<a href="{$link->getProductLink($product.id_product)|escape:'html':'UTF-8'}" title="{$product.product_name|escape:'html':'UTF-8'}" target="_blank">
|
||||
<img class="img img-responsive img-room-type" src="{$product.cover_img|escape:'html':'UTF-8'}" />
|
||||
</a>
|
||||
</div>
|
||||
{/block}
|
||||
{block name='order_hotel_product_detail'}
|
||||
<div class="col-xs-9 col-sm-10 info-wrap">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<p class="product-name">
|
||||
<a href="{$link->getProductLink($product.id_product)|escape:'html':'UTF-8'}" title="{$product.product_name|escape:'html':'UTF-8'}" target="_blank" class="product-name">
|
||||
{$product.product_name|escape:'html':'UTF-8'}{if isset($product.option_name) && $product.option_name} : {$product.option_name|escape:'html':'UTF-8'}{/if}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<div class="description-list">
|
||||
<dl class="">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Quantity'}</dt>
|
||||
<dd class="col-xs-7">{$product.product_quantity}</dd>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Unit Price'}</dt>
|
||||
<dd class="col-xs-7">
|
||||
{if $group_use_tax}
|
||||
{displayWtPriceWithCurrency price=$product.unit_price_tax_incl currency=$currency}
|
||||
{else}
|
||||
{displayWtPriceWithCurrency price=$product.unit_price_tax_excl currency=$currency}
|
||||
{/if}
|
||||
</dd>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Total Pricing'}</dt>
|
||||
<dd class="col-xs-7">
|
||||
{if $group_use_tax}
|
||||
{displayWtPriceWithCurrency price=$product.total_price_tax_incl currency=$currency}
|
||||
{else}
|
||||
{displayWtPriceWithCurrency price=$product.total_price_tax_excl currency=$currency}
|
||||
{/if}
|
||||
</dd>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
{if isset($cart_standalone_service_products)}
|
||||
{foreach from=$cart_standalone_service_products key=data_k item=product}
|
||||
<div class="product-detail" data-id-product="{$product.id_product}">
|
||||
<div class="row">
|
||||
{block name='order_hotel_product_image'}
|
||||
<div class="col-xs-3 col-sm-2">
|
||||
<a href="{$link->getProductLink($product.id_product)|escape:'html':'UTF-8'}" title="{$product.product_name|escape:'html':'UTF-8'}" target="_blank">
|
||||
<img class="img img-responsive img-room-type" src="{$product.cover_img|escape:'html':'UTF-8'}" />
|
||||
</a>
|
||||
</div>
|
||||
{/block}
|
||||
{block name='order_hotel_product_detail'}
|
||||
<div class="col-xs-9 col-sm-10 info-wrap">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<p class="product-name">
|
||||
<a href="{$link->getProductLink($product.id_product)|escape:'html':'UTF-8'}" title="{$product.product_name|escape:'html':'UTF-8'}" target="_blank" class="product-name">
|
||||
{$product.product_name|escape:'html':'UTF-8'}{if isset($product.option_name) && $product.option_name} : {$product.option_name|escape:'html':'UTF-8'}{/if}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<div class="description-list">
|
||||
<dl class="">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Quantity'}</dt>
|
||||
<dd class="col-xs-7">{$product.product_quantity}</dd>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Unit Price'}</dt>
|
||||
<dd class="col-xs-7">
|
||||
{if $group_use_tax}
|
||||
{displayWtPriceWithCurrency price=$product.unit_price_tax_incl currency=$currency}
|
||||
{else}
|
||||
{displayWtPriceWithCurrency price=$product.unit_price_tax_excl currency=$currency}
|
||||
{/if}
|
||||
</dd>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Total Pricing'}</dt>
|
||||
<dd class="col-xs-7">
|
||||
{if $group_use_tax}
|
||||
{displayWtPriceWithCurrency price=$product.total_price_tax_incl currency=$currency}
|
||||
{else}
|
||||
{displayWtPriceWithCurrency price=$product.total_price_tax_excl currency=$currency}
|
||||
{/if}
|
||||
</dd>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
{block name='order_detail_payment_details'}
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
{l s='Payment Details'}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<label class="col-xs-6 title">{l s='Payment Method'}</label>
|
||||
<div class="col-xs-6 text-right value payment-method">
|
||||
{* {if $invoice && $invoiceAllowed}
|
||||
<span class="icon-pdf"></span>
|
||||
<a target="_blank" href="{$link->getPageLink('pdf-invoice', true)}?id_order={$order->id|intval}{if $is_guest}&secure_key={$order->secure_key|escape:'html':'UTF-8'}{/if}" title="{l s='Click here to download invoice.'}">
|
||||
<span>{$order->payment|escape:'html':'UTF-8'}</span>
|
||||
</a>
|
||||
{else} *}
|
||||
{$order->payment|escape:'html':'UTF-8'}
|
||||
{* {/if} *}
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<label class="col-xs-6 title">{l s='Status'}</label>
|
||||
<div class="col-xs-6 text-right value status">
|
||||
{if isset($order_history[0]) && $order_history[0]}
|
||||
<span{if isset($order_history[0].color) && $order_history[0].color} style="background-color:{$order_history[0].color|escape:'html':'UTF-8'}30; border: 1px solid {$order_history[0].color|escape:'html':'UTF-8'};" {/if} class="label">
|
||||
{if $order_history[0].id_order_state|in_array:$overbooking_order_states}
|
||||
{l s='Order Not Confirmed'}
|
||||
{else}
|
||||
{$order_history[0].ostate_name|escape:'html':'UTF-8'}
|
||||
{/if}
|
||||
</p>
|
||||
</td>
|
||||
{/block}
|
||||
{if isset($orders_has_invoice) && $orders_has_invoice && $order->payment != 'Free order'}
|
||||
{/if}
|
||||
{* <td class="text-center">
|
||||
{if isset($rm_v['is_backorder']) && $rm_v['is_backorder']}
|
||||
{l s='On Backorder'}
|
||||
</span>
|
||||
{else}
|
||||
--
|
||||
<span class="processing">{l s='Processing'}</span>
|
||||
{/if}
|
||||
</td> *}
|
||||
</tr>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
</tbody>
|
||||
{/if}
|
||||
{if isset($cart_service_products)}
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="1">{l s='Image'}</th>
|
||||
<th colspan="2">{l s='Name'}</th>
|
||||
<th colspan="2">{l s='Unit Price'}</th>
|
||||
<th colspan="1">{l s='Quantity'}</th>
|
||||
<th colspan="2" class="cart_total">{l s='Total'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$cart_service_products key=data_k item=data_v}
|
||||
<tr class="table_body">
|
||||
<td class="cart_product">
|
||||
<a href="{$link->getProductLink($data_v['id_product'])}">
|
||||
<img src="{$data_v['cover_img']}" class="img-responsive"/>
|
||||
</a>
|
||||
</td>
|
||||
<td class="cart_product" colspan="2">
|
||||
<p class="product-name">
|
||||
<a href="{$link->getProductLink($data_v['id_product'])}">
|
||||
{$data_v['product_name']}
|
||||
</a>
|
||||
</p>
|
||||
</td>
|
||||
<td class="cart_unit" colspan="2">
|
||||
<p class="text-center">
|
||||
{if $group_use_tax}
|
||||
{displayWtPriceWithCurrency price=$data_v['unit_price_tax_incl'] currency=$objOrderCurrency}
|
||||
{* {displayPrice price=$data_v['unit_price_tax_incl']|floatval|round:2} *}
|
||||
{else}
|
||||
{* {displayPrice price=$data_v['unit_price_tax_excl']|floatval|round:2} *}
|
||||
{displayWtPriceWithCurrency price=$data_v['unit_price_tax_excl'] currency=$objOrderCurrency}
|
||||
{/if}
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p class="text-center">
|
||||
{$data_v['product_quantity']}
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p class="text-left" colspan="2">
|
||||
{if $group_use_tax}
|
||||
{displayWtPriceWithCurrency price=$data_v['total_price_tax_incl'] currency=$objOrderCurrency}
|
||||
{else}
|
||||
{displayWtPriceWithCurrency price=$data_v['total_price_tax_excl'] currency=$objOrderCurrency}
|
||||
{/if}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
{/if}
|
||||
<tfoot>
|
||||
{block name='order_detail_total_information'}
|
||||
{if isset($cart_htl_data)}
|
||||
{if $priceDisplay && $use_tax}
|
||||
<tr class="item">
|
||||
<td colspan="3"></td>
|
||||
<td colspan="3">
|
||||
<strong>{l s='Total Rooms Cost (tax excl.)'}</strong>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_rooms_te'] + $orderTotalInfo['total_services_te'] + $orderTotalInfo['total_auto_add_services_te'] + $orderTotalInfo['total_demands_price_te']) currency=$objOrderCurrency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{else}
|
||||
<tr class="item">
|
||||
<td colspan="3"></td>
|
||||
<td colspan="3">
|
||||
<strong>{l s='Total Rooms Cost'} {if $use_tax}{l s='(tax incl.)'}{/if} </strong>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_rooms_ti'] + $orderTotalInfo['total_services_ti'] + $orderTotalInfo['total_auto_add_services_ti'] + $orderTotalInfo['total_demands_price_ti']) currency=$objOrderCurrency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/if}
|
||||
{* {if isset($cart_service_products) && $cart_service_products}
|
||||
{if $priceDisplay && $use_tax}
|
||||
<tr class="item">
|
||||
<td colspan="3"></td>
|
||||
<td colspan="3">
|
||||
<strong>{l s='Total service products cost (tax excl.)'}</strong>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<span>{displayWtPriceWithCurrency price=$orderTotalInfo['total_service_products_te'] currency=$objOrderCurrency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr class="item">
|
||||
<td colspan="3"></td>
|
||||
<td colspan="3">
|
||||
<strong>{l s='Total service products cost'} {if $use_tax}{l s='(tax incl.)'}{/if} </strong>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<span>{displayWtPriceWithCurrency price=$orderTotalInfo['total_service_products_ti'] currency=$objOrderCurrency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{/if} *}
|
||||
{* {if $orderTotalInfo['total_services_te'] > 0}
|
||||
{if $priceDisplay && $use_tax}
|
||||
<tr class="item">
|
||||
<td colspan="3"></td>
|
||||
<td colspan="3">
|
||||
<strong>{l s='Total extra services cost (tax excl.)'}</strong>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<span>{displayWtPriceWithCurrency price=$orderTotalInfo['total_services_te'] currency=$objOrderCurrency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr class="item">
|
||||
<td colspan="3"></td>
|
||||
<td colspan="3">
|
||||
<strong>{l s='Total extra services cost'} {if $use_tax}{l s='(tax incl.)'}{/if}</strong>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<span>{displayWtPriceWithCurrency price=$orderTotalInfo['total_services_ti'] currency=$objOrderCurrency convert=1}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{/if} *}
|
||||
{if $order->total_wrapping > 0}
|
||||
<tr class="item">
|
||||
<td colspan="3"></td>
|
||||
<td colspan="3">
|
||||
<strong>{l s='Total gift wrapping cost'}</strong>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<span class="price-wrapping">{displayWtPriceWithCurrency price=($orderTotalInfo['total_wrapping'] * -1) currency=$objOrderCurrency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $priceDisplay && $use_tax && $orderTotalInfo['total_convenience_fee_te']}
|
||||
<tr class="item">
|
||||
<td colspan="3"></td>
|
||||
<td colspan="3">
|
||||
<strong>{l s='Total Convenience Fees (tax excl.)'}</strong>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_convenience_fee_te']) currency=$objOrderCurrency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{else if $orderTotalInfo['total_convenience_fee_ti']}
|
||||
<tr class="item">
|
||||
<td colspan="3"></td>
|
||||
<td colspan="3">
|
||||
<strong>{l s='Total Convenience Fees'} {if $use_tax}{l s='(tax incl.)'}{/if} </strong>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_convenience_fee_ti']) currency=$objOrderCurrency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr class="item">
|
||||
<td colspan="3"></td>
|
||||
<td colspan="3">
|
||||
<strong>{l s='Total Tax'}</strong>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<span class="price-discount">{displayWtPriceWithCurrency price=$orderTotalInfo['total_tax_without_discount'] currency=$objOrderCurrency convert=1}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{if $order->total_discounts > 0}
|
||||
<tr class="item">
|
||||
<td colspan="3"></td>
|
||||
<td colspan="3">
|
||||
<strong>{l s='Total Vouchers'}</strong>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
{if $priceDisplay && $use_tax}
|
||||
<span class="price-discount">{displayWtPriceWithCurrency price=($orderTotalInfo['total_discounts_te'] * -1) currency=$objOrderCurrency convert=1}</span>
|
||||
{else}
|
||||
<span class="price-discount">{displayWtPriceWithCurrency price=($orderTotalInfo['total_discounts'] * -1) currency=$objOrderCurrency convert=1}</span>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr class="totalprice item">
|
||||
<td colspan="3"></td>
|
||||
<td colspan="3">
|
||||
<strong>{l s='Final Booking Total'}</strong>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<span>{displayWtPriceWithCurrency price=$orderTotalInfo['total_paid'] currency=$objOrderCurrency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{if $orderTotalInfo['total_paid'] > $orderTotalInfo['total_paid_real']}
|
||||
<tr class="item">
|
||||
<td colspan="3"></td>
|
||||
<td colspan="3">
|
||||
<strong>{l s='Due Amount'}</strong>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_paid'] - $orderTotalInfo['total_paid_real']) currency=$objOrderCurrency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{block name='displayOrderDetailPaymentDetailsRow'}
|
||||
{hook h='displayOrderDetailPaymentDetailsRow' id_order=$order->id}
|
||||
{/block}
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
</tfoot>
|
||||
</table>
|
||||
{block name='order_detail_payment_summary'}
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
{l s='Payment Summary'}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="prices-breakdown-table">
|
||||
<table class="table table-sm table-responsive table-summary">
|
||||
<tbody>
|
||||
{if isset($cart_htl_data)}
|
||||
{if $priceDisplay && $use_tax}
|
||||
<tr class="item">
|
||||
<td>
|
||||
<strong>{l s='Total Rooms Cost (tax excl.)'}</strong>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_rooms_te'] + $orderTotalInfo['total_services_te'] + $orderTotalInfo['total_auto_add_services_te'] + $orderTotalInfo['total_demands_price_te']) currency=$objOrderCurrency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{else}
|
||||
<tr class="item">
|
||||
<td>
|
||||
<strong>{l s='Total Rooms Cost'} {if $use_tax}{l s='(tax incl.)'}{/if} </strong>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_rooms_ti'] + $orderTotalInfo['total_services_ti'] + $orderTotalInfo['total_auto_add_services_ti'] + $orderTotalInfo['total_demands_price_ti']) currency=$objOrderCurrency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/if}
|
||||
{if isset($cart_standalone_service_products) || isset($cart_hotel_service_products)}
|
||||
{if $priceDisplay && $use_tax}
|
||||
<tr class="item">
|
||||
<td>
|
||||
<strong>{l s='Total products cost (tax excl.)'}</strong>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span>{displayWtPriceWithCurrency price=$orderTotalInfo['total_service_products_te'] currency=$objOrderCurrency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{else}
|
||||
<tr class="item">
|
||||
<td>
|
||||
<strong>{l s='Total products cost'} {if $use_tax}{l s='(tax incl.)'}{/if} </strong>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span>{displayWtPriceWithCurrency price=$orderTotalInfo['total_service_products_ti'] currency=$objOrderCurrency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/if}
|
||||
{if $order->total_wrapping > 0}
|
||||
<tr class="item">
|
||||
<td>
|
||||
<strong>{l s='Total gift wrapping cost'}</strong>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span class="price-wrapping">{displayWtPriceWithCurrency price=($orderTotalInfo['total_wrapping'] * -1) currency=$objOrderCurrency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $priceDisplay && $use_tax && $orderTotalInfo['total_convenience_fee_te']}
|
||||
<tr class="item">
|
||||
<td>
|
||||
<strong>{l s='Total Convenience Fees (tax excl.)'}</strong>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_convenience_fee_te']) currency=$objOrderCurrency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{else if $orderTotalInfo['total_convenience_fee_ti']}
|
||||
<tr class="item">
|
||||
<td>
|
||||
<strong>{l s='Total Convenience Fees'} {if $use_tax}{l s='(tax incl.)'}{/if} </strong>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_convenience_fee_ti']) currency=$objOrderCurrency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr class="item">
|
||||
<td>
|
||||
<strong>{l s='Total Tax'}</strong>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span class="price-discount">{displayWtPriceWithCurrency price=$orderTotalInfo['total_tax_without_discount'] currency=$objOrderCurrency convert=1}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{if $order->total_discounts > 0}
|
||||
<tr class="item">
|
||||
<td>
|
||||
<strong>{l s='Total Vouchers'}</strong>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
{if $priceDisplay && $use_tax}
|
||||
<span class="price-discount">{displayWtPriceWithCurrency price=($orderTotalInfo['total_discounts_te'] * -1) currency=$objOrderCurrency convert=1}</span>
|
||||
{else}
|
||||
<span class="price-discount">{displayWtPriceWithCurrency price=($orderTotalInfo['total_discounts'] * -1) currency=$objOrderCurrency convert=1}</span>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr class="totalprice item">
|
||||
<td>
|
||||
<strong>{l s='Final Booking Total'}</strong>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span>{displayWtPriceWithCurrency price=$orderTotalInfo['total_paid'] currency=$objOrderCurrency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{if $orderTotalInfo['total_paid'] > $orderTotalInfo['total_paid_real']}
|
||||
<tr class="item">
|
||||
<td>
|
||||
<strong>{l s='Due Amount'}</strong>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_paid'] - $orderTotalInfo['total_paid_real']) currency=$objOrderCurrency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
<p>{l s='An email has been sent with this information.'}
|
||||
|
||||
@@ -75,38 +75,40 @@
|
||||
{/block}
|
||||
|
||||
{block name='order_detail_hotel_details'}
|
||||
<div class="card hotel-details">
|
||||
<div class="card-header">
|
||||
{l s='Hotel Details'}
|
||||
{if isset($obj_hotel_branch_information)}
|
||||
<div class="card hotel-details">
|
||||
<div class="card-header">
|
||||
{l s='Hotel Details'}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{if Validate::isLoadedObject($obj_hotel_branch_information)}
|
||||
<div class="description-list">
|
||||
<dl class="">
|
||||
<div class="row">
|
||||
<dt class="col-xs-6 col-sm-3">{l s='Hotel Name'}</dt>
|
||||
<dd class="col-xs-6 col-sm-3">{$obj_hotel_branch_information->hotel_name}</dd>
|
||||
<dt class="col-xs-6 col-sm-3">{l s='Phone Number'}</dt>
|
||||
<dd class="col-xs-6 col-sm-3">
|
||||
<a href="tel:{if $hotel_address_info.phone_mobile}{$hotel_address_info.phone_mobile}{else}{$hotel_address_info.phone}{/if}">
|
||||
{if $hotel_address_info.phone_mobile}{$hotel_address_info.phone_mobile}{else}{$hotel_address_info.phone}{/if}
|
||||
</a>
|
||||
</dd>
|
||||
<dt class="col-xs-6 col-sm-3">{l s='Email'}</dt>
|
||||
<dd class="col-xs-6 col-sm-3">
|
||||
<a href="mailto:{$obj_hotel_branch_information->email}" class="hotel-email">{$obj_hotel_branch_information->email}</a>
|
||||
</dd>
|
||||
{block name='displayOrderDetailHotelDetailsAfter'}
|
||||
{hook h='displayOrderDetailHotelDetailsAfter' id_order=$order->id}
|
||||
{/block}
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
{else}
|
||||
<div class="card-text">{l s='Hotel details not available.'}</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{if Validate::isLoadedObject($obj_hotel_branch_information)}
|
||||
<div class="description-list">
|
||||
<dl class="">
|
||||
<div class="row">
|
||||
<dt class="col-xs-6 col-sm-3">{l s='Hotel Name'}</dt>
|
||||
<dd class="col-xs-6 col-sm-3">{$obj_hotel_branch_information->hotel_name}</dd>
|
||||
<dt class="col-xs-6 col-sm-3">{l s='Phone Number'}</dt>
|
||||
<dd class="col-xs-6 col-sm-3">
|
||||
<a href="tel:{if $hotel_address_info.phone_mobile}{$hotel_address_info.phone_mobile}{else}{$hotel_address_info.phone}{/if}">
|
||||
{if $hotel_address_info.phone_mobile}{$hotel_address_info.phone_mobile}{else}{$hotel_address_info.phone}{/if}
|
||||
</a>
|
||||
</dd>
|
||||
<dt class="col-xs-6 col-sm-3">{l s='Email'}</dt>
|
||||
<dd class="col-xs-6 col-sm-3">
|
||||
<a href="mailto:{$obj_hotel_branch_information->email}" class="hotel-email">{$obj_hotel_branch_information->email}</a>
|
||||
</dd>
|
||||
{block name='displayOrderDetailHotelDetailsAfter'}
|
||||
{hook h='displayOrderDetailHotelDetailsAfter' id_order=$order->id}
|
||||
{/block}
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
{else}
|
||||
<div class="card-text">{l s='Hotel details not available.'}</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
{block name='order_details_payment_details_mobile'}
|
||||
@@ -154,42 +156,44 @@
|
||||
{/block}
|
||||
|
||||
{block name='order_detail_hotel_location_mobile'}
|
||||
<div class="card hotel-location visible-xs visible-sm hidden-md hidden-lg">
|
||||
<div class="card-header">
|
||||
{l s='Hotel Location'}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="card-subtitle">
|
||||
{l s='Address'}
|
||||
</p>
|
||||
|
||||
{if isset($hotel_address_info) && $hotel_address_info}
|
||||
<p class="hotel-address">
|
||||
{$hotel_address_info['address1']},
|
||||
{if {$hotel_address_info['address2']}}{$hotel_address_info['address2']},{/if}
|
||||
{$hotel_address_info['city']},
|
||||
{if {$hotel_address_info['state']}}{$hotel_address_info['state']},{/if}
|
||||
{$hotel_address_info['country']}, {$hotel_address_info['postcode']}
|
||||
{if isset($obj_hotel_branch_information)}
|
||||
<div class="card hotel-location visible-xs visible-sm hidden-md hidden-lg">
|
||||
<div class="card-header">
|
||||
{l s='Hotel Location'}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="card-subtitle">
|
||||
{l s='Address'}
|
||||
</p>
|
||||
{else}
|
||||
<div class="card-text">{l s='Hotel location not available.'}</div>
|
||||
{/if}
|
||||
|
||||
{if ($obj_hotel_branch_information->latitude|floatval != 0 && $obj_hotel_branch_information->longitude|floatval != 0) && $view_on_map}
|
||||
<div class="hotel-location-map">
|
||||
<div class="booking-hotel-map-container"></div>
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($hotel_address_info) && $hotel_address_info}
|
||||
<p class="hotel-address">
|
||||
{$hotel_address_info['address1']},
|
||||
{if {$hotel_address_info['address2']}}{$hotel_address_info['address2']},{/if}
|
||||
{$hotel_address_info['city']},
|
||||
{if {$hotel_address_info['state']}}{$hotel_address_info['state']},{/if}
|
||||
{$hotel_address_info['country']}, {$hotel_address_info['postcode']}
|
||||
</p>
|
||||
{else}
|
||||
<div class="card-text">{l s='Hotel location not available.'}</div>
|
||||
{/if}
|
||||
|
||||
{block name='displayOrderDetailHotelLocationAfter'}
|
||||
{hook h='displayOrderDetailHotelLocationAfter' id_order=$order->id}
|
||||
{/block}
|
||||
{if ($obj_hotel_branch_information->latitude|floatval != 0 && $obj_hotel_branch_information->longitude|floatval != 0) && $view_on_map}
|
||||
<div class="hotel-location-map">
|
||||
<div class="booking-hotel-map-container"></div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{block name='displayOrderDetailHotelLocationAfter'}
|
||||
{hook h='displayOrderDetailHotelLocationAfter' id_order=$order->id}
|
||||
{/block}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
{block name='order_detail_refund_requests'}
|
||||
{if isset($refundReqBookings) && $refundReqBookings}
|
||||
{if (isset($refundReqBookings) && $refundReqBookings) || (isset($refundReqProducts) && $refundReqProducts)}
|
||||
<div class="alert alert-info-light cancel_requests_link_wrapper">
|
||||
<i class="icon-info-circle"></i>
|
||||
{if count($refundReqBookings) <= 1}
|
||||
@@ -206,49 +210,120 @@
|
||||
{/block}
|
||||
|
||||
{block name='order_detail_room_details'}
|
||||
<div class="card room-details">
|
||||
<div class="card-header">
|
||||
{l s='Room Details'}
|
||||
<div class="booking-actions-wrap">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 clearfix">
|
||||
{if $refund_allowed}
|
||||
{if !$completeRefundRequestOrCancel}
|
||||
<a id="order_refund_request" class="btn btn-default pull-right" href="#" title="{l s='Proceed to refund'}"><span>{l s='Cancel Bookings'}</span></a>
|
||||
{if isset($cart_htl_data) && $cart_htl_data}
|
||||
<div class="card room-details">
|
||||
<div class="card-header">
|
||||
{l s='Room Details'}
|
||||
<div class="booking-actions-wrap">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 clearfix">
|
||||
{if $refund_allowed}
|
||||
{if !$completeRefundRequestOrCancel}
|
||||
<a id="order_room_refund_request" class="btn btn-default pull-right order_refund_request" href="#" title="{l s='Proceed to refund'}"><span>{l s='Cancel Bookings'}</span></a>
|
||||
{/if}
|
||||
{if isset($id_cms_refund_policy) && $id_cms_refund_policy}
|
||||
<a target="_blank" class="btn btn-default pull-right refund_policy_link" href="{$link->getCMSLink($id_cms_refund_policy)|escape:'html':'UTF-8'}">{l s='Refund Policies'}</a>
|
||||
{/if}
|
||||
{/if}
|
||||
{if isset($id_cms_refund_policy) && $id_cms_refund_policy}
|
||||
<a target="_blank" class="btn btn-default pull-right refund_policy_link" href="{$link->getCMSLink($id_cms_refund_policy)|escape:'html':'UTF-8'}">{l s='Refund Policies'}</a>
|
||||
{/if}
|
||||
{/if}
|
||||
{block name='displayBookingAction'}
|
||||
{hook h='displayBookingAction' id_order=$order->id}
|
||||
{/block}
|
||||
{block name='displayBookingAction'}
|
||||
{hook h='displayBookingAction' id_order=$order->id}
|
||||
{/block}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{if isset($cart_htl_data) && $cart_htl_data}
|
||||
<div class="rooms-list">
|
||||
{foreach from=$cart_htl_data key=data_k item=data_v}
|
||||
{foreach from=$data_v['date_diff'] key=rm_k item=rm_v}
|
||||
{block name='order_room_detail'}
|
||||
{include file='./_partials/order-room-detail.tpl'}
|
||||
{/block}
|
||||
<div class="card-body">
|
||||
{if isset($cart_htl_data) && $cart_htl_data}
|
||||
<div class="rooms-list">
|
||||
{foreach from=$cart_htl_data key=data_k item=data_v}
|
||||
{foreach from=$data_v['date_diff'] key=rm_k item=rm_v}
|
||||
{block name='order_room_detail'}
|
||||
{include file='./_partials/order-room-detail.tpl'}
|
||||
{/block}
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
|
||||
{block name='displayOrderDetailRoomDetailsRoomsAfter'}
|
||||
{hook h='displayOrderDetailRoomDetailsRoomsAfter' id_order=$order->id}
|
||||
{/block}
|
||||
</div>
|
||||
{else}
|
||||
<div class="no-rooms card-text">{l s='Room details not available.'}</div>
|
||||
{/if}
|
||||
{block name='displayOrderDetailRoomDetailsRoomsAfter'}
|
||||
{hook h='displayOrderDetailRoomDetailsRoomsAfter' id_order=$order->id}
|
||||
{/block}
|
||||
</div>
|
||||
{else}
|
||||
<div class="no-rooms card-text">{l s='Room details not available.'}</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
{block name='hotel_service_products_block'}
|
||||
{if isset($hotel_service_products) && $hotel_service_products}
|
||||
<div class="card service-product-details">
|
||||
<div class="card-header">
|
||||
{l s='Product Details'}
|
||||
<div class="booking-actions-wrap">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 clearfix">
|
||||
{if $refund_allowed}
|
||||
{if !$completeRefundRequestOrCancel}
|
||||
<a id="order_product_refund_request" class="btn btn-default pull-right order_refund_request" href="#" title="{l s='Proceed to refund'}"><span>{l s='Cancel Products'}</span></a>
|
||||
{/if}
|
||||
{if isset($id_cms_refund_policy) && $id_cms_refund_policy}
|
||||
<a target="_blank" class="btn btn-default pull-right refund_policy_link" href="{$link->getCMSLink($id_cms_refund_policy)|escape:'html':'UTF-8'}">{l s='Refund Policies'}</a>
|
||||
{/if}
|
||||
{/if}
|
||||
{block name='displayBookingAction'}
|
||||
{hook h='displayBookingAction' id_order=$order->id}
|
||||
{/block}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{foreach from=$hotel_service_products key=data_k item=product}
|
||||
{block name='hotel_service_products_detail'}
|
||||
{include file='./_partials/order-hotel-service-detail.tpl'}
|
||||
{/block}
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
{block name='standalone_products_block'}
|
||||
{if isset($standalone_service_products) && $standalone_service_products}
|
||||
<div class="card service-product-details">
|
||||
<div class="card-header">
|
||||
{l s='Product Details'}
|
||||
<div class="booking-actions-wrap">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 clearfix">
|
||||
{if $refund_allowed}
|
||||
{if !$completeRefundRequestOrCancel}
|
||||
<a id="order_product_refund_request" class="btn btn-default pull-right order_refund_request" href="#" title="{l s='Proceed to refund'}"><span>{l s='Cancel Products'}</span></a>
|
||||
{/if}
|
||||
{if isset($id_cms_refund_policy) && $id_cms_refund_policy}
|
||||
<a target="_blank" class="btn btn-default pull-right refund_policy_link" href="{$link->getCMSLink($id_cms_refund_policy)|escape:'html':'UTF-8'}">{l s='Refund Policies'}</a>
|
||||
{/if}
|
||||
{/if}
|
||||
{block name='displayBookingAction'}
|
||||
{hook h='displayBookingAction' id_order=$order->id}
|
||||
{/block}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{foreach from=$standalone_service_products key=data_k item=product}
|
||||
{block name='standalone_service_products_detail'}
|
||||
{include file='./_partials/order-standalone-service-detail.tpl'}
|
||||
{/block}
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
|
||||
{block name='order_detail_payment_summary_mobile'}
|
||||
<div class="card payment-summary visible-xs visible-sm hidden-md hidden-lg">
|
||||
<div class="card-header">
|
||||
@@ -431,52 +506,54 @@
|
||||
{/block}
|
||||
|
||||
{block name='order_detail_hotel_policies'}
|
||||
{assign var=has_general_hotel_policies value=(isset($obj_hotel_branch_information->policies) && $obj_hotel_branch_information->policies)}
|
||||
{assign var=has_refund_hotel_policies value=($obj_hotel_branch_information->isRefundable() && $hotel_refund_rules)}
|
||||
{if $has_general_hotel_policies || $has_refund_hotel_policies}
|
||||
<div class="card hotel-policies card-tabs">
|
||||
<div class="card-header">
|
||||
<ul class="nav nav-tabs">
|
||||
{if $has_general_hotel_policies}
|
||||
<li class="active">
|
||||
<a href="#tab-hotel-policies-general" data-toggle="tab">{l s='Hotel Policies'}</a>
|
||||
</li>
|
||||
{/if}
|
||||
{if $has_refund_hotel_policies}
|
||||
<li {if !$has_general_hotel_policies}class="active"{/if}>
|
||||
<a href="#tab-hotel-policies-refund" data-toggle="tab">{l s='Refund Policies'}</a>
|
||||
</li>
|
||||
{/if}
|
||||
{block name='displayOrderDetailPoliciesTab'}
|
||||
{hook h='displayOrderDetailPoliciesTab' id_order=$order->id}
|
||||
{/block}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="tab-content">
|
||||
{if $has_general_hotel_policies}
|
||||
<div id="tab-hotel-policies-general" class="tab-pane active">
|
||||
<div class="card-text">{$obj_hotel_branch_information->policies}</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if $has_refund_hotel_policies}
|
||||
<div id="tab-hotel-policies-refund" class="tab-pane{if !$has_general_hotel_policies}active{/if}">
|
||||
<div class="refund-policies-list">
|
||||
{foreach from=$hotel_refund_rules item=hotel_refund_rule name=foreach_refund_rules}
|
||||
<div class="refund-policy">
|
||||
<p class="refund-rule-name">{l s='%s. ' sprintf=[$smarty.foreach.foreach_refund_rules.iteration]}{$hotel_refund_rule.name|escape:'html':'UTF-8'}</p>
|
||||
<div class="card-text refund-rule-description">{$hotel_refund_rule.description|escape:'html':'UTF-8'}</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{if isset($obj_hotel_branch_information)}
|
||||
{assign var=has_general_hotel_policies value=(isset($obj_hotel_branch_information->policies) && $obj_hotel_branch_information->policies)}
|
||||
{assign var=has_refund_hotel_policies value=($obj_hotel_branch_information->isRefundable() && $hotel_refund_rules)}
|
||||
{if $has_general_hotel_policies || $has_refund_hotel_policies}
|
||||
<div class="card hotel-policies card-tabs">
|
||||
<div class="card-header">
|
||||
<ul class="nav nav-tabs">
|
||||
{if $has_general_hotel_policies}
|
||||
<li class="active">
|
||||
<a href="#tab-hotel-policies-general" data-toggle="tab">{l s='Hotel Policies'}</a>
|
||||
</li>
|
||||
{/if}
|
||||
{if $has_refund_hotel_policies}
|
||||
<li {if !$has_general_hotel_policies}class="active"{/if}>
|
||||
<a href="#tab-hotel-policies-refund" data-toggle="tab">{l s='Refund Policies'}</a>
|
||||
</li>
|
||||
{/if}
|
||||
{block name='displayOrderDetailPoliciesTab'}
|
||||
{hook h='displayOrderDetailPoliciesTab' id_order=$order->id}
|
||||
{/block}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="tab-content">
|
||||
{if $has_general_hotel_policies}
|
||||
<div id="tab-hotel-policies-general" class="tab-pane active">
|
||||
<div class="card-text">{$obj_hotel_branch_information->policies}</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{block name='displayOrderDetailPoliciesTabContent'}
|
||||
{hook h='displayOrderDetailPoliciesTabContent' id_order=$order->id}
|
||||
{/block}
|
||||
{/if}
|
||||
{if $has_refund_hotel_policies}
|
||||
<div id="tab-hotel-policies-refund" class="tab-pane{if !$has_general_hotel_policies}active{/if}">
|
||||
<div class="refund-policies-list">
|
||||
{foreach from=$hotel_refund_rules item=hotel_refund_rule name=foreach_refund_rules}
|
||||
<div class="refund-policy">
|
||||
<p class="refund-rule-name">{l s='%s. ' sprintf=[$smarty.foreach.foreach_refund_rules.iteration]}{$hotel_refund_rule.name|escape:'html':'UTF-8'}</p>
|
||||
<div class="card-text refund-rule-description">{$hotel_refund_rule.description|escape:'html':'UTF-8'}</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{block name='displayOrderDetailPoliciesTabContent'}
|
||||
{hook h='displayOrderDetailPoliciesTabContent' id_order=$order->id}
|
||||
{/block}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
@@ -603,38 +680,40 @@
|
||||
{/block}
|
||||
|
||||
{block name='order_detail_hotel_location'}
|
||||
<div class="card hotel-location hidden-xs hidden-sm visible-md">
|
||||
<div class="card-header">
|
||||
{l s='Hotel Location'}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="card-subtitle">
|
||||
{l s='Address'}
|
||||
</p>
|
||||
|
||||
{if isset($hotel_address_info) && $hotel_address_info}
|
||||
<p class="hotel-address">
|
||||
{$hotel_address_info['address1']},
|
||||
{if {$hotel_address_info['address2']}}{$hotel_address_info['address2']},{/if}
|
||||
{$hotel_address_info['city']},
|
||||
{if {$hotel_address_info['state']}}{$hotel_address_info['state']},{/if}
|
||||
{$hotel_address_info['country']}, {$hotel_address_info['postcode']}
|
||||
{if isset($obj_hotel_branch_information)}
|
||||
<div class="card hotel-location hidden-xs hidden-sm visible-md">
|
||||
<div class="card-header">
|
||||
{l s='Hotel Location'}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="card-subtitle">
|
||||
{l s='Address'}
|
||||
</p>
|
||||
{else}
|
||||
<div class="card-text">{l s='Hotel location not available.'}</div>
|
||||
{/if}
|
||||
|
||||
{if ($obj_hotel_branch_information->latitude|floatval != 0 && $obj_hotel_branch_information->longitude|floatval != 0) && $view_on_map}
|
||||
<div class="hotel-location-map">
|
||||
<div class="booking-hotel-map-container"></div>
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($hotel_address_info) && $hotel_address_info}
|
||||
<p class="hotel-address">
|
||||
{$hotel_address_info['address1']},
|
||||
{if {$hotel_address_info['address2']}}{$hotel_address_info['address2']},{/if}
|
||||
{$hotel_address_info['city']},
|
||||
{if {$hotel_address_info['state']}}{$hotel_address_info['state']},{/if}
|
||||
{$hotel_address_info['country']}, {$hotel_address_info['postcode']}
|
||||
</p>
|
||||
{else}
|
||||
<div class="card-text">{l s='Hotel location not available.'}</div>
|
||||
{/if}
|
||||
|
||||
{block name='displayOrderDetailHotelLocationAfter'}
|
||||
{hook h='displayOrderDetailHotelLocationAfter' id_order=$order->id}
|
||||
{/block}
|
||||
{if ($obj_hotel_branch_information->latitude|floatval != 0 && $obj_hotel_branch_information->longitude|floatval != 0) && $view_on_map}
|
||||
<div class="hotel-location-map">
|
||||
<div class="booking-hotel-map-container"></div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{block name='displayOrderDetailHotelLocationAfter'}
|
||||
{hook h='displayOrderDetailHotelLocationAfter' id_order=$order->id}
|
||||
{/block}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
{block name='order_detail_payment_summary'}
|
||||
@@ -847,18 +926,30 @@
|
||||
<div class="col-xs-4">
|
||||
<ul class="nav nav-tabs nav-stacked">
|
||||
{assign var='flag_is_first_iteration' value=true}
|
||||
{foreach from=$cart_htl_data key=data_k item=data_v}
|
||||
{foreach from=$data_v['date_diff'] key=rm_k item=rm_v}
|
||||
{assign var="is_full_date" value=($show_full_date && ($rm_v['data_form']|date_format:'%D' == $rm_v['data_to']|date_format:'%D'))}
|
||||
{if $cart_htl_data|count}
|
||||
{foreach from=$cart_htl_data key=data_k item=data_v}
|
||||
{foreach from=$data_v['date_diff'] key=rm_k item=rm_v}
|
||||
{assign var="is_full_date" value=($show_full_date && ($rm_v['data_form']|date_format:'%D' == $rm_v['data_to']|date_format:'%D'))}
|
||||
<li class="{if $flag_is_first_iteration}active{/if}">
|
||||
<a href="#room-info-tab-{$data_v.id_product}-{$rm_k}" class="" data-toggle="tab">
|
||||
<div class="room-type-name">{$data_v.name}</div>
|
||||
<div class="duration">{dateFormat date=$rm_v.data_form full=$is_full_date} - {dateFormat date=$rm_v.data_to full=$is_full_date}</div>
|
||||
</a>
|
||||
</li>
|
||||
{if $flag_is_first_iteration}{assign var='flag_is_first_iteration' value=false}{/if}
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{/if}
|
||||
{if $service_products_formatted|count}
|
||||
{foreach from=$service_products_formatted key=data_k item=data_v}
|
||||
<li class="{if $flag_is_first_iteration}active{/if}">
|
||||
<a href="#room-info-tab-{$data_v.id_product}-{$rm_k}" class="" data-toggle="tab">
|
||||
<a href="#product-info-tab-{$data_v.id_product}" class="" data-toggle="tab">
|
||||
<div class="room-type-name">{$data_v.name}</div>
|
||||
<div class="duration">{dateFormat date=$rm_v.data_form full=$is_full_date} - {dateFormat date=$rm_v.data_to full=$is_full_date}</div>
|
||||
</a>
|
||||
</li>
|
||||
{if $flag_is_first_iteration}{assign var='flag_is_first_iteration' value=false}{/if}
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{/if}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-xs-8">
|
||||
@@ -937,6 +1028,44 @@
|
||||
{if $flag_is_first_iteration}{assign var='flag_is_first_iteration' value=false}{/if}
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{foreach from=$service_products_formatted key=data_k item=data_v}
|
||||
<div id="product-info-tab-{$data_v.id_product}" class="tab-pane {if $flag_is_first_iteration}active{/if}">
|
||||
{* <div class="room-type-summary clearfix">
|
||||
<p class="room-type-name">{$data_v.name}</p>
|
||||
<div class="col-xs-3">
|
||||
<p>{l s='Total Quantity'}</p>
|
||||
<strong>{$data_v.quantity|string_format:'%02d'}</strong>
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
<p>{l s='Cancelled Quantity'}</p>
|
||||
<strong>
|
||||
</strong>
|
||||
</div>
|
||||
</div> *}
|
||||
<div class="rooms-summary">
|
||||
{foreach from=$data_v['options'] item=$product_option}
|
||||
{assign var=is_product_cancelled value=(isset($refundReqProducts) && in_array($product_option.id_room_type_service_product_order_detail, $refundReqProducts))}
|
||||
<div class="room-details {if $is_product_cancelled}cancelled{/if} clearfix">
|
||||
<div class="occupancy-wrap">
|
||||
<div class="checkbox">
|
||||
<label for="bookings_to_refund_{$product_option.id_room_type_service_product_order_detail}">
|
||||
<input type="checkbox" class="bookings_to_refund" id="bookings_to_refund_{$product_option.id_room_type_service_product_order_detail}" name="id_room_type_service_product_order_detail[]" value="{$product_option.id_room_type_service_product_order_detail|escape:'html':'UTF-8'}" {if $is_product_cancelled }disabled{/if}/>
|
||||
{$product_option.name}{if isset($product_option.option_name) && $product_option.option_name} : {$product_option.option_name}{/if}
|
||||
</label>
|
||||
<br>
|
||||
{if $product_option.is_cancelled}<span class="badge badge-danger badge-cancelled">{l s='Cancelled'}</span>{else if $product_option.is_refunded}<span class="badge badge-danger badge-cancelled">{l s='Refunded'}</span>{else if $hotel_booking_detail.refund_denied}<span class="badge badge-danger badge-cancelled">{l s='Refund denied'}</span> <i class="icon-info-circle refund-denied-info" data-refund_denied_info="{l s='Refund for this booking is denied. Please contact admin for more detail.'}"></i>{else if $hotel_booking_detail.id_status != $ROOM_STATUS_ALLOTED}<span class="badge badge-danger badge-cancelled">{if $hotel_booking_detail.id_status == $ROOM_STATUS_CHECKED_OUT}{l s='Checked-Out'}{else}{l s='Checked-In'}{/if}</span>{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="extra-services-wrap clearfix">
|
||||
<span>{l s='Quantity'} : {$product_option.quantity}</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
{if $flag_is_first_iteration}{assign var='flag_is_first_iteration' value=false}{/if}
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -944,7 +1073,7 @@
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="selected-rooms-wrap">
|
||||
{l s='Selected Rooms: '}<span class="num-selected-rooms">{l s='00'}</span>
|
||||
{l s='Selected: '}<span class="num-selected-rooms">{l s='00'}</span>
|
||||
</div>
|
||||
<div class="actions-wrap">
|
||||
<button class="btn btn-secondary btn-cancel">
|
||||
@@ -965,7 +1094,7 @@
|
||||
<div class="errors" style="display: none;"></div>
|
||||
|
||||
<div class="well well-sm">
|
||||
<p class="text">{l s='Total Rooms to Cancel:'} <span class="count-total-rooms">{l s='00'}</span></p>
|
||||
<p class="text">{l s='Total cancel request:'} <span class="count-total-rooms">{l s='00'}</span></p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
@@ -32,13 +32,13 @@
|
||||
{$navigationPipe}
|
||||
</span>
|
||||
<span class="navigation_page">
|
||||
{l s='Booking refund requests'}
|
||||
{l s='Refund requests'}
|
||||
</span>
|
||||
{/capture}
|
||||
<div class="panel">
|
||||
{block name='order_follow_heading'}
|
||||
<h1 class="page-heading bottom-indent">
|
||||
<i class="icon-tasks"></i> {l s='Booking Refund Requests'}
|
||||
<i class="icon-tasks"></i> {l s='Refund Requests'}
|
||||
</h1>
|
||||
{/block}
|
||||
{if $ordersReturns && $ordersReturns|count}
|
||||
|
||||
@@ -247,113 +247,7 @@
|
||||
<div class="col-md-4">
|
||||
{block name='order_opc_cart_total_detail'}
|
||||
{* Total cart details, tax details, advance payment details and voucher details *}
|
||||
<div class="col-sm-12 card cart_total_detail_block">
|
||||
{* {if $total_service_products}
|
||||
<p>
|
||||
<span>{l s='Total service products cost'}{if $display_tax_label}{l s=' (tax excl.)'}{/if}</span>
|
||||
<span class="cart_total_values">{displayPrice price=$total_service_products}</span>
|
||||
</p>
|
||||
{/if} *}
|
||||
<p>
|
||||
<span>
|
||||
{l s='Total rooms cost'}
|
||||
{if $display_tax_label}
|
||||
{if $use_taxes && $priceDisplay == 0}
|
||||
{l s='(tax incl)'}
|
||||
{else}
|
||||
{l s='(tax excl)'}
|
||||
{/if}
|
||||
{/if}
|
||||
</span>
|
||||
<span class="cart_total_values">
|
||||
{if $use_taxes && $priceDisplay == 0}
|
||||
{assign var='total_rooms_cost' value=($total_rooms_wt + $total_extra_demands_wt + $total_additional_services_wt + $total_additional_services_auto_add_wt)}
|
||||
{else}
|
||||
{assign var='total_rooms_cost' value=($total_rooms + $total_extra_demands + $total_additional_services + $total_additional_services_auto_add)}
|
||||
{/if}
|
||||
{displayPrice price=$total_rooms_cost}
|
||||
</span>
|
||||
</p>
|
||||
{if $convenience_fee_wt}
|
||||
<p>
|
||||
<span>
|
||||
{l s='Convenience Fees'}
|
||||
{if $display_tax_label}
|
||||
{if $use_taxes && $priceDisplay == 0}
|
||||
{l s='(tax incl)'}
|
||||
{else}
|
||||
{l s='(tax excl)'}
|
||||
{/if}
|
||||
{/if}
|
||||
</span>
|
||||
<span class="cart_total_values">
|
||||
{if $use_taxes && $priceDisplay == 0}
|
||||
{displayPrice price=$convenience_fee_wt}
|
||||
{else}
|
||||
{displayPrice price=$convenience_fee}
|
||||
{/if}
|
||||
</span>
|
||||
</p>
|
||||
{/if}
|
||||
{block name='displayBeforeCartTotalTax'}
|
||||
{hook h='displayBeforeCartTotalTax'}
|
||||
{/block}
|
||||
{if $show_taxes}
|
||||
<p class="cart_total_tax">
|
||||
<span>{l s='Total tax'}</span>
|
||||
<span class="cart_total_values">{displayPrice price=($total_tax_without_discount)}</span>
|
||||
</p>
|
||||
{/if}
|
||||
<p class="total_discount_block {if $total_discounts == 0}unvisible{/if}">
|
||||
<span>
|
||||
{if $display_tax_label}
|
||||
{if $use_taxes && $priceDisplay == 0}
|
||||
{l s='Total Discount (tax incl)'}
|
||||
{else}
|
||||
{l s='Total Discount (tax excl)'}
|
||||
{/if}
|
||||
{else}
|
||||
{l s='Total Discount'}
|
||||
{/if}
|
||||
</span>
|
||||
<span class="cart_total_values">
|
||||
{if $use_taxes && $priceDisplay == 0}
|
||||
{assign var='total_discounts_negative' value=$total_discounts * -1}
|
||||
{else}
|
||||
{assign var='total_discounts_negative' value=$total_discounts_tax_exc * -1}
|
||||
{/if}
|
||||
{displayPrice price=$total_discounts_negative}
|
||||
</span>
|
||||
</p>
|
||||
<hr>
|
||||
<p {if !isset($is_advance_payment) || !$is_advance_payment}class="cart_final_total_block"{/if}>
|
||||
<span class="strong">{l s='Total'}</span>
|
||||
{block name='displayCartTotalPriceLabelTotal'}
|
||||
{hook h="displayCartTotalPriceLabel" type='total'}
|
||||
{/block}
|
||||
<span class="cart_total_values {if isset($is_advance_payment) && $is_advance_payment} strong{/if}">
|
||||
{if $use_taxes}
|
||||
{displayPrice price=$total_price}
|
||||
{else}
|
||||
{displayPrice price=$total_price_without_tax}
|
||||
{/if}
|
||||
</span>
|
||||
</p>
|
||||
{if isset($is_advance_payment) && $is_advance_payment}
|
||||
<hr>
|
||||
<p>
|
||||
<span>{l s='Due Amount'}</span>
|
||||
<span class="cart_total_values">{displayPrice price=$dueAmount}</span>
|
||||
</p>
|
||||
<p class="cart_final_total_block">
|
||||
<span class="strong">{l s='Partially Payable Total'}</span>
|
||||
{block name='displayCartTotalPriceLabelPartial'}
|
||||
{hook h="displayCartTotalPriceLabel" type='partial'}
|
||||
{/block}
|
||||
<span class="cart_total_values">{displayPrice price=$advPaymentAmount}</span>
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
{include file="$tpl_dir./cart-total-block.tpl"}
|
||||
{/block}
|
||||
{block name='order_opc_vouchers'}
|
||||
{* Check if voucher feature is enabled currently *}
|
||||
|
||||
@@ -32,13 +32,13 @@
|
||||
{$navigationPipe}
|
||||
</span>
|
||||
<a href="{$link->getPageLink('order-follow', true)|escape:'html':'UTF-8'}">
|
||||
{l s='Booking refund requests'}
|
||||
{l s='Refund requests'}
|
||||
</a>
|
||||
<span class="navigation-pipe">
|
||||
{$navigationPipe}
|
||||
</span>
|
||||
<span class="navigation_page">
|
||||
{l s='Booking refund detail'}
|
||||
{l s='Refund detail'}
|
||||
</span>
|
||||
{/capture}
|
||||
|
||||
@@ -48,52 +48,91 @@
|
||||
<div class="panel card">
|
||||
{block name='order_return_heading'}
|
||||
<h1 class="page-heading bottom-indent">
|
||||
<i class="icon-tasks"></i> {l s='Booking Refund Requests'}
|
||||
<i class="icon-tasks"></i> {l s='Refund Requests'}
|
||||
</h1>
|
||||
{/block}
|
||||
{block name='order_return_detail'}
|
||||
<div class="table-responsive wk-datatable-wrapper">
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th>{l s='Rooms'}</th>
|
||||
<th>{l s='Room type'}</th>
|
||||
<th>{l s='Hotel'}</th>
|
||||
<th>{l s='Duration'}</th>
|
||||
<th>{l s='Total rooms price (tax incl.)'}</th>
|
||||
<th>{l s='Extra services price (tax incl.)'}</th>
|
||||
{if $isRefundCompleted}
|
||||
<th>{l s='Refund amount'}</th>
|
||||
<th>{l s='Refund Status'}</th>
|
||||
{/if}
|
||||
</tr>
|
||||
{foreach from=$refundReqBookings item=$booking name=refundRequest}
|
||||
{if $refundReqBookings}
|
||||
<div class="table-responsive wk-datatable-wrapper">
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td>{l s='Room'} - {$smarty.foreach.refundRequest.iteration|string_format:'%02d'}</td>
|
||||
<td>{$booking['room_type_name']|escape:'htmlall':'UTF-8'}</td>
|
||||
<td>{$booking['hotel_name']|escape:'htmlall':'UTF-8'}</td>
|
||||
{assign var="is_full_date" value=($show_full_date && ($booking['date_from']|date_format:'%D' == $booking['date_to']|date_format:'%D'))}
|
||||
<td>{dateFormat date=$booking['date_from'] full=$is_full_date} {l s='To'} {dateFormat date=$booking['date_to'] full=$is_full_date}</td>
|
||||
<td>{displayPrice price=$booking['total_price_tax_incl'] currency=$orderCurrency['id']}</td>
|
||||
<td>{displayPrice price=$booking['extra_service_total_price_tax_incl'] currency=$orderCurrency['id']}</td>
|
||||
<th>{l s='Rooms'}</th>
|
||||
<th>{l s='Room type'}</th>
|
||||
<th>{l s='Hotel'}</th>
|
||||
<th>{l s='Duration'}</th>
|
||||
<th>{l s='Total rooms price (tax incl.)'}</th>
|
||||
<th>{l s='Extra services price (tax incl.)'}</th>
|
||||
{if $isRefundCompleted}
|
||||
<td>
|
||||
{displayPrice price=$booking['refunded_amount'] currency=$orderCurrency['id']}
|
||||
</td>
|
||||
<td>
|
||||
{if $booking['is_cancelled']}
|
||||
<span class="badge badge-danger">{l s='Cancelled' mod='hotelreservationsystem'}</span>
|
||||
{* used id_customization to check if in this request which bookings are refunded or not*}
|
||||
{else if $booking['id_customization']}
|
||||
<span class="badge badge-success">{l s='Refunded' mod='hotelreservationsystem'}</span>
|
||||
{else}
|
||||
<span class="badge badge-danger">{l s='Denied' mod='hotelreservationsystem'}</span>
|
||||
{/if}
|
||||
</td>
|
||||
<th>{l s='Refund amount'}</th>
|
||||
<th>{l s='Refund Status'}</th>
|
||||
{/if}
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
</div>
|
||||
{foreach from=$refundReqBookings item=$booking name=refundRequest}
|
||||
<tr>
|
||||
<td>{l s='Room'} - {$smarty.foreach.refundRequest.iteration|string_format:'%02d'}</td>
|
||||
<td>{$booking['room_type_name']|escape:'htmlall':'UTF-8'}</td>
|
||||
<td>{$booking['hotel_name']|escape:'htmlall':'UTF-8'}</td>
|
||||
{assign var="is_full_date" value=($show_full_date && ($booking['date_from']|date_format:'%D' == $booking['date_to']|date_format:'%D'))}
|
||||
<td>{dateFormat date=$booking['date_from'] full=$is_full_date} {l s='To'} {dateFormat date=$booking['date_to'] full=$is_full_date}</td>
|
||||
<td>{displayPrice price=$booking['total_price_tax_incl'] currency=$orderCurrency['id']}</td>
|
||||
<td>{displayPrice price=$booking['extra_service_total_price_tax_incl'] currency=$orderCurrency['id']}</td>
|
||||
{if $isRefundCompleted}
|
||||
<td>
|
||||
{displayPrice price=$booking['refunded_amount'] currency=$orderCurrency['id']}
|
||||
</td>
|
||||
<td>
|
||||
{if $booking['is_cancelled']}
|
||||
<span class="badge badge-danger">{l s='Cancelled' mod='hotelreservationsystem'}</span>
|
||||
{* used id_customization to check if in this request which bookings are refunded or not*}
|
||||
{else if $booking['id_customization']}
|
||||
<span class="badge badge-success">{l s='Refunded' mod='hotelreservationsystem'}</span>
|
||||
{else}
|
||||
<span class="badge badge-danger">{l s='Denied' mod='hotelreservationsystem'}</span>
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
</div>
|
||||
{/if}
|
||||
{if $refundReqProducts}
|
||||
<div class="table-responsive wk-datatable-wrapper">
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th>{l s='Name'}</th>
|
||||
<th>{l s='Quantity'}</th>
|
||||
<th>{l s='Total rooms price (tax incl.)'}</th>
|
||||
{if $isRefundCompleted}
|
||||
<th>{l s='Refund amount'}</th>
|
||||
<th>{l s='Refund Status'}</th>
|
||||
{/if}
|
||||
</tr>
|
||||
{foreach from=$refundReqProducts item=$product name=refundRequest}
|
||||
<tr>
|
||||
<td>{$product['name']|escape:'htmlall':'UTF-8'}{if isset($product['option_name']) && $product['option_name']} : {$product['option_name']}{/if}</td>
|
||||
<td>{$product['quantity']|escape:'htmlall':'UTF-8'}</td>
|
||||
<td>{displayPrice price=$product['total_price_tax_incl'] currency=$orderCurrency['id']}</td>
|
||||
{if $isRefundCompleted}
|
||||
<td>
|
||||
{displayPrice price=$product['refunded_amount'] currency=$orderCurrency['id']}
|
||||
</td>
|
||||
<td>
|
||||
{if $product['is_cancelled']}
|
||||
<span class="badge badge-danger">{l s='Cancelled' mod='hotelreservationsystem'}</span>
|
||||
{* used id_customization to check if in this request which bookings are refunded or not*}
|
||||
{else if $product['id_customization']}
|
||||
<span class="badge badge-success">{l s='Refunded' mod='hotelreservationsystem'}</span>
|
||||
{else}
|
||||
<span class="badge badge-danger">{l s='Denied' mod='hotelreservationsystem'}</span>
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
{block name='order_return_current_status'}
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
{/block}
|
||||
</div>
|
||||
{block name='displayRoomTypeDetailRoomTypeNameAfter'}
|
||||
{hook h='displayRoomTypeDetailRoomTypeNameAfter' id_product=$product->id}
|
||||
{hook h='displayRoomTypeDetailRoomTypeNameAfter' product=$product id_product=$product->id}
|
||||
{/block}
|
||||
{/block}
|
||||
</div>
|
||||
@@ -124,11 +124,11 @@
|
||||
{else}
|
||||
<span id="view_full_size">
|
||||
<img itemprop="image" src="{$img_prod_dir}{$lang_iso}-default-large_default.jpg" id="bigpic" alt="" title="{$product->name|escape:'html':'UTF-8'}" width="{$largeSize.width}" height="{$largeSize.height}"/>
|
||||
{if !$content_only}
|
||||
{* {if !$content_only}
|
||||
<span class="span_link">
|
||||
{l s='View larger'}
|
||||
</span>
|
||||
{/if}
|
||||
{/if} *}
|
||||
</span>
|
||||
{/if}
|
||||
{block name='displayRoomTypeImageAfter'}
|
||||
@@ -212,7 +212,7 @@
|
||||
<section class="page-product-box">
|
||||
{block name='product_tabs'}
|
||||
<ul class="nav nav-tabs product_description_tabs">
|
||||
<li class="active"><a href="#product_info_tab" class="idTabHrefShort" data-toggle="tab">{l s='Room Information'}</a></li>
|
||||
<li class="active"><a href="#product_info_tab" class="idTabHrefShort" data-toggle="tab">{if $product->booking_product}{l s='Room Information'}{else}{l s='Product Information'}{/if}</a></li>
|
||||
{* Block for booking products *}
|
||||
{if isset($id_hotel) && $id_hotel}
|
||||
<li><a href="#refund_policies_tab" class="idTabHrefShort" data-toggle="tab">{l s='Refund Policies'}</a></li>
|
||||
|
||||
418
themes/hotel-reservation-theme/shopping-cart-detail.tpl
Normal file
418
themes/hotel-reservation-theme/shopping-cart-detail.tpl
Normal file
@@ -0,0 +1,418 @@
|
||||
{*
|
||||
* Since 2010 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="order-detail-content">
|
||||
{if isset($cart_htl_data) && $cart_htl_data}
|
||||
{block name='shopping_cart_heading'}
|
||||
<p class="cart_section_title">{l s='rooms information'}</p>
|
||||
{/block}
|
||||
{foreach from=$cart_htl_data key=data_k item=data_v}
|
||||
{foreach from=$data_v['date_diff'] key=rm_k item=rm_v}
|
||||
<div class="row cart_product_line">
|
||||
<div class="col-sm-2 product-img-block">
|
||||
{block name='shopping_cart_room_type_cover_image'}
|
||||
<p>
|
||||
<a href="{$link->getProductLink($data_v['id_product'])}">
|
||||
<img src="{$data_v['cover_img']}" class="img-responsive" />
|
||||
</a>
|
||||
</p>
|
||||
<p class="room_remove_block">
|
||||
<a class="cart_room_delete" href="{$rm_v['link']}" data-id_product="{$data_v['id_product']}" data-date_from="{$rm_v['data_form']}" data-date_to="{$rm_v['data_to']}" data-qty="{$rm_v['num_rm']}"><i class="icon-trash"></i> {l s='Remove'}</a>
|
||||
</p>
|
||||
{block name='displayCartRoomImageAfter'}
|
||||
{hook h='displayCartRoomImageAfter' id_product=$data_v['id_product']}
|
||||
{/block}
|
||||
{/block}
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<div class="room-info-container">
|
||||
{block name='shopping_cart_room_type_cover_image_mobile'}
|
||||
<div class="product-xs-img">
|
||||
<a href="{$link->getProductLink($data_v['id_product'])}">
|
||||
<img src="{$data_v['cover_img']}" class="img-responsive" />
|
||||
</a>
|
||||
</div>
|
||||
{/block}
|
||||
{block name='shopping_cart_room_detail'}
|
||||
<div class="product-xs-info">
|
||||
{block name='shopping_cart_room_type_name'}
|
||||
<p class="product-name">
|
||||
<a href="{$link->getProductLink($data_v['id_product'])}">
|
||||
{$data_v['name']}
|
||||
</a>
|
||||
<a class="btn btn-default pull-right product-xs-remove" href="{$rm_v['link']}"><i class="icon-trash"></i></a>
|
||||
{block name='displayCartRoomTypeNameAfter'}
|
||||
{hook h='displayCartRoomTypeNameAfter' id_product=$data_v['id_product']}
|
||||
{/block}
|
||||
</p>
|
||||
{/block}
|
||||
{block name='shopping_cart_room_type_hotel_location'}
|
||||
{if isset($data_v['hotel_info']['location'])}
|
||||
<p class="hotel-location">
|
||||
<i class="icon-map-marker"></i> {$data_v['hotel_info']['location']}
|
||||
</p>
|
||||
{/if}
|
||||
{/block}
|
||||
{block name='displayCartRoomTypeInfo'}
|
||||
{hook h='displayCartRoomTypeInfo' id_product=$data_v['id_product']}
|
||||
{/block}
|
||||
</div>
|
||||
{/block}
|
||||
</div>
|
||||
{block name='shopping_cart_room_type_features'}
|
||||
{if isset($data_v['hotel_info']['room_features'])}
|
||||
<div class="room-type-features">
|
||||
{foreach $data_v['hotel_info']['room_features'] as $feature}
|
||||
<span class="room-type-feature">
|
||||
<img src="{$THEME_DIR}img/icon/form-ok-circle.svg" /> {$feature['name']}
|
||||
</span>
|
||||
{/foreach}
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
{block name='shopping_cart_room_type_booking_information'}
|
||||
{assign var="is_full_date" value=($show_full_date && ($rm_v['data_form']|date_format:'%D' == $rm_v['data_to']|date_format:'%D'))}
|
||||
<div class="room_duration_block">
|
||||
<div class="col-sm-3 col-xs-6">
|
||||
<p class="room_duration_block_head">{l s='CHECK IN'}</p>
|
||||
<p class="room_duration_block_value">{$rm_v['data_form']|date_format:"%d %b, %a"}{if $is_full_date} {$rm_v['data_form']|date_format:"%H:%M"}{/if}</p>
|
||||
</div>
|
||||
<div class="col-sm-3 col-xs-6">
|
||||
<p class="room_duration_block_head">{l s='CHECK OUT'}</p>
|
||||
<p class="room_duration_block_value">{$rm_v['data_to']|date_format:"%d %b, %a"}{if $is_full_date} {$rm_v['data_to']|date_format:"%H:%M"}{/if}</p>
|
||||
</div>
|
||||
<div class="col-sm-6 col-xs-6">
|
||||
<p class="room_duration_block_head">{l s='OCCUPANCY'}</p>
|
||||
<p class="room_duration_block_value">
|
||||
{if {$rm_v['adults']} <= 9}0{$rm_v['adults']}{else}{$rm_v['adults']}{/if} {if $rm_v['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $rm_v['children']}, {if $rm_v['children'] <= 9}0{$rm_v['children']}{else}{$rm_v['children']}{/if} {if $rm_v['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}, {if {$rm_v['num_rm']} <= 9}0{/if}{$rm_v['num_rm']}{if $rm_v['num_rm'] > 1} {l s='Rooms'}{else} {l s='Room'}{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name='shopping_cart_room_type_price_detail'}
|
||||
<div class="row room_price_detail_block">
|
||||
{block name='shopping_cart_room_type_and_service_price'}
|
||||
<div class="col-sm-7 margin-btm-sm-10">
|
||||
{if $rm_v['amount'] && isset($rm_v['total_price_without_discount']) && $rm_v['total_price_without_discount'] > $rm_v['amount']}
|
||||
<span class="room_type_old_price">
|
||||
{displayPrice price=$rm_v['total_price_without_discount']|floatval}
|
||||
</span>
|
||||
{/if}
|
||||
<div class="row">
|
||||
<div class="{if (isset($data_v['extra_demands']) && $data_v['extra_demands']) || (isset($data_v['service_products']) && $data_v['service_products'])}col-xs-6 plus-sign{else}col-xs-12{/if}">
|
||||
<div class="price_block">
|
||||
<p class="total_price">
|
||||
<span>
|
||||
{displayPrice price=($rm_v['amount'])}
|
||||
</span>
|
||||
{if (($rm_v['amount'] - $rm_v['amount_without_auto_add']) > 0) && (in_array($data_v['id_product'], $discounted_products) || $PS_ROOM_PRICE_AUTO_ADD_BREAKDOWN)}
|
||||
<span class="room-price-detail">
|
||||
<img src="{$img_dir}icon/icon-info.svg" />
|
||||
</span>
|
||||
<div class="room-price-detail-container" style="display: none;">
|
||||
<div class="room-price-detail-tooltip-cont">
|
||||
<div><label>{l s='Room price'}</label> : {displayPrice price=($rm_v['amount_without_auto_add'])}</div>
|
||||
<div><label>{l s='Additional charges'}</label> : {displayPrice price=($rm_v['amount'] - $rm_v['amount_without_auto_add'])}</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</p>
|
||||
<p class="total_price_detial">
|
||||
{l s='Total rooms price'} {if $display_tax_label}{if $priceDisplay} {l s='(Excl.'} {else}{l s='(Incl.)'}{/if} {l s='all taxes.)'}{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{if (isset($data_v['extra_demands']) && $data_v['extra_demands']) || (isset($data_v['service_products']) && $data_v['service_products'])}
|
||||
<div class="col-xs-6">
|
||||
<div class="demand_price_block">
|
||||
<p class="demand_total_price">
|
||||
<span>
|
||||
{displayPrice price=$rm_v['demand_price']}
|
||||
</span>
|
||||
</p>
|
||||
<p class="total_price_detial">
|
||||
<a data-date_from="{$rm_v['data_form']|escape:'html':'UTF-8'}" data-date_to="{$rm_v['data_to']|escape:'html':'UTF-8'}" data-id_product="{$data_v['id_product']|escape:'html':'UTF-8'}" data-action="{$link->getPageLink('order-opc')}" class="open_rooms_extra_services_panel" href="#rooms_type_extra_services_form">
|
||||
{l s='Extra Services'}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name='shopping_cart_room_type_total_price'}
|
||||
<div class="col-sm-5">
|
||||
<div class="total_price_block col-xs-12">
|
||||
<p class="total_price">
|
||||
<span>
|
||||
{displayPrice price=($rm_v['amount']+$rm_v['demand_price'])}
|
||||
</span>
|
||||
</p>
|
||||
<p class="total_price_detial">
|
||||
{l s='Total price for'} {$rm_v['num_days']} {l s='Night(s) stay'}{if $display_tax_label}{if $priceDisplay} {l s='(Excl.'} {else}{l s='(Incl.'}{/if} {l s='all taxes.)'}{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
</div>
|
||||
{/block}
|
||||
{block name='displayCartProductContentAfter'}
|
||||
{hook h='displayCartProductContentAfter' cart_detail=$data_v key=$rm_k}
|
||||
{/block}
|
||||
</div>
|
||||
</div>
|
||||
{block name='displayCartProductAfter'}
|
||||
{hook h='displayCartProductAfter' cart_detail=$data_v key=$rm_k}
|
||||
{/block}
|
||||
<hr>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{/if}
|
||||
{if (isset($hotel_products) && $hotel_products) || (isset($standalone_products) && $standalone_products)}
|
||||
<p class="cart_section_title">{l s='Product information'}</p>
|
||||
{/if}
|
||||
{if isset($hotel_products) && $hotel_products}
|
||||
{foreach from=$hotel_products key=data_k item=product}
|
||||
<div class="row cart_product_line">
|
||||
<div class="col-sm-2 product-img-block">
|
||||
<p>
|
||||
<a href="{$link->getProductLink($product['id_product'])}">
|
||||
<img src="{$product['cover_img']}" class="img-responsive" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p class="product_remove_block">
|
||||
<a id="{$product.id_product}_{if $product.id_service_product_option}{$product.id_service_product_option}{else}0{/if}_{if $product.id_hotel}{$product.id_hotel}{else}0{/if}" class="cart_quantity_delete" href="{$link->getPageLink('cart', true, NULL, "delete=1&id_product={$product.id_product|intval}&token={$token_cart}")|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Delete'}">
|
||||
<i class="icon-trash"></i> {l s='Remove'}
|
||||
</a>
|
||||
{* <a href="{$rm_v['link']}"><i class="icon-trash"></i> {l s='Remove'}</a> *}
|
||||
</p>
|
||||
{block name='displayCartProductImageAfter'}
|
||||
{hook h='displayCartProductImageAfter' id_product=$product['id_product']}
|
||||
{/block}
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<div class="product-info-container">
|
||||
<div class="product-xs-img">
|
||||
<a href="{$link->getProductLink($product['id_product'])}">
|
||||
<img src="{$product['cover_img']}" class="img-responsive" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="product-xs-info">
|
||||
<p class="product-name">
|
||||
<a href="{$link->getProductLink($product['id_product'])}">
|
||||
{$product['name']}{if isset($product['option_name']) && $product['option_name']} : {$product['option_name']}{/if}
|
||||
</a>
|
||||
<a class="btn btn-default pull-right product-xs-remove" href="{$link->getPageLink('cart', true, NULL, "delete=1&id_product={$product.id_product|intval}&ipa=0&id_address_delivery={$product.id_address_delivery}&token={$token_cart}")|escape:'html':'UTF-8'}"><i class="icon-trash"></i></a>
|
||||
{block name='displayCartProductNameAfter'}
|
||||
{hook h='displayCartProductNameAfter' id_product=$product['id_product']}
|
||||
{/block}
|
||||
</p>
|
||||
|
||||
{if isset($product['hotel_info']['location'])}
|
||||
<p class="hotel-location">
|
||||
<i class="icon-map-marker"></i> {$product['hotel_info']['location']}
|
||||
</p>
|
||||
{block name='displayCartProductHotelLocationAfter'}
|
||||
{hook h='displayCartProductHotelLocationAfter' id_product=$product['id_product']}
|
||||
{/block}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row product_price_detail_block">
|
||||
<div class="col-sm-4 col-xs-7">
|
||||
<div class="price_block">
|
||||
<p class="total_price">
|
||||
<span>
|
||||
{if $priceDisplay}{displayPrice price=($product['unit_price_tax_excl'])}{else}{displayPrice price=($product['unit_price_tax_incl'])}{/if}
|
||||
</span>
|
||||
</p>
|
||||
<p class="total_price_detial">
|
||||
{l s='Unit price'} {if $display_tax_label}{if $priceDisplay} {l s='(Excl.'} {else}{l s='(Incl.)'}{/if} {l s='all taxes.)'}{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3 col-xs-5">
|
||||
<div class="quantity_cont">
|
||||
<input type="hidden" value="{$product.quantity}" name="quantity_{$product.id_product}_{if $product.id_service_product_option}{$product.id_service_product_option}{else}0{/if}_{if $product.id_hotel}{$product.id_hotel}{else}0{/if}_hidden" />
|
||||
<input size="2" type="text" autocomplete="off" class="cart_quantity_input grey" value="{$product.quantity}" name="quantity_{$product.id_product}_{if $product.id_service_product_option}{$product.id_service_product_option}{else}0{/if}_{if $product.id_hotel}{$product.id_hotel}{else}0{/if}" />
|
||||
<div class="cart_quantity_button">
|
||||
<a rel="nofollow" class="cart_quantity_up btn btn-default" id="cart_quantity_up_{$product.id_product}_{if $product.id_service_product_option}{$product.id_service_product_option}{else}0{/if}_{if $product.id_hotel}{$product.id_hotel}{else}0{/if}" href="{$link->getPageLink('cart', true, NULL, "add=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery=0&token={$token_cart}")|escape:'html':'UTF-8'}" title="{l s='Add'}"><span><i class="icon-plus"></i></span></a>
|
||||
{if $product.minimal_quantity < ($product.quantity)}
|
||||
<a rel="nofollow" class="cart_quantity_down btn btn-default" id="cart_quantity_down_{$product.id_product}_{if $product.id_service_product_option}{$product.id_service_product_option}{else}0{/if}_{if $product.id_hotel}{$product.id_hotel}{else}0{/if}" href="{$link->getPageLink('cart', true, NULL, "add=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery=0&op=down&token={$token_cart}")|escape:'html':'UTF-8'}" title="{l s='Subtract'}">
|
||||
<span><i class="icon-minus"></i></span>
|
||||
</a>
|
||||
{else}
|
||||
<a class="cart_quantity_down btn btn-default disabled" href="#" id="cart_quantity_down_{$product.id_product}_{if $product.id_service_product_option}{$product.id_service_product_option}{else}0{/if}_{if $product.id_hotel}{$product.id_hotel}{else}0{/if}" title="{l s='You must purchase a minimum of %d of this product.' sprintf=1}">
|
||||
<span><i class="icon-minus"></i></span>
|
||||
</a>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{* <div class="product_quantity_block">
|
||||
<p class="">
|
||||
<span>
|
||||
{if $product['quantity'] <= 9}0{$product['quantity']}{else}{$product['quantity']}{/if}
|
||||
</span>
|
||||
</p>
|
||||
<p class="product_quantity_detial">
|
||||
{l s='Total Qty'}
|
||||
</p>
|
||||
</div> *}
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<div class="total_price_block col-xs-12">
|
||||
<p class="total_price">
|
||||
<span>
|
||||
{if $priceDisplay}{displayPrice price=($product['total_price_tax_excl'])}{else}{displayPrice price=($product['total_price_tax_incl'])}{/if}
|
||||
</span>
|
||||
</p>
|
||||
<p class="total_price_detial">
|
||||
{l s='Total price'} {if $display_tax_label}{if $priceDisplay} {l s='(Excl.'} {else}{l s='(Incl.)'}{/if} {l s='all taxes.)'}{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
{/foreach}
|
||||
{/if}
|
||||
{if isset($standalone_products) && $standalone_products}
|
||||
{foreach from=$standalone_products key=data_k item=product}
|
||||
<div class="row cart_product_line">
|
||||
<div class="col-sm-2 product-img-block">
|
||||
<p>
|
||||
<a href="{$link->getProductLink($product['id_product'])}">
|
||||
<img src="{$product['cover_img']}" class="img-responsive" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p class="product_remove_block">
|
||||
<a id="{$product.id_product}_{if $product.id_service_product_option}{$product.id_service_product_option}{else}0{/if}_0" class="cart_quantity_delete" href="{$link->getPageLink('cart', true, NULL, "delete=1&id_product={$product.id_product|intval}&token={$token_cart}")|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Delete'}">
|
||||
<i class="icon-trash"></i> {l s='Remove'}
|
||||
</a>
|
||||
{* <a href="{$rm_v['link']}"><i class="icon-trash"></i> {l s='Remove'}</a> *}
|
||||
</p>
|
||||
{block name='displayCartProductImageAfter'}
|
||||
{hook h='displayCartProductImageAfter' id_product=$product['id_product']}
|
||||
{/block}
|
||||
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<div class="product-info-container">
|
||||
<div class="product-xs-img">
|
||||
<a href="{$link->getProductLink($product['id_product'])}">
|
||||
<img src="{$product['cover_img']}" class="img-responsive" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="product-xs-info">
|
||||
<p class="product-name">
|
||||
<a href="{$link->getProductLink($product['id_product'])}">
|
||||
{$product['name']}{if isset($product['option_name']) && $product['option_name']} : {$product['option_name']}{/if}
|
||||
</a>
|
||||
<a class="btn btn-default pull-right product-xs-remove" href="{$link->getPageLink('cart', true, NULL, "delete=1&id_product={$product.id_product|intval}&token={$token_cart}")|escape:'html':'UTF-8'}"><i class="icon-trash"></i></a>
|
||||
{block name='displayCartProductNameAfter'}
|
||||
{hook h='displayCartProductNameAfter' id_product=$product['id_product']}
|
||||
{/block}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row product_price_detail_block">
|
||||
<div class="col-sm-4 col-xs-7">
|
||||
<div class="price_block">
|
||||
<p class="total_price">
|
||||
<span>
|
||||
{if $priceDisplay}{displayPrice price=($product['unit_price_tax_excl'])}{else}{displayPrice price=($product['unit_price_tax_incl'])}{/if}
|
||||
</span>
|
||||
</p>
|
||||
<p class="total_price_detial">
|
||||
{l s='Unit price'} {if $display_tax_label}{if $priceDisplay} {l s='(Excl.'} {else}{l s='(Incl.)'}{/if} {l s='all taxes.)'}{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3 col-xs-5">
|
||||
<div class="quantity_cont">
|
||||
<input type="hidden" value="{$product.quantity}" name="quantity_{$product.id_product}_{if $product.id_service_product_option}{$product.id_service_product_option}{else}0{/if}_0_hidden" />
|
||||
<input size="2" type="text" autocomplete="off" class="cart_quantity_input grey" value="{$product.quantity}" name="quantity_{$product.id_product}_{if $product.id_service_product_option}{$product.id_service_product_option}{else}0{/if}_0" />
|
||||
<div class="cart_quantity_button">
|
||||
<a rel="nofollow" class="cart_quantity_up btn btn-default" id="cart_quantity_up_{$product.id_product}_{if $product.id_service_product_option}{$product.id_service_product_option}{else}0{/if}_0" href="{$link->getPageLink('cart', true, NULL, "add=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery|intval}&token={$token_cart}")|escape:'html':'UTF-8'}" title="{l s='Add'}"><span><i class="icon-plus"></i></span></a>
|
||||
{if $product.minimal_quantity < ($product.quantity)}
|
||||
<a rel="nofollow" class="cart_quantity_down btn btn-default" id="cart_quantity_down_{$product.id_product}_{if $product.id_service_product_option}{$product.id_service_product_option}{else}0{/if}_0" href="{$link->getPageLink('cart', true, NULL, "add=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery|intval}&op=down&token={$token_cart}")|escape:'html':'UTF-8'}" title="{l s='Subtract'}">
|
||||
<span><i class="icon-minus"></i></span>
|
||||
</a>
|
||||
{else}
|
||||
<a class="cart_quantity_down btn btn-default disabled" href="#" id="cart_quantity_down_{$product.id_product}_{if $product.id_service_product_option}{$product.id_service_product_option}{else}0{/if}_0" title="{l s='You must purchase a minimum of %d of this product.' sprintf=$product.minimal_quantity}">
|
||||
<span><i class="icon-minus"></i></span>
|
||||
</a>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* <div class="product_quantity_block">
|
||||
<p class="">
|
||||
<span>
|
||||
{if $product['quantity'] <= 9}0{$product['quantity']}{else}{$product['quantity']}{/if}
|
||||
</span>
|
||||
</p>
|
||||
<p class="product_quantity_detial">
|
||||
{l s='Total Qty'}
|
||||
</p>
|
||||
</div> *}
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<div class="total_price_block col-xs-12">
|
||||
<p class="total_price">
|
||||
<span>
|
||||
{if $priceDisplay}{displayPrice price=($product['total_price_tax_excl'])}{else}{displayPrice price=($product['total_price_tax_incl'])}{/if}
|
||||
</span>
|
||||
</p>
|
||||
<p class="total_price_detial">
|
||||
{l s='Total price'} {if $display_tax_label}{if $priceDisplay} {l s='(Excl.'} {else}{l s='(Incl.)'}{/if} {l s='all taxes.)'}{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{block name='displayCartProductContainerBottom'}
|
||||
{hook h='displayCartProductContainerBottom' id_product=$product['id_product']}
|
||||
{/block}
|
||||
</div>
|
||||
<hr>
|
||||
{/foreach}
|
||||
{/if}
|
||||
|
||||
{* proceed only if no order restrict errors are there *}
|
||||
{if !$orderRestrictErr}
|
||||
{block name='shopping_cart_proceed_action'}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 proceed_btn_block">
|
||||
<a class="btn btn-default button button-medium pull-right" href="{$link->getPageLink('order-opc', null, null, ['proceed_to_customer_dtl' => 1])}" title="Proceed to checkout" rel="nofollow">
|
||||
<span>
|
||||
{l s='Proceed'}
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{/if}
|
||||
</div>
|
||||
@@ -50,307 +50,13 @@
|
||||
<p class="alert alert-warning">{l s='This store has not accepted your new order.'}</p>
|
||||
{else}
|
||||
<p id="emptyCartWarning" class="alert alert-warning unvisible">{l s='Your shopping cart is empty.'}</p>
|
||||
{if isset($lastProductAdded) AND $lastProductAdded}
|
||||
<div class="cart_last_product">
|
||||
<div class="cart_last_product_header">
|
||||
<div class="left">{l s='Last product added'}</div>
|
||||
</div>
|
||||
<a class="cart_last_product_img" href="{$link->getProductLink($lastProductAdded.id_product, $lastProductAdded.link_rewrite, $lastProductAdded.category, null, null, $lastProductAdded.id_shop)|escape:'html':'UTF-8'}">
|
||||
<img src="{$link->getImageLink($lastProductAdded.link_rewrite, $lastProductAdded.id_image, 'small_default')|escape:'html':'UTF-8'}" alt="{$lastProductAdded.name|escape:'html':'UTF-8'}"/>
|
||||
</a>
|
||||
<div class="cart_last_product_content">
|
||||
<p class="product-name">
|
||||
<a href="{$link->getProductLink($lastProductAdded.id_product, $lastProductAdded.link_rewrite, $lastProductAdded.category, null, null, null, $lastProductAdded.id_product_attribute)|escape:'html':'UTF-8'}">
|
||||
{$lastProductAdded.name|escape:'html':'UTF-8'}
|
||||
</a>
|
||||
</p>
|
||||
{if isset($lastProductAdded.attributes) && $lastProductAdded.attributes}
|
||||
<small>
|
||||
<a href="{$link->getProductLink($lastProductAdded.id_product, $lastProductAdded.link_rewrite, $lastProductAdded.category, null, null, null, $lastProductAdded.id_product_attribute)|escape:'html':'UTF-8'}">
|
||||
{$lastProductAdded.attributes|escape:'html':'UTF-8'}
|
||||
</a>
|
||||
</small>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{assign var='total_discounts_num' value="{if $total_discounts != 0}1{else}0{/if}"}
|
||||
{assign var='use_show_taxes' value="{if $use_taxes && $show_taxes}2{else}0{/if}"}
|
||||
{assign var='total_wrapping_taxes_num' value="{if $total_wrapping != 0}1{else}0{/if}"}
|
||||
{* eu-legal *}
|
||||
{block name='displayBeforeShoppingCartBlock'}
|
||||
{hook h="displayBeforeShoppingCartBlock"}
|
||||
{/block}
|
||||
|
||||
{block name='shopping_cart_detail'}
|
||||
<div class="order-detail-content">
|
||||
{if isset($cart_htl_data) && $cart_htl_data}
|
||||
{block name='shopping_cart_heading'}
|
||||
<p class="cart_section_title">{l s='rooms information'}</p>
|
||||
{/block}
|
||||
{foreach from=$cart_htl_data key=data_k item=data_v}
|
||||
{foreach from=$data_v['date_diff'] key=rm_k item=rm_v}
|
||||
<div class="row cart_product_line">
|
||||
<div class="col-sm-2 product-img-block">
|
||||
{block name='shopping_cart_room_type_cover_image'}
|
||||
<p>
|
||||
<a href="{$link->getProductLink($data_v['id_product'])}">
|
||||
<img src="{$data_v['cover_img']}" class="img-responsive" />
|
||||
</a>
|
||||
</p>
|
||||
<p class="room_remove_block">
|
||||
<a href="{$rm_v['link']}"><i class="icon-trash"></i> {l s='Remove'}</a>
|
||||
</p>
|
||||
{block name='displayCartRoomImageAfter'}
|
||||
{hook h='displayCartRoomImageAfter' id_product=$data_v['id_product']}
|
||||
{/block}
|
||||
{/block}
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<div class="room-info-container">
|
||||
{block name='shopping_cart_room_type_cover_image_mobile'}
|
||||
<div class="product-xs-img">
|
||||
<a href="{$link->getProductLink($data_v['id_product'])}">
|
||||
<img src="{$data_v['cover_img']}" class="img-responsive" />
|
||||
</a>
|
||||
</div>
|
||||
{/block}
|
||||
{block name='shopping_cart_room_detail'}
|
||||
<div class="product-xs-info">
|
||||
{block name='shopping_cart_room_type_name'}
|
||||
<p class="product-name">
|
||||
<a href="{$link->getProductLink($data_v['id_product'])}">
|
||||
{$data_v['name']}
|
||||
</a>
|
||||
<a class="btn btn-default pull-right product-xs-remove" href="{$rm_v['link']}"><i class="icon-trash"></i></a>
|
||||
{block name='displayCartRoomTypeNameAfter'}
|
||||
{hook h='displayCartRoomTypeNameAfter' id_product=$data_v['id_product']}
|
||||
{/block}
|
||||
</p>
|
||||
{/block}
|
||||
{block name='shopping_cart_room_type_hotel_location'}
|
||||
{if isset($data_v['hotel_info']['location'])}
|
||||
<p class="hotel-location">
|
||||
<i class="icon-map-marker"></i> {$data_v['hotel_info']['location']}
|
||||
</p>
|
||||
{/if}
|
||||
{/block}
|
||||
{block name='displayCartRoomTypeInfo'}
|
||||
{hook h='displayCartRoomTypeInfo' id_product=$data_v['id_product']}
|
||||
{/block}
|
||||
</div>
|
||||
{/block}
|
||||
</div>
|
||||
{block name='shopping_cart_room_type_features'}
|
||||
{if isset($data_v['hotel_info']['room_features'])}
|
||||
<div class="room-type-features">
|
||||
{foreach $data_v['hotel_info']['room_features'] as $feature}
|
||||
<span class="room-type-feature">
|
||||
<img src="{$THEME_DIR}img/icon/form-ok-circle.svg" /> {$feature['name']}
|
||||
</span>
|
||||
{/foreach}
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
{block name='shopping_cart_room_type_booking_information'}
|
||||
{assign var="is_full_date" value=($show_full_date && ($rm_v['data_form']|date_format:'%D' == $rm_v['data_to']|date_format:'%D'))}
|
||||
<div class="room_duration_block">
|
||||
<div class="col-sm-3 col-xs-6">
|
||||
<p class="room_duration_block_head">{l s='CHECK IN'}</p>
|
||||
<p class="room_duration_block_value">{$rm_v['data_form']|date_format:"%d %b, %a"}{if $is_full_date} {$rm_v['data_form']|date_format:"%H:%M"}{/if}</p>
|
||||
</div>
|
||||
<div class="col-sm-3 col-xs-6">
|
||||
<p class="room_duration_block_head">{l s='CHECK OUT'}</p>
|
||||
<p class="room_duration_block_value">{$rm_v['data_to']|date_format:"%d %b, %a"}{if $is_full_date} {$rm_v['data_to']|date_format:"%H:%M"}{/if}</p>
|
||||
</div>
|
||||
<div class="col-sm-6 col-xs-6">
|
||||
<p class="room_duration_block_head">{l s='OCCUPANCY'}</p>
|
||||
<p class="room_duration_block_value">
|
||||
{if {$rm_v['adults']} <= 9}0{$rm_v['adults']}{else}{$rm_v['adults']}{/if} {if $rm_v['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $rm_v['children']}, {if $rm_v['children'] <= 9}0{$rm_v['children']}{else}{$rm_v['children']}{/if} {if $rm_v['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}, {if {$rm_v['num_rm']} <= 9}0{/if}{$rm_v['num_rm']}{if $rm_v['num_rm'] > 1} {l s='Rooms'}{else} {l s='Room'}{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name='shopping_cart_room_type_price_detail'}
|
||||
<div class="row room_price_detail_block">
|
||||
{block name='shopping_cart_room_type_and_service_price'}
|
||||
<div class="col-sm-7 margin-btm-sm-10">
|
||||
{if $rm_v['amount'] && isset($rm_v['total_price_without_discount']) && $rm_v['total_price_without_discount'] > $rm_v['amount']}
|
||||
<span class="room_type_old_price">
|
||||
{displayPrice price=$rm_v['total_price_without_discount']|floatval}
|
||||
</span>
|
||||
{/if}
|
||||
<div class="row">
|
||||
<div class="{if (isset($data_v['extra_demands']) && $data_v['extra_demands']) || (isset($data_v['service_products']) && $data_v['service_products'])}col-xs-6 plus-sign{else}col-xs-12{/if}">
|
||||
<div class="price_block">
|
||||
<p class="total_price">
|
||||
<span>
|
||||
{displayPrice price=($rm_v['amount'])}
|
||||
</span>
|
||||
{if (($rm_v['amount'] - $rm_v['amount_without_auto_add']) > 0) && (in_array($data_v['id_product'], $discounted_products) || $PS_ROOM_PRICE_AUTO_ADD_BREAKDOWN)}
|
||||
<span class="room-price-detail">
|
||||
<img src="{$img_dir}icon/icon-info.svg" />
|
||||
</span>
|
||||
<div class="room-price-detail-container" style="display: none;">
|
||||
<div class="room-price-detail-tooltip-cont">
|
||||
<div><label>{l s='Room price'}</label> : {displayPrice price=($rm_v['amount_without_auto_add'])}</div>
|
||||
<div><label>{l s='Additional charges'}</label> : {displayPrice price=($rm_v['amount'] - $rm_v['amount_without_auto_add'])}</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</p>
|
||||
<p class="total_price_detial">
|
||||
{l s='Total rooms price'} {if $display_tax_label}{if $priceDisplay} {l s='(Excl.'} {else}{l s='(Incl.)'}{/if} {l s='all taxes.)'}{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{if (isset($data_v['extra_demands']) && $data_v['extra_demands']) || (isset($data_v['service_products']) && $data_v['service_products'])}
|
||||
<div class="col-xs-6">
|
||||
<div class="demand_price_block">
|
||||
<p class="demand_total_price">
|
||||
<span>
|
||||
{displayPrice price=$rm_v['demand_price']}
|
||||
</span>
|
||||
</p>
|
||||
<p class="total_price_detial">
|
||||
<a data-date_from="{$rm_v['data_form']|escape:'html':'UTF-8'}" data-date_to="{$rm_v['data_to']|escape:'html':'UTF-8'}" data-id_product="{$data_v['id_product']|escape:'html':'UTF-8'}" data-action="{$link->getPageLink('order-opc')}" class="open_rooms_extra_services_panel" href="#rooms_type_extra_services_form">
|
||||
{l s='Extra Services'}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name='shopping_cart_room_type_total_price'}
|
||||
<div class="col-sm-5">
|
||||
<div class="total_price_block col-xs-12">
|
||||
<p class="total_price">
|
||||
<span>
|
||||
{displayPrice price=($rm_v['amount']+$rm_v['demand_price'])}
|
||||
</span>
|
||||
</p>
|
||||
<p class="total_price_detial">
|
||||
{l s='Total price for'} {$rm_v['num_days']} {l s='Night(s) stay'}{if $display_tax_label}{if $priceDisplay} {l s='(Excl.'} {else}{l s='(Incl.'}{/if} {l s='all taxes.)'}{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
</div>
|
||||
{/block}
|
||||
{block name='displayCartProductContentAfter'}
|
||||
{hook h='displayCartProductContentAfter' cart_detail=$data_v key=$rm_k}
|
||||
{/block}
|
||||
</div>
|
||||
</div>
|
||||
{block name='displayCartProductAfter'}
|
||||
{hook h='displayCartProductAfter' cart_detail=$data_v key=$rm_k}
|
||||
{/block}
|
||||
<hr>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{/if}
|
||||
{if isset($cart_normal_data) && $cart_normal_data}
|
||||
<p class="cart_section_title">{l s='service product information'}</p>
|
||||
{foreach from=$cart_normal_data key=data_k item=product}
|
||||
<div class="row cart_product_line">
|
||||
<div class="col-sm-2 product-img-block">
|
||||
<p>
|
||||
<a href="{$link->getProductLink($product['id_product'])}">
|
||||
<img src="{$product['cover_img']}" class="img-responsive" />
|
||||
</a>
|
||||
</p>
|
||||
<p class="product_remove_block">
|
||||
<a id="{$product.id_product}_{$product.id_hotel}" class="cart_quantity_delete" href="{$link->getPageLink('cart', true, NULL, "delete=1&id_product={$product.id_product|intval}&token={$token_cart}")|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Delete'}">
|
||||
<i class="icon-trash"></i> {l s='Remove'}
|
||||
</a>
|
||||
{* <a href="{$rm_v['link']}"><i class="icon-trash"></i> {l s='Remove'}</a> *}
|
||||
</p>
|
||||
{block name='displayCartProductImageAfter'}
|
||||
{hook h='displayCartProductImageAfter' id_product=$product['id_product']}
|
||||
{/block}
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<div class="product-info-container">
|
||||
<div class="product-xs-img">
|
||||
<a href="{$link->getProductLink($product['id_product'])}">
|
||||
<img src="{$product['cover_img']}" class="img-responsive" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="product-xs-info">
|
||||
<p class="product-name">
|
||||
<a href="{$link->getProductLink($product['id_product'])}">
|
||||
{$product['name']}
|
||||
</a>
|
||||
<a class="btn btn-default pull-right product-xs-remove" href="{$link->getPageLink('cart', true, NULL, "delete=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery}&token={$token_cart}")|escape:'html':'UTF-8'}"><i class="icon-trash"></i></a>
|
||||
</p>
|
||||
{if isset($product['hotel_info']['location'])}
|
||||
<p class="hotel-location">
|
||||
<i class="icon-map-marker"></i> {$product['hotel_info']['location']}
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row product_price_detail_block">
|
||||
<div class="col-sm-4">
|
||||
<div class="price_block">
|
||||
<p class="total_price">
|
||||
<span>
|
||||
{if $priceDisplay}{displayPrice price=($product['unit_price_tax_excl'])}{else}{displayPrice price=($product['unit_price_tax_incl'])}{/if}
|
||||
</span>
|
||||
</p>
|
||||
<p class="total_price_detial">
|
||||
{l s='Unit price'} {if $display_tax_label}{if $priceDisplay} {l s='(Excl.'} {else}{l s='(Incl.)'}{/if} {l s='all taxes.)'}{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="product_quantity_block">
|
||||
<p class="">
|
||||
<span>
|
||||
{if $product['quantity'] <= 9}0{$product['quantity']}{else}{$product['quantity']}{/if}
|
||||
</span>
|
||||
</p>
|
||||
<p class="product_quantity_detial">
|
||||
{l s='Total Qty'}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="total_price_block pull-right">
|
||||
<p class="total_price">
|
||||
<span>
|
||||
{if $priceDisplay}{displayPrice price=($product['total_price_tax_excl'])}{else}{displayPrice price=($product['total_price_tax_incl'])}{/if}
|
||||
</span>
|
||||
</p>
|
||||
<p class="total_price_detial">
|
||||
{l s='Total price'} {if $display_tax_label}{if $priceDisplay} {l s='(Excl.'} {else}{l s='(Incl.)'}{/if} {l s='all taxes.)'}{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
{/foreach}
|
||||
{/if}
|
||||
|
||||
{* proceed only if no order restrict errors are there *}
|
||||
{if !$orderRestrictErr}
|
||||
{block name='shopping_cart_proceed_action'}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 proceed_btn_block">
|
||||
<a class="btn btn-default button button-medium pull-right" href="{$link->getPageLink('order-opc', null, null, ['proceed_to_customer_dtl' => 1])}" title="Proceed to checkout" rel="nofollow">
|
||||
<span>
|
||||
{l s='Proceed'}
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{/if}
|
||||
</div>
|
||||
{include file="$tpl_dir./shopping-cart-detail.tpl"}
|
||||
{/block}
|
||||
|
||||
{if $show_option_allow_separate_package}
|
||||
@@ -362,101 +68,10 @@
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
{* Define the style if it doesn't exist in the PrestaShop version*}
|
||||
{* Will be deleted for 1.5 version and more *}
|
||||
{if !isset($addresses_style)}
|
||||
{$addresses_style.company = 'address_company'}
|
||||
{$addresses_style.firstname = 'address_name'}
|
||||
{$addresses_style.lastname = 'address_name'}
|
||||
{$addresses_style.address1 = 'address_address1'}
|
||||
{$addresses_style.address2 = 'address_address2'}
|
||||
{$addresses_style.city = 'address_city'}
|
||||
{$addresses_style.country = 'address_country'}
|
||||
{$addresses_style.phone = 'address_phone'}
|
||||
{$addresses_style.phone_mobile = 'address_phone_mobile'}
|
||||
{$addresses_style.alias = 'address_title'}
|
||||
{/if}
|
||||
{if !$advanced_payment_api && ((!empty($delivery_option) && (!isset($isVirtualCart) || !$isVirtualCart)) OR $delivery->id || $invoice->id) && !$opc}
|
||||
<div class="order_delivery clearfix row">
|
||||
{if !isset($formattedAddresses) || (count($formattedAddresses.invoice) == 0 && count($formattedAddresses.delivery) == 0) || (count($formattedAddresses.invoice.formated) == 0 && count($formattedAddresses.delivery.formated) == 0)}
|
||||
{if $delivery->id}
|
||||
<div class="col-xs-12 col-sm-6"{if !$have_non_virtual_products} style="display: none;"{/if}>
|
||||
<ul id="delivery_address" class="address item box">
|
||||
<li><h3 class="page-subheading">{l s='Delivery address'} <span class="address_alias">({$delivery->alias})</span></h3></li>
|
||||
{if $delivery->company}<li class="address_company">{$delivery->company|escape:'html':'UTF-8'}</li>{/if}
|
||||
<li class="address_name">{$delivery->firstname|escape:'html':'UTF-8'} {$delivery->lastname|escape:'html':'UTF-8'}</li>
|
||||
<li class="address_address1">{$delivery->address1|escape:'html':'UTF-8'}</li>
|
||||
{if $delivery->address2}<li class="address_address2">{$delivery->address2|escape:'html':'UTF-8'}</li>{/if}
|
||||
<li class="address_city">{$delivery->postcode|escape:'html':'UTF-8'} {$delivery->city|escape:'html':'UTF-8'}</li>
|
||||
<li class="address_country">{$delivery->country|escape:'html':'UTF-8'} {if $delivery_state}({$delivery_state|escape:'html':'UTF-8'}){/if}</li>
|
||||
</ul>
|
||||
</div>
|
||||
{/if}
|
||||
{if $invoice->id}
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<ul id="invoice_address" class="address alternate_item box">
|
||||
<li><h3 class="page-subheading">{l s='Invoice address'} <span class="address_alias">({$invoice->alias})</span></h3></li>
|
||||
{if $invoice->company}<li class="address_company">{$invoice->company|escape:'html':'UTF-8'}</li>{/if}
|
||||
<li class="address_name">{$invoice->firstname|escape:'html':'UTF-8'} {$invoice->lastname|escape:'html':'UTF-8'}</li>
|
||||
<li class="address_address1">{$invoice->address1|escape:'html':'UTF-8'}</li>
|
||||
{if $invoice->address2}<li class="address_address2">{$invoice->address2|escape:'html':'UTF-8'}</li>{/if}
|
||||
<li class="address_city">{$invoice->postcode|escape:'html':'UTF-8'} {$invoice->city|escape:'html':'UTF-8'}</li>
|
||||
<li class="address_country">{$invoice->country|escape:'html':'UTF-8'} {if $invoice_state}({$invoice_state|escape:'html':'UTF-8'}){/if}</li>
|
||||
</ul>
|
||||
</div>
|
||||
{/if}
|
||||
{else}
|
||||
{foreach from=$formattedAddresses key=k item=address}
|
||||
<div class="col-xs-12 col-sm-6"{if $k == 'delivery' && !$have_non_virtual_products} style="display: none;"{/if}>
|
||||
<ul class="address {if $address@last}last_item{elseif $address@first}first_item{/if} {if $address@index % 2}alternate_item{else}item{/if} box">
|
||||
<li>
|
||||
<h3 class="page-subheading">
|
||||
{if $k eq 'invoice'}
|
||||
{l s='Invoice address'}
|
||||
{elseif $k eq 'delivery' && $delivery->id}
|
||||
{l s='Delivery address'}
|
||||
{/if}
|
||||
{if isset($address.object.alias)}
|
||||
<span class="address_alias">({$address.object.alias})</span>
|
||||
{/if}
|
||||
</h3>
|
||||
</li>
|
||||
{foreach $address.ordered as $pattern}
|
||||
{assign var=addressKey value=" "|explode:$pattern}
|
||||
{assign var=addedli value=false}
|
||||
{foreach from=$addressKey item=key name=foo}
|
||||
{$key_str = $key|regex_replace:AddressFormat::_CLEANING_REGEX_:""}
|
||||
{if isset($address.formated[$key_str]) && !empty($address.formated[$key_str])}
|
||||
{if (!$addedli)}
|
||||
{$addedli = true}
|
||||
<li><span class="{if isset($addresses_style[$key_str])}{$addresses_style[$key_str]}{/if}">
|
||||
{/if}
|
||||
{$address.formated[$key_str]|escape:'html':'UTF-8'}
|
||||
{/if}
|
||||
{if ($smarty.foreach.foo.last && $addedli)}
|
||||
</span></li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{block name='displayShoppingCartFooter'}
|
||||
<div id="HOOK_SHOPPING_CART">{$HOOK_SHOPPING_CART}</div>
|
||||
{/block}
|
||||
{* <p class="cart_navigation clearfix">
|
||||
{if !$opc}
|
||||
<a href="{if $back}{$link->getPageLink('order', true, NULL, 'step=1&back={$back}')|escape:'html':'UTF-8'}{else}{$link->getPageLink('order', true, NULL, 'step=1')|escape:'html':'UTF-8'}{/if}" class="button btn btn-default standard-checkout button-medium" title="{l s='Proceed to checkout'}">
|
||||
<span>{l s='Proceed to checkout'}<i class="icon-chevron-right right"></i></span>
|
||||
</a>
|
||||
{/if}
|
||||
<a href="{if (isset($smarty.server.HTTP_REFERER) && ($smarty.server.HTTP_REFERER == $link->getPageLink('order', true) || $smarty.server.HTTP_REFERER == $link->getPageLink('order-opc', true) || strstr($smarty.server.HTTP_REFERER, 'step='))) || !isset($smarty.server.HTTP_REFERER)}{$link->getPageLink('index')}{else}{$smarty.server.HTTP_REFERER|escape:'html':'UTF-8'|secureReferrer}{/if}" class="button-exclusive btn btn-default" title="{l s='Continue shopping'}">
|
||||
<i class="icon-chevron-left"></i>{l s='Continue shopping'}
|
||||
</a>
|
||||
</p> *}
|
||||
|
||||
<div class="clear"></div>
|
||||
<div class="cart_navigation_extra">
|
||||
{block name='displayShoppingCart'}
|
||||
@@ -475,14 +90,5 @@
|
||||
{* Fancybox for extra demands*}
|
||||
{block name='shopping_cart_extra_services'}
|
||||
<div style="display:none;" id="rooms_extra_services">
|
||||
{* <div id="rooms_type_extra_services"> *}
|
||||
{* <div class="panel">
|
||||
<div class="rooms_extra_demands_head">
|
||||
<h3>{l s='Additional Facilities'}</h3>
|
||||
<p class="rooms_extra_demands_text">{l s='Add below additional facilities to the rooms for better hotel experience'}</p>
|
||||
</div>
|
||||
<div id="room_type_demands_desc"></div>
|
||||
</div> *}
|
||||
{* </div> *}
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
Reference in New Issue
Block a user