Resolved: confliects with develop branch of hotelcommerce
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -167,6 +167,8 @@ img/**
|
||||
!/override/classes/index.php
|
||||
!/override/classes/cache/
|
||||
!/override/classes/cache/index.php
|
||||
!/override/classes/checkoutProcess/
|
||||
!/override/classes/checkoutProcess/index.php
|
||||
!/override/classes/controller/
|
||||
!/override/classes/controller/index.php
|
||||
!/override/classes/db/
|
||||
|
||||
@@ -43,7 +43,8 @@ class Adapter_ProductPriceCalculator
|
||||
$with_ecotax = true,
|
||||
$use_group_reduction = true,
|
||||
Context $context = null,
|
||||
$use_customer_price = true
|
||||
$use_customer_price = true,
|
||||
$id_roomtype = false
|
||||
) {
|
||||
return Product::getPriceStatic(
|
||||
$id_product,
|
||||
@@ -62,7 +63,8 @@ class Adapter_ProductPriceCalculator
|
||||
$with_ecotax,
|
||||
$use_group_reduction,
|
||||
$context,
|
||||
$use_customer_price
|
||||
$use_customer_price,
|
||||
$id_roomtype
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
48
LICENSE.md
Normal file
48
LICENSE.md
Normal file
@@ -0,0 +1,48 @@
|
||||
|
||||
Open Software License ("OSL") v. 3.0
|
||||
|
||||
This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
|
||||
|
||||
Licensed under the Open Software License version 3.0
|
||||
|
||||
1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
|
||||
|
||||
1. to reproduce the Original Work in copies, either alone or as part of a collective work;
|
||||
|
||||
2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
|
||||
|
||||
3. to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License;
|
||||
|
||||
4. to perform the Original Work publicly; and
|
||||
|
||||
5. to display the Original Work publicly.
|
||||
|
||||
2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
|
||||
|
||||
3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
|
||||
|
||||
4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
|
||||
|
||||
5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
|
||||
|
||||
6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
|
||||
|
||||
7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
|
||||
|
||||
8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
|
||||
|
||||
9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
|
||||
|
||||
10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
|
||||
|
||||
11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
|
||||
|
||||
12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
|
||||
|
||||
13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
|
||||
|
||||
14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
|
||||
|
||||
16. Modification of This License. This License is Copyright (C) 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
|
||||
@@ -76,7 +76,11 @@ docker pull webkul/qloapps_docker
|
||||
|
||||
### License
|
||||
|
||||
QloApps is a truly opensource Hotel-Commerce platform which is under the [Open Software License 3.0](https://github.com/webkul/hotelcommerce/blob/develop/LICENSE).
|
||||
QloApps Core is licensed under OSL-3.0 and Modules authored by Webkul have their applicable license, LICENSE.md, kept inside their root directories, while other modules are licensed under AFL-3.0.
|
||||
|
||||
The online copy of OSL-3.0 can be found at [https://opensource.org/licenses/OSL-3.0](https://opensource.org/licenses/OSL-3.0).
|
||||
|
||||
The online copy of AFL-3.0 can be found at [https://opensource.org/licenses/AFL-3.0](https://opensource.org/licenses/AFL-3.0).
|
||||
|
||||
### Security Vulnerabilities
|
||||
|
||||
|
||||
@@ -168,58 +168,15 @@ Tree.prototype =
|
||||
|
||||
expandAll : function($speed)
|
||||
{
|
||||
var idTree = this.$element.parent().find('.cattree.tree').first().attr('id');
|
||||
if (typeof(idTree) != 'undefined' && !$('#'+idTree).hasClass('full_loaded'))
|
||||
{
|
||||
var selected = [];
|
||||
that = this;
|
||||
$('#'+idTree).find('.tree-selected input').each(
|
||||
function()
|
||||
{
|
||||
selected.push($(this).val());
|
||||
}
|
||||
);
|
||||
var name = $('#'+idTree).find('ul.tree input').first().attr('name');
|
||||
var inputType = $('#'+idTree).find('ul.tree input').first().attr('type');
|
||||
var useCheckBox = 0;
|
||||
if (inputType == 'checkbox')
|
||||
this.$element.find("label.tree-toggler").each(
|
||||
function()
|
||||
{
|
||||
useCheckBox = 1;
|
||||
$(this).parent().children(".icon-folder-close")
|
||||
.removeClass("icon-folder-close")
|
||||
.addClass("icon-folder-open");
|
||||
$(this).parent().parent().children("ul.tree").show($speed);
|
||||
}
|
||||
|
||||
$.get(
|
||||
'ajax-tab.php',
|
||||
{controller:'AdminProducts',token:currentToken,action:'getCategoryTree',type:idTree,fullTree:1,selected:selected, inputName:name,useCheckBox:useCheckBox},
|
||||
function(content)
|
||||
{
|
||||
$('#' + idTree).html(content);
|
||||
organizeTree();
|
||||
$('#' + idTree).tree('init');
|
||||
that.$element.find("label.tree-toggler").each(
|
||||
function()
|
||||
{
|
||||
$(this).parent().children(".icon-folder-close")
|
||||
.removeClass("icon-folder-close")
|
||||
.addClass("icon-folder-open");
|
||||
$(this).parent().parent().children("ul.tree").show($speed);
|
||||
$('#'+idTree).addClass('full_loaded');
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$element.find("label.tree-toggler").each(
|
||||
function()
|
||||
{
|
||||
$(this).parent().children(".icon-folder-close")
|
||||
.removeClass("icon-folder-close")
|
||||
.addClass("icon-folder-open");
|
||||
$(this).parent().parent().children("ul.tree").show($speed);
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
return $(this);
|
||||
}
|
||||
|
||||
@@ -3,3 +3,16 @@
|
||||
|
||||
#customization_list
|
||||
border: 0px
|
||||
|
||||
.booking_occupancy
|
||||
.booking_occupancy_wrapper
|
||||
max-height: 250px
|
||||
overflow-x: auto
|
||||
|
||||
#booking-documents-modal
|
||||
.documents-list
|
||||
table
|
||||
tbody
|
||||
img
|
||||
max-height: 55px
|
||||
max-width: 55px
|
||||
|
||||
@@ -206,4 +206,13 @@
|
||||
cursor: pointer
|
||||
|
||||
#recommendation-wrapper
|
||||
margin-bottom: 20px
|
||||
margin-bottom: 20px
|
||||
|
||||
//list column selection
|
||||
#optional-list-toggle
|
||||
font-family: "Open Sans",Helvetica,Arial,sans-serif
|
||||
font-size: 13px
|
||||
padding: 8px 12px
|
||||
text-transform: none
|
||||
label
|
||||
font-weight: 400
|
||||
@@ -106,6 +106,8 @@ body
|
||||
text-align: center
|
||||
font-size: 18px
|
||||
line-height: 30px
|
||||
.dropdown-menu
|
||||
line-height: normal
|
||||
.panel-danger .panel-heading
|
||||
background-color: $badge-notif-color!important
|
||||
form .alert
|
||||
|
||||
@@ -148,6 +148,8 @@ tr.highlighted td
|
||||
|
||||
.date_range .input-group:first-child
|
||||
margin-bottom: 5px
|
||||
.input_range > :first-child
|
||||
margin-bottom: 5px
|
||||
|
||||
@media (max-width: $screen-sm-max)
|
||||
.table-responsive-row
|
||||
|
||||
87
admin/themes/default/template/alerts.tpl
Normal file
87
admin/themes/default/template/alerts.tpl
Normal file
@@ -0,0 +1,87 @@
|
||||
{*
|
||||
* 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($conf)}
|
||||
<div class="bootstrap">
|
||||
<div class="alert alert-success">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
{$conf}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($errors) && count($errors) && current($errors) != '' && (!isset($disableDefaultErrorOutPut) || $disableDefaultErrorOutPut == false)}
|
||||
<div class="bootstrap">
|
||||
<div class="alert alert-danger">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
{if count($errors) == 1}
|
||||
{reset($errors)}
|
||||
{else }
|
||||
{l s='%d errors' sprintf=$errors|count}
|
||||
<br/>
|
||||
<ol>
|
||||
{foreach $errors as $error}
|
||||
<li>{$error}</li>
|
||||
{/foreach}
|
||||
</ol>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($informations) && count($informations) && $informations}
|
||||
<div class="bootstrap">
|
||||
<div class="alert alert-info">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<ul id="infos_block" class="list-unstyled">
|
||||
{foreach $informations as $info}
|
||||
<li>{$info}</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($confirmations) && count($confirmations) && $confirmations}
|
||||
<div class="bootstrap">
|
||||
<div class="alert alert-success" style="display:block;">
|
||||
{foreach $confirmations as $conf}
|
||||
{$conf}
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($warnings) && count($warnings)}
|
||||
<div class="bootstrap">
|
||||
<div class="alert alert-warning">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
{if count($warnings) > 1}
|
||||
<h4>{l s='There are %d warnings:' sprintf=count($warnings)}</h4>
|
||||
{/if}
|
||||
<ul class="list-unstyled">
|
||||
{foreach $warnings as $warning}
|
||||
<li>{$warning}</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -26,6 +26,10 @@
|
||||
{extends file="helpers/form/form.tpl"}
|
||||
|
||||
{block name="label"}
|
||||
{if $input.name == 'vat_number'}
|
||||
<div id="vat_area" style="display: visible">
|
||||
{/if}
|
||||
|
||||
{if $input.type == 'text_customer' && !isset($customer)}
|
||||
<label class="control-label col-lg-3 required" for="email">{l s='Customer email'}</label>
|
||||
{else}
|
||||
@@ -90,4 +94,7 @@
|
||||
{else}
|
||||
{$smarty.block.parent}
|
||||
{/if}
|
||||
{if $input.name == 'vat_number'}
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
{else}
|
||||
<h2>{l s='No order was created from this cart.'}</h2>
|
||||
{if $customer->id}
|
||||
<a class="btn btn-default" href="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&id_cart={$cart->id|intval}&addorder"><i class="icon-shopping-cart"></i> {l s='Create an order from this cart.'}</a>
|
||||
<a class="btn btn-default" href="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&cart_id={$cart->id|intval}&addorder"><i class="icon-shopping-cart"></i> {l s='Create an order from this cart.'}</a>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
@@ -87,52 +87,179 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="fixed-width-xs"><span class="title_box">{l s='Image'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Room Type'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Unit Price'}</span></th>
|
||||
<th><span class="title_box">{l s='Room Type'}</span></th>
|
||||
<th><span class="title_box">{l s='Hotel'}</span></th>
|
||||
<th><span class="title_box">{l s='Duration'}</span></th>
|
||||
<th><span class="title_box">{l s='occupancy'}</span></th>
|
||||
<th><span class="title_box">{l s='Room price'}</span></th>
|
||||
<th><span class="title_box">{l s='Extra services'}</span></th>
|
||||
<th class="text-right"><span class="title_box">{l s='Total'}</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$products item='product'}
|
||||
{foreach from=$cart_htl_data item='room'}
|
||||
<tr>
|
||||
<td>{$product.image}</td>
|
||||
<td class="text-center">
|
||||
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&id_product={$product.id_product}&updateproduct">
|
||||
<span class="productName">{$product.name}</span>{if isset($product.attributes)}<br />{$product.attributes}{/if}<br />
|
||||
{if $product.reference}{l s='Ref:'} {$product.reference}{/if}
|
||||
{if $product.reference && $product.supplier_reference} / {$product.supplier_reference}{/if}
|
||||
<td><img src="{$room['image_link']}" class="img-responsive" /></td>
|
||||
<td>
|
||||
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&id_product={$room['id_product']}&updateproduct">
|
||||
<span class="productName">{$room['room_type']}</span>
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center">{displayWtPriceWithCurrency price=$product.product_price currency=$currency}</td>
|
||||
<td class="text-right">{displayWtPriceWithCurrency price=$product.product_total currency=$currency}</td>
|
||||
<td><a href="{$link->getAdminLink('AdminAddHotel')|escape:'html':'UTF-8'}&id={$room['id_hotel']}&updatehtl_branch_info">{$room['room_type_info'].hotel_name}</a></td>
|
||||
<td>{dateFormat date=$room['date_from']} - {dateFormat date=$room['date_to']}</td>
|
||||
<td>
|
||||
<span>
|
||||
{if $room['adults']}{$room['adults']}{/if} {if $room['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$room['children']}}, {$room['children']} {if $room['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
|
||||
</span>
|
||||
</td>
|
||||
<td>{displayWtPriceWithCurrency price=$room['feature_price_tax_excl'] currency=$currency}</td>
|
||||
<td>
|
||||
{if (isset($room['extra_demands']) && $room['extra_demands']) || (isset($room['additional_service']) && $room['additional_service'])}
|
||||
<a href="#" data-toggle="modal" data-target="#rooms_type_extra_demands_{$room['id']}">
|
||||
{displayWtPriceWithCurrency price=($room['demand_price'] + $room['additional_service_price'] + $room['additional_services_auto_add_price'])|escape:'html':'UTF-8' currency=$currency}
|
||||
</a>
|
||||
{else}
|
||||
{displayWtPriceWithCurrency price=0 currency=$currency}
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-right">
|
||||
{if (isset($room['extra_demands']) && $room['extra_demands']) || (isset($room['additional_service']) && $room['additional_service'])}
|
||||
{displayWtPriceWithCurrency price=($room['amt_with_qty'] + $room['additional_services_auto_add_price'] + $room['demand_price'] + $room['additional_service_price'])|escape:'html':'UTF-8' currency=$currency}
|
||||
{else}
|
||||
{displayWtPriceWithCurrency price=$room['amt_with_qty']|escape:'html':'UTF-8' currency=$currency}
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<div class="modal" tabindex="-1" role="dialog" id="rooms_type_extra_demands_{$room['id']}">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body" id="rooms_extra_demands">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
{if isset($room['selected_demands']) && $room['selected_demands']}
|
||||
<li role="presentation" class="active"><a href="#room_type_demands_desc_{$room['id']}" aria-controls="facilities" role="tab" data-toggle="tab">{l s='Facilities'}</a></li>
|
||||
{/if}
|
||||
{if isset($room['selected_services']) && $room['selected_services']}
|
||||
<li role="presentation" {if !isset($room['selected_demands']) || !$room['selected_demands']}class="active"{/if}><a href="#room_type_service_product_desc_{$room['id']}" aria-controls="services" role="tab" data-toggle="tab">{l s='Services'}</a></li>
|
||||
{/if}
|
||||
</ul>
|
||||
<div class="tab-content panel">
|
||||
{if isset($room['selected_demands']) && $room['selected_demands']}
|
||||
<div id="room_type_demands_desc_{$room['id']}" class="tab-pane active">
|
||||
<div id="room_type_demands_desc">
|
||||
{if isset($room['selected_demands']) && $room['selected_demands']}
|
||||
{assign var=roomCount value=1}
|
||||
{foreach $room['selected_demands'] as $demand}
|
||||
<div class="row room_demands_container">
|
||||
<div class="col-sm-12 room_demand_detail">
|
||||
{if isset($room['selected_demands']) && $room['selected_demands']}
|
||||
{foreach $room['extra_demands'] as $idGlobalDemand => $roomDemand}
|
||||
{if $demand.id_global_demand == $idGlobalDemand}
|
||||
<div class="row room_demand_block">
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="col-xs-10 demand_adv_option_block">
|
||||
<p>
|
||||
{$roomDemand['name']|escape:'html':'UTF-8'}<br>
|
||||
{if isset($roomDemand['adv_option']) && $roomDemand['adv_option']}
|
||||
{$roomDemand['adv_option'][$demand['id_option']]['name']}
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<p><span class="pull-right extra_demand_option_price">{if isset($roomDemand['adv_option']) && $roomDemand['adv_option']}{convertPrice price = $roomDemand['adv_option'][$idGlobalDemand]['price']|escape:'html':'UTF-8'}{else}{convertPrice price = $roomDemand['price']|escape:'html':'UTF-8'}{/if}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{assign var=roomCount value=$roomCount+1}
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($room['selected_services']) && $room['selected_services']}
|
||||
<div id="room_type_service_product_desc_{$room['id']}" class="tab-pane{if !isset($room['selected_demands']) || !$room['selected_demands']} active{/if}">
|
||||
<div id="room_type_services_desc">
|
||||
{assign var=roomCount value=1}
|
||||
<div class="row room_demands_container">
|
||||
<div class="col-sm-12 room_demand_detail">
|
||||
{if isset($room['selected_services']) && $room['selected_services']}
|
||||
{foreach $room['selected_services'] as $service}
|
||||
<div class="row room_demand_block">
|
||||
<div class="col-xs-5">
|
||||
<div class="row">
|
||||
<div class="col-xs-10">
|
||||
<p>{$service['name']|escape:'html':'UTF-8'}</p>
|
||||
{if $service.allow_multiple_quantity}
|
||||
<div class="qty_container">
|
||||
{l s='Quantity:'} {$service.quantity}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
{if $service['auto_add_to_cart'] && $service['price_addition_type'] == Product::PRICE_ADDITION_TYPE_INDEPENDENT}
|
||||
<span class="badge badge-info label">{l s='Convenience fee'}</span>
|
||||
{/if}
|
||||
{if $service['auto_add_to_cart'] && $service['price_addition_type'] == Product::PRICE_ADDITION_TYPE_WITH_ROOM}
|
||||
<span class="badge badge-info label">{l s='Auto added'}</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<span class="pull-right">{convertPrice price=$service.total_price}</span>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">{l s='Close'}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="3">{l s='Total cost of room types:'}</td>
|
||||
<td colspan="7">{l s='Total cost of room types:'}</td>
|
||||
<td class="text-right">{displayWtPriceWithCurrency price=$total_products currency=$currency}</td>
|
||||
</tr>
|
||||
{if $total_discounts != 0}
|
||||
<tr>
|
||||
<td colspan="3">{l s='Total value of vouchers:'}</td>
|
||||
<td colspan="7">{l s='Total value of vouchers:'}</td>
|
||||
<td class="text-right">{displayWtPriceWithCurrency price=$total_discounts currency=$currency}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $total_wrapping > 0}
|
||||
<tr>
|
||||
<td colspan="3">{l s='Total cost of gift wrapping:'}</td>
|
||||
<td colspan="7">{l s='Total cost of gift wrapping:'}</td>
|
||||
<td class="text-right">{displayWtPriceWithCurrency price=$total_wrapping currency=$currency}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $cart->getOrderTotal(true, Cart::ONLY_SHIPPING) > 0}
|
||||
<tr>
|
||||
<td colspan="3">{l s='Total cost of shipping:'}</td>
|
||||
<td colspan="7">{l s='Total cost of shipping:'}</td>
|
||||
<td class="text-right">{displayWtPriceWithCurrency price=$total_shipping currency=$currency}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr>
|
||||
<td colspan="3" class=" success"><strong>{l s='Total:'}</strong></td>
|
||||
<td colspan="7" class=" success"><strong>{l s='Total:'}</strong></td>
|
||||
<td class="text-right success"><strong>{displayWtPriceWithCurrency price=$total_price currency=$currency}</strong></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
@@ -129,15 +129,15 @@
|
||||
<h3><i class="icon-link"></i> {l s="Help Center"}</h3>
|
||||
<dl>
|
||||
<dt><a href="https://qloapps.com/qlo-reservation-system/" class="_blank">{l s="Official Documentation"}</a></dt>
|
||||
<dd>{l s="Qloapps User Guide"}</dd>
|
||||
<dd>{l s="QloApps User Guide"}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><a href="https://forums.qloapps.com/" class="_blank">{l s="Qloapps Forum"}</a></dt>
|
||||
<dd>{l s="Connect with the Qloapps community"}</dd>
|
||||
<dt><a href="https://forums.qloapps.com/" class="_blank">{l s="QloApps Forum"}</a></dt>
|
||||
<dd>{l s="Connect with the QloApps community"}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><a href="https://qloapps.com/addons/" class="_blank">{l s="Qloapps Addons"}</a></dt>
|
||||
<dd>{l s="Enhance your store Qloapps modules"}</dd>
|
||||
<dt><a href="https://qloapps.com/addons/" class="_blank">{l s="QloApps Addons"}</a></dt>
|
||||
<dd>{l s="Enhance your store QloApps modules"}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><a href="https://qloapps.com/contact/" class="_blank">{l s="Contact Us!"}</a></dt>
|
||||
@@ -148,4 +148,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,124 @@
|
||||
{*
|
||||
* 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)}
|
||||
<div id="product-associations" class="panel product-tab">
|
||||
<input type="hidden" name="submitted_tabs[]" value="Associations" />
|
||||
<h3>{l s='Associations'}</h3>
|
||||
{include file="controllers/products/multishop/check_fields.tpl" product_tab="Associations"}
|
||||
<div id="no_default_category" class="alert alert-info">
|
||||
{l s='Please select a default category.'}
|
||||
</div>
|
||||
<div class="alert alert-info">
|
||||
{l s='To create new categories '} <a target="_blank" href="{$link->getAdminLink('AdminCategories')}">{l s='click here.'}</a>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="category_box" type="category_box"}</span></div>
|
||||
<label class="control-label col-lg-2" for="category_block">
|
||||
{l s='Associated categories'}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<div id="category_block">
|
||||
{$category_tree}
|
||||
</div>
|
||||
{* <a class="btn btn-link bt-icon confirm_leave" href="{$link->getAdminLink('AdminCategories')|escape:'html':'UTF-8'}&addcategory">
|
||||
<i class="icon-plus-sign"></i> {l s='Create new category'} <i class="icon-external-link-sign"></i>
|
||||
</a> *}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-6 col-sm-offset-3 alert alert-info">
|
||||
{l s='Associations are used to display service product category wise on room type page when'} <a href="{$link->getAdminLink('AdminPPreferences')}#conf_id_PS_SERVICE_PRODUCT_CATEGORY_FILTER" target="_blank">{l s='Category filter'}</a> {l s='is enabled'}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="id_category_default" type="default"}</span></div>
|
||||
<label class="control-label col-lg-2" for="id_category_default">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='The default category is the main category for your room type, and is displayed by default.'}">
|
||||
{l s='Default category'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-5">
|
||||
<select id="id_category_default" name="id_category_default">
|
||||
{foreach from=$selected_cat item=cat}
|
||||
<option value="{$cat.id_category}" {if $id_category_default == $cat.id_category}selected="selected"{/if} >{$cat.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- By webkul to hide unneccessary fields -->
|
||||
<!-- <div class="form-group">
|
||||
<label class="control-label col-lg-3" for="product_autocomplete_input">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='You can indicate existing products as accessories for this product.'}{l s='Start by typing the first letters of the product\'s name, then select the product from the drop-down list.'}{l s='Do not forget to save the product afterwards!'}">
|
||||
{l s='Accessories'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-5">
|
||||
<input type="hidden" name="inputAccessories" id="inputAccessories" value="{foreach from=$accessories item=accessory}{$accessory.id_product}-{/foreach}" />
|
||||
<input type="hidden" name="nameAccessories" id="nameAccessories" value="{foreach from=$accessories item=accessory}{$accessory.name|escape:'html':'UTF-8'}¤{/foreach}" />
|
||||
<div id="ajax_choose_product">
|
||||
<div class="input-group">
|
||||
<input type="text" id="product_autocomplete_input" name="product_autocomplete_input" />
|
||||
<span class="input-group-addon"><i class="icon-search"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="divAccessories">
|
||||
{foreach from=$accessories item=accessory}
|
||||
<div class="form-control-static">
|
||||
<button type="button" class="btn btn-default delAccessory" name="{$accessory.id_product}">
|
||||
<i class="icon-remove text-danger"></i>
|
||||
</button>
|
||||
{$accessory.name|escape:'html':'UTF-8'}{if !empty($accessory.reference)} {l s='(ref: %s)' sprintf=$accessory.reference}{/if}
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- By webkul to hide unneccessary fields -->
|
||||
<!-- <div class="form-group">
|
||||
<label class="control-label col-lg-3" for="id_manufacturer">{l s='Manufacturer'}</label>
|
||||
<div class="col-lg-5">
|
||||
<select name="id_manufacturer" id="id_manufacturer">
|
||||
<option value="0">- {l s='Choose (optional)'} -</option>
|
||||
{if $product->id_manufacturer}
|
||||
<option value="{$product->id_manufacturer}" selected="selected">{$product->manufacturer_name}</option>
|
||||
{/if}
|
||||
<option disabled="disabled">-</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<a class="btn btn-link bt-icon confirm_leave" style="margin-bottom:0" href="{$link->getAdminLink('AdminManufacturers')|escape:'html':'UTF-8'}&addmanufacturer">
|
||||
<i class="icon-plus-sign"></i> {l s='Create new manufacturer'} <i class="icon-external-link-sign"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="panel-footer">
|
||||
<a href="{$link->getAdminLink('AdminNormalProducts')|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>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -0,0 +1,188 @@
|
||||
{*
|
||||
* 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-features" class="panel product-tab">
|
||||
<input type="hidden" name="submitted_tabs[]" value="Features" />
|
||||
<h3>{l s='Assign features to this room type'}</h3>
|
||||
|
||||
<div class="alert alert-info">
|
||||
{l s='You can specify a value for each relevant feature regarding this room type. Empty fields will not be displayed.'}<br/>
|
||||
{l s='You can either create a specific value, or select among the existing pre-defined values you\'ve previously added.'}
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th><span class="title_box">{l s='Feature'}</span></th>
|
||||
<th><span class="title_box">{l s='Feature Image'}</span></th>
|
||||
<!-- <th><span class="title_box"><u>{l s='or'}</u> {l s='Customized value'}</span></th> --><!-- by webkul -->
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{foreach from=$available_features item=available_feature}
|
||||
<tr>
|
||||
{foreach from=$available_feature.featureValues item=value}
|
||||
<td>
|
||||
<input type="checkbox" class="checkbox select_hotel_feature" name="feature_{$available_feature.id_feature}_check" value="{$value.id_feature_value}" {if $available_feature.current_item == $value.id_feature_value}checked="checked"{/if}/>
|
||||
</td>
|
||||
<td>{$available_feature.name}</td>
|
||||
<td>
|
||||
<input type="hidden" id="feature_{$available_feature.id_feature}_value" name="feature_{$available_feature.id_feature}_value" value="{$value.id_feature_value}">
|
||||
<img class="img img-responsive" width="15px" src="{$base_url}img/rf/{$value.value}" title="Room image" />
|
||||
</td>
|
||||
{/foreach}
|
||||
<!--<td>
|
||||
{if sizeof($available_feature.featureValues)}
|
||||
<select id="feature_{$available_feature.id_feature}_value" name="feature_{$available_feature.id_feature}_value"
|
||||
onchange="$('.custom_{$available_feature.id_feature}_').val('');">
|
||||
<option value="0">---</option>
|
||||
{foreach from=$available_feature.featureValues item=value}
|
||||
<option value="{$value.id_feature_value}"{if $available_feature.current_item == $value.id_feature_value}selected="selected"{/if} >
|
||||
{$value.value|truncate:40}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
{else}
|
||||
<input type="hidden" name="feature_{$available_feature.id_feature}_value" value="0" />
|
||||
<span>{l s='N/A'} -
|
||||
<a href="{$link->getAdminLink('AdminFeatures')|escape:'html':'UTF-8'}&addfeature_value&id_feature={$available_feature.id_feature}"
|
||||
class="confirm_leave btn btn-link"><i class="icon-plus-sign"></i> {l s='Add pre-defined values first'} <i class="icon-external-link-sign"></i></a>
|
||||
</span>
|
||||
{/if} --><!-- By Webkul -->
|
||||
</td>
|
||||
<!-- <td>
|
||||
|
||||
<div class="row lang-0" style='display: none;'>
|
||||
<div class="col-lg-9">
|
||||
<textarea class="custom_{$available_feature.id_feature}_ALL textarea-autosize" name="custom_{$available_feature.id_feature}_ALL"
|
||||
cols="40" style='background-color:#CCF' rows="1" onkeyup="{foreach from=$languages key=k item=language}$('.custom_{$available_feature.id_feature}_{$language.id_lang}').val($(this).val());{/foreach}" >{$available_feature.val[1].value|escape:'html':'UTF-8'|default:""}</textarea>
|
||||
|
||||
</div>
|
||||
{if $languages|count > 1}
|
||||
<div class="col-lg-3">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
{l s='ALL'}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{foreach from=$languages item=language}
|
||||
<li>
|
||||
<a href="javascript:void(0);" onclick="restore_lng($(this),{$language.id_lang});">{$language.iso_code}</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{foreach from=$languages key=k item=language}
|
||||
{if $languages|count > 1}
|
||||
<div class="row translatable-field lang-{$language.id_lang}">
|
||||
<div class="col-lg-9">
|
||||
{/if}
|
||||
<textarea
|
||||
class="custom_{$available_feature.id_feature}_{$language.id_lang} textarea-autosize"
|
||||
name="custom_{$available_feature.id_feature}_{$language.id_lang}"
|
||||
cols="40"
|
||||
rows="1"
|
||||
onkeyup="if (isArrowKey(event)) return ;$('#feature_{$available_feature.id_feature}_value').val(0);" >{$available_feature.val[$language.id_lang].value|escape:'html':'UTF-8'|default:""}</textarea>
|
||||
|
||||
{if $languages|count > 1}
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
{$language.iso_code}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="javascript:void(0);" onclick="all_languages($(this));">{l s='ALL'}</a></li>
|
||||
{foreach from=$languages item=language}
|
||||
<li>
|
||||
<a href="javascript:hideOtherLanguage({$language.id_lang});">{$language.iso_code}</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</td> --><!-- By Webkul -->
|
||||
|
||||
</tr>
|
||||
{foreachelse}
|
||||
<tr>
|
||||
<td colspan="3" style="text-align:center;"><i class="icon-warning-sign"></i> {l s='No features have been defined'}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{$link->getAdminLink('AdminFeatures')|escape:'html':'UTF-8'}&addfeature" class="btn btn-link confirm_leave button">
|
||||
<i class="icon-plus-sign"></i> {l s='Add a new feature'} <i class="icon-external-link-sign"></i>
|
||||
</a>
|
||||
<div class="panel-footer">
|
||||
<a href="{$link->getAdminLink('AdminNormalProducts')|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>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
if (tabs_manager.allow_hide_other_languages)
|
||||
hideOtherLanguage({$default_form_language});
|
||||
{literal}
|
||||
$(".textarea-autosize").autosize();
|
||||
|
||||
function all_languages(pos)
|
||||
{
|
||||
{/literal}
|
||||
{if isset($languages) && is_array($languages)}
|
||||
{foreach from=$languages key=k item=language}
|
||||
pos.parents('td').find('.lang-{$language.id_lang}').addClass('nolang-{$language.id_lang}').removeClass('lang-{$language.id_lang}');
|
||||
{/foreach}
|
||||
{/if}
|
||||
pos.parents('td').find('.translatable-field').hide();
|
||||
pos.parents('td').find('.lang-0').show();
|
||||
{literal}
|
||||
}
|
||||
|
||||
function restore_lng(pos,i)
|
||||
{
|
||||
{/literal}
|
||||
{if isset($languages) && is_array($languages)}
|
||||
{foreach from=$languages key=k item=language}
|
||||
pos.parents('td').find('.nolang-{$language.id_lang}').addClass('lang-{$language.id_lang}').removeClass('nolang-{$language.id_lang}');
|
||||
{/foreach}
|
||||
{/if}
|
||||
{literal}
|
||||
pos.parents('td').find('.lang-0').hide();
|
||||
hideOtherLanguage(i);
|
||||
}
|
||||
</script>
|
||||
{/literal}
|
||||
|
||||
{/if}
|
||||
@@ -0,0 +1,337 @@
|
||||
{*
|
||||
* 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
|
||||
*}
|
||||
|
||||
{extends file="helpers/form/form.tpl"}
|
||||
|
||||
{block name="autoload_tinyMCE"}
|
||||
// Execute when tab Informations has finished loading
|
||||
tabs_manager.onLoad('Informations', function(){
|
||||
tinySetup({
|
||||
editor_selector :"autoload_rte",
|
||||
setup : function(ed) {
|
||||
ed.on('init', function(ed)
|
||||
{
|
||||
if (typeof ProductMultishop.load_tinymce[ed.target.id] != 'undefined')
|
||||
{
|
||||
if (typeof ProductMultishop.load_tinymce[ed.target.id])
|
||||
tinyMCE.get(ed.target.id).hide();
|
||||
else
|
||||
tinyMCE.get(ed.target.id).show();
|
||||
}
|
||||
});
|
||||
|
||||
ed.on('keydown', function(ed, e) {
|
||||
tinyMCE.triggerSave();
|
||||
textarea = $('#'+tinymce.activeEditor.id);
|
||||
var max = textarea.parent('div').find('span.counter').data('max');
|
||||
if (max != 'none')
|
||||
{
|
||||
count = tinyMCE.activeEditor.getBody().textContent.length;
|
||||
rest = max - count;
|
||||
if (rest < 0)
|
||||
textarea.parent('div').find('span.counter').html('<span style="color:red;">{l s='Maximum'} '+ max +' {l s='characters'} : '+rest+'</span>');
|
||||
else
|
||||
textarea.parent('div').find('span.counter').html(' ');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
{/block}
|
||||
|
||||
{block name="defaultForm"}
|
||||
<div class="row">
|
||||
<div class="productTabs col-lg-2 col-md-3">
|
||||
<div class="list-group">
|
||||
{foreach $product_tabs key=numStep item=tab}
|
||||
{if $tab.name != "Pack"}
|
||||
<a class="list-group-item {if $tab.selected}active{/if}" id="link-{$tab.id}" href="{$tab.href|escape:'html':'UTF-8'}&updateproduct">{$tab.name}</a>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var id_product = {if isset($product->id)}{$product->id|intval}{else}0{/if};
|
||||
var id_lang_default = {$id_lang_default|intval};
|
||||
var product_type_pack = {Product::PTYPE_PACK|intval};
|
||||
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 has_combinations = {$has_combinations|intval};
|
||||
|
||||
var empty_pack_msg = '{l s='This pack is empty. You will need to add at least one product to the pack before you can save.' js=1}';
|
||||
var empty_name_msg = '{l s='The product name is empty. You will at least need to enter a name for the default language before you can save the product.' js=1}';
|
||||
var empty_link_rewrite_msg = '{l s='The friendly URL is empty. You will at least need to enter a friendly URL for the default language before you can save the product.' slashes=1}';
|
||||
var reload_tab_title = '{l s='Confirmation' slashes=1}';
|
||||
var reload_tab_description = '{l s='A server error occurred while loading the tabs: some tabs could not be loaded.' js=1}'+'\n'+'{l s='Please try again by refreshing the page.' js=1}'+'\n'+'{l s='If you are still encountering this problem, please check your server logs or contact your hosting provider for assistance.' js=1}';
|
||||
|
||||
$('#product-tab-content-wait').show();
|
||||
var post_data = {$post_data};
|
||||
var save_error = {if $save_error}true{else}false{/if};
|
||||
var error_heading_msg = '{l s='Error' js=1}';
|
||||
var error_continue_msg = '{l s='Continue' js=1}';
|
||||
|
||||
var product_type = {$product_type};
|
||||
{*var mce_maximum = '{l s='Maximum'}';*}
|
||||
{if isset($display_multishop_checkboxes) && $display_multishop_checkboxes}
|
||||
var display_multishop_checkboxes = true;
|
||||
{else}
|
||||
var display_multishop_checkboxes = false;
|
||||
{/if}
|
||||
|
||||
var tabs_to_preload = new Array();
|
||||
var mod_evasive = {if isset($mod_evasive) && $mod_evasive}true{else}false{/if};
|
||||
var mod_security = {if isset($mod_security) && $mod_security}true{else}false{/if};
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
{* if (product_type == product_type_pack)
|
||||
{
|
||||
$('a[id*="VirtualProduct"]').hide();
|
||||
$('a[id*="Combinations"]').hide();
|
||||
}
|
||||
else if (product_type == product_type_virtual)
|
||||
{
|
||||
$('#hotel_selection').show();
|
||||
$('a[id*="Quantities"]').hide();
|
||||
$('a[id*="Configuration"]').show();
|
||||
$('a[id*="Booking"]').show();
|
||||
$('a[id*="Occupancy"]').show();
|
||||
$('a[id*="ModuleHotelreservationsystem"]').show();
|
||||
$('a[id*="Pack"]').hide();
|
||||
$('a[id*="Shipping"]').hide();
|
||||
$('a[id*="Combinations"]').hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#hotel_selection').hide();
|
||||
$('a[id*="Quantities"]').show();
|
||||
$('a[id*="Configuration"]').hide();
|
||||
$('a[id*="Occupancy"]').hide();
|
||||
$('a[id*="Booking"]').hide();
|
||||
$('a[id*="ModuleHotelreservationsystem"]').hide();
|
||||
$('a[id*="Pack"]').hide();
|
||||
$('a[id*="VirtualProduct"]').hide();
|
||||
}
|
||||
updateTextInfo(product_type); *}
|
||||
|
||||
{* $('#desc-product-newCombination').hide(); *}
|
||||
|
||||
{* submenu binding *}
|
||||
$(".productTabs a").click(function(e){
|
||||
e.preventDefault();
|
||||
// currentId is the current product tab id
|
||||
currentId = false;
|
||||
if ($(".productTabs a.active").length)
|
||||
currentId = $(".productTabs a.active").attr('id').substr(5);
|
||||
// id is the wanted producttab id
|
||||
id = $(this).attr('id').substr(5);
|
||||
|
||||
// Update submit button value
|
||||
var split_position = id.indexOf('-') + 1;
|
||||
var btn_name = id.substr(split_position);
|
||||
|
||||
if ((btn_name == 'VirtualProduct' || btn_name == 'Pack') && $('#name_' + id_lang_default).val() == '')
|
||||
{
|
||||
alert(missing_product_name);
|
||||
$('#name_' + id_lang_default).focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
$('#key_tab').val(btn_name);
|
||||
|
||||
if ($(this).attr("id") != $(".productTabs a.active ").attr('id'))
|
||||
{
|
||||
$(".productTabs a").removeClass('active');
|
||||
$("#product-tab-content-"+currentId).hide();
|
||||
}
|
||||
|
||||
// if the tab has not already been loaded, load it now
|
||||
tabs_manager.display(id, true);
|
||||
|
||||
tabs_manager.onLoad(id, function(){
|
||||
$("#product-tab-content-"+id).show(0, function(){
|
||||
$(this).trigger('displayed');
|
||||
});
|
||||
$("#link-"+id).addClass('active');
|
||||
});
|
||||
|
||||
var languages = new Array();
|
||||
if (btn_name == "Combinations")
|
||||
{
|
||||
$('#desc-product-new').hide();
|
||||
$('#desc-product-newCombination').show();
|
||||
populate_attrs();
|
||||
}
|
||||
else if (btn_name == "Attachments")
|
||||
{
|
||||
handleSaveButtons();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#desc-product-newCombination').hide();
|
||||
// if pack is enabled, save button are visible only if pack is valid
|
||||
if ($("input[name='id_product']").val() != 0 || btn_name != 'Informations')
|
||||
handleSaveButtons();
|
||||
}
|
||||
|
||||
$('.label-tooltip').tooltip();
|
||||
});
|
||||
|
||||
$(".productTabs a.active").click();
|
||||
|
||||
// disable save if Associations tab is not loaded
|
||||
if ($('#product-tab-content-Associations').hasClass('not-loaded'))
|
||||
disableSave();
|
||||
|
||||
tabs_manager.onLoad('Associations', function(){
|
||||
if ($("input[name='id_product']").val() != 0)
|
||||
handleSaveButtons();
|
||||
});
|
||||
|
||||
$('.confirm_leave').live('click', function(){
|
||||
// Double quotes are necessary when the translated string has single quotes
|
||||
return confirm("{l s='You will lose all unsaved modifications. Are you sure that you want to proceed?' js=1}");
|
||||
});
|
||||
|
||||
$('#toolbar-footer').appendTo($('#product-tab-content-Informations').children('.product-tab'));
|
||||
|
||||
$('.product-tab-content').on('displayed', function(e) {
|
||||
$('#toolbar-footer').appendTo($(this).children('.product-tab'));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// Listen to the load event that is fired each time an ajax call to load a tab has completed
|
||||
$(window).bind("load", function() {
|
||||
{* Fill an array with tabs that need to be preloaded *}
|
||||
var tabs_to_preload = new Array();
|
||||
{foreach $tabs_preloaded as $tab_name => $value}
|
||||
{* If the tab was not given a loading priority number it will not be preloaded *}
|
||||
{if (is_numeric($value))}
|
||||
if ($("#product-tab-content-"+'{$tab_name}').hasClass('not-loaded'))
|
||||
tabs_to_preload.push('{$tab_name}');
|
||||
{/if}
|
||||
{/foreach}
|
||||
tabs_manager.tabs_to_preload = tabs_to_preload.slice(0);
|
||||
tabs_manager.displayBulk(tabs_to_preload);
|
||||
$('.productTabs').show();
|
||||
$('#product-tab-content-wait').hide();
|
||||
|
||||
function checkIfProductTypeIsPack() {
|
||||
var typeIsPack = $('#pack_product').is(':checked');
|
||||
if (typeIsPack && $('#inputPackItems').val()=='' ) {
|
||||
$('.pack-empty-warning').removeClass('alert-warning').addClass('alert-danger');
|
||||
$('#curPackItemName').select2('open');
|
||||
}
|
||||
return typeIsPack;
|
||||
}
|
||||
$("#product_form").validate({
|
||||
ignore: '.updateCurrentText',
|
||||
rules: {
|
||||
inputPackItems: {
|
||||
required: {
|
||||
depends: checkIfProductTypeIsPack
|
||||
},
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
inputPackItems: {
|
||||
required: ""
|
||||
}
|
||||
},
|
||||
// override jquery validate plugin defaults for bootstrap 3
|
||||
highlight: function(element) {
|
||||
$(element).closest('.form-group').addClass('has-error');
|
||||
},
|
||||
unhighlight: function(element) {
|
||||
$(element).closest('.form-group').removeClass('has-error');
|
||||
},
|
||||
errorElement: 'span',
|
||||
errorClass: 'help-block',
|
||||
errorPlacement: function(error, element) {
|
||||
if(element.parent('.input-group').length) {
|
||||
error.insertAfter(element.parent());
|
||||
} else {
|
||||
error.insertAfter(element);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
ThickboxI18nImage = "{l s='Image'}";
|
||||
ThickboxI18nOf = "{l s='of'}";
|
||||
ThickboxI18nClose = "{l s='Close'}";
|
||||
ThickboxI18nOrEscKey = "{l s='(or "Esc")'}";
|
||||
ThickboxI18nNext = "{l s='Next >'}";
|
||||
ThickboxI18nPrev = "{l s='< Previous'}";
|
||||
tb_pathToImage = "../img/loadingAnimation.gif";
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
<div id="product-tab-content-wait" style="display:none">
|
||||
<div id="loading"><i class="icon-refresh icon-spin"></i> {l s='Loading...'}</div>
|
||||
</div>
|
||||
|
||||
<form id="product_form" class="form-horizontal col-lg-10 col-md-9" action="{$form_action|escape:'html':'UTF-8'}" method="post" enctype="multipart/form-data" name="product" novalidate>
|
||||
<input type="hidden" name="id_product" value="{$id_product}" />
|
||||
{* <input type="hidden" id="is_virtual" name="is_virtual" value="{$product->is_virtual|escape:'html':'UTF-8'}" /> *}
|
||||
<!-- changed input field to make product virtual by default -->
|
||||
<input type="hidden" id="is_virtual" name="is_virtual" value="1"/>
|
||||
|
||||
{if isset($smarty.request.page) && $smarty.request.page > 1}
|
||||
<input type="hidden" id="page" name="page" value="{$smarty.request.page|intval}" />
|
||||
{/if}
|
||||
{if !$product->active && $product->isAssociatedToShop()}
|
||||
<div class="alert alert-info draft">
|
||||
{l s='Your product will be saved as a draft.'}
|
||||
<a href="#" class="btn btn-default" onclick="submitAddProduct()" ><i class="icon-save"></i> {l s='Save'}</a>
|
||||
<input type="hidden" name="submitAddProduct" id="submitAddProduct" />
|
||||
</div>
|
||||
{/if}
|
||||
{* all input are here *}
|
||||
{foreach $product_tabs key=numStep item=tab}
|
||||
{if $tab.id != "Pack" }
|
||||
<div id="product-tab-content-{$tab.id}" class="{if !$tab.selected}not-loaded{/if} product-tab-content" {if !$tab.selected}style="display:none"{/if}>
|
||||
{if $tab.selected}
|
||||
{$custom_form}
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
<input type="hidden" name="id_product_attribute" id="id_product_attribute" value="0" />
|
||||
<input type="hidden" name="key_tab" id="key_tab" value="Informations" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{/block}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../../../../../../');
|
||||
exit;
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../../../../../');
|
||||
exit;
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../../../../../../');
|
||||
exit;
|
||||
@@ -0,0 +1,36 @@
|
||||
{*
|
||||
* 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
|
||||
*}
|
||||
|
||||
{extends file="helpers/list/list_header.tpl"}
|
||||
|
||||
{block name=leadin}
|
||||
{if isset($category_tree)}
|
||||
<div class="bloc-leadin">
|
||||
<div id="container_category_tree">
|
||||
{$category_tree}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../../../../../../');
|
||||
exit;
|
||||
@@ -0,0 +1,55 @@
|
||||
{*
|
||||
* 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($nodes)}
|
||||
{$nodes}
|
||||
{/if}
|
||||
|
||||
<script type="text/javascript">
|
||||
{if isset($selected_categories) && !empty($selected_categories)}
|
||||
{assign var=imploded_selected_categories value='","'|implode:$selected_categories}
|
||||
var selected_categories = new Array("{$imploded_selected_categories}");
|
||||
|
||||
$('#{$id_tree}').tree('collapseAll');
|
||||
$('#{$id_tree}').find(":input").each(
|
||||
function()
|
||||
{
|
||||
if ($.inArray($(this).val(), selected_categories) != -1)
|
||||
{
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents("ul.tree").each(
|
||||
function()
|
||||
{
|
||||
$(this).children().children().children(".icon-folder-close")
|
||||
.removeClass("icon-folder-close")
|
||||
.addClass("icon-folder-open");
|
||||
$(this).show();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
{/if}
|
||||
</script>
|
||||
@@ -0,0 +1,161 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<div class="panel">
|
||||
{if isset($header)}{$header}{/if}
|
||||
{if isset($nodes)}
|
||||
<ul id="{$id|escape:'html':'UTF-8'}" class="cattree tree">
|
||||
{$nodes}
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var currentToken="{$token|@addslashes}";
|
||||
var treeClickFunc = function() {
|
||||
var newURL = window.location.protocol + "//" + window.location.host + window.location.pathname;
|
||||
var queryString = window.location.search.replace(/&id_category=[0-9]*/, "") + "&id_category=" + $(this).val();
|
||||
location.href = newURL+queryString; // hash part is dropped: window.location.hash
|
||||
};
|
||||
function addDefaultCategory(elem)
|
||||
{
|
||||
$('select#id_category_default').append('<option value="' + elem.val()+'">' + (elem.val() !=1 ? elem.parent().find('label').html() : home) + '</option>');
|
||||
if ($('select#id_category_default option').length > 0)
|
||||
{
|
||||
$('select#id_category_default').closest('.form-group').show();
|
||||
$('#no_default_category').hide();
|
||||
}
|
||||
}
|
||||
|
||||
{if isset($use_checkbox) && $use_checkbox == true}
|
||||
function checkAllAssociatedCategories($tree)
|
||||
{
|
||||
$tree.find(':input[type=checkbox]').each(function(){
|
||||
$(this).prop('checked', true);
|
||||
|
||||
addDefaultCategory($(this));
|
||||
$(this).parent().addClass('tree-selected');
|
||||
});
|
||||
}
|
||||
|
||||
function uncheckAllAssociatedCategories($tree)
|
||||
{
|
||||
$tree.find(':input[type=checkbox]').each(function(){
|
||||
$(this).prop('checked', false);
|
||||
|
||||
$('select#id_category_default option[value='+$(this).val()+']').remove();
|
||||
if ($('select#id_category_default option').length == 0)
|
||||
{
|
||||
$('select#id_category_default').closest('.form-group').hide();
|
||||
$('#no_default_category').show();
|
||||
}
|
||||
|
||||
$(this).parent().removeClass('tree-selected');
|
||||
});
|
||||
}
|
||||
{/if}
|
||||
{if isset($use_search) && $use_search == true}
|
||||
$('#{$id|escape:'html':'UTF-8'}-categories-search').bind('typeahead:selected', function(obj, datum){
|
||||
var match = $('#{$id|escape:'html':'UTF-8'}').find(':input[value="'+datum.id_category+'"]').first();
|
||||
if (match.length)
|
||||
{
|
||||
match.each(function(){
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents('ul.tree').each(function(){
|
||||
$(this).show();
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
});
|
||||
addDefaultCategory($(this));
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
var selected = [];
|
||||
that = this;
|
||||
$('#{$id|escape:'html':'UTF-8'}').find('.tree-selected input').each(
|
||||
function()
|
||||
{
|
||||
selected.push($(this).val());
|
||||
}
|
||||
);
|
||||
{literal}
|
||||
$.get(
|
||||
'ajax-tab.php',
|
||||
{controller:'AdminNormalProducts',token:currentToken,action:'getCategoryTree', fullTree:1, selected:selected},
|
||||
function(content) {
|
||||
{/literal}
|
||||
$('#{$id|escape:'html':'UTF-8'}').html(content);
|
||||
$('#{$id|escape:'html':'UTF-8'}').tree('init');
|
||||
$('#{$id|escape:'html':'UTF-8'}').find(':input[value="'+datum.id_category+'"]').each(function(){
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents('ul.tree').each(function(){
|
||||
$(this).show();
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
});
|
||||
full_loaded = true;
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
{/if}
|
||||
function startTree() {
|
||||
if (typeof $.fn.tree === 'undefined') {
|
||||
setTimeout(startTree, 100);
|
||||
return;
|
||||
}
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}').tree('collapseAll');
|
||||
$('#{$id|escape:'html':'UTF-8'}').find(':input[type=radio]').click(treeClickFunc);
|
||||
|
||||
{if isset($selected_categories)}
|
||||
$('#no_default_category').hide();
|
||||
{assign var=imploded_selected_categories value='","'|implode:$selected_categories}
|
||||
var selected_categories = new Array("{$imploded_selected_categories}");
|
||||
|
||||
if (selected_categories.length > 1)
|
||||
$('#expand-all-{$id|escape:'html':'UTF-8'}').hide();
|
||||
else
|
||||
$('#collapse-all-{$id|escape:'html':'UTF-8'}').hide();
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}').find(':input').each(function(){
|
||||
if ($.inArray($(this).val(), selected_categories) != -1)
|
||||
{
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents('ul.tree').each(function(){
|
||||
$(this).show();
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
});
|
||||
}
|
||||
});
|
||||
{else}
|
||||
$('#collapse-all-{$id|escape:'html':'UTF-8'}').hide();
|
||||
{/if}
|
||||
}
|
||||
startTree();
|
||||
</script>
|
||||
@@ -0,0 +1,25 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<div class="tree-panel-heading-controls clearfix">{if isset($toolbar)}{$toolbar}{/if}</div>
|
||||
@@ -0,0 +1,210 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<div class="panel">
|
||||
{if isset($header)}{$header}{/if}
|
||||
{if isset($nodes)}
|
||||
<ul id="{$id|escape:'html':'UTF-8'}" class="cattree tree">
|
||||
{$nodes}
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var currentToken="{$token|@addslashes}";
|
||||
var treeClickFunc = function() {
|
||||
var newURL = window.location.protocol + "//" + window.location.host + window.location.pathname;
|
||||
var queryString = window.location.search.replace(/&id_category=[0-9]*/, "") + "&id_category=" + $(this).val();
|
||||
location.href = newURL+queryString; // hash part is dropped: window.location.hash
|
||||
};
|
||||
function addDefaultCategory(elem)
|
||||
{
|
||||
$('select#id_category_default').append('<option value="' + elem.val()+'">' + (elem.val() !=1 ? elem.parent().find('label').html() : home) + '</option>');
|
||||
if ($('select#id_category_default option').length > 0)
|
||||
{
|
||||
$('select#id_category_default').closest('.form-group').show();
|
||||
$('#no_default_category').hide();
|
||||
}
|
||||
}
|
||||
|
||||
{if isset($use_checkbox) && $use_checkbox == true}
|
||||
function checkAllAssociatedCategories($tree)
|
||||
{
|
||||
$tree.find(':input[type=checkbox]').each(function(){
|
||||
$(this).prop('checked', true);
|
||||
|
||||
addDefaultCategory($(this));
|
||||
$(this).parent().addClass('tree-selected');
|
||||
});
|
||||
}
|
||||
|
||||
function uncheckAllAssociatedCategories($tree)
|
||||
{
|
||||
$tree.find(':input[type=checkbox]').each(function(){
|
||||
$(this).prop('checked', false);
|
||||
|
||||
$('select#id_category_default option[value='+$(this).val()+']').remove();
|
||||
if ($('select#id_category_default option').length == 0)
|
||||
{
|
||||
$('select#id_category_default').closest('.form-group').hide();
|
||||
$('#no_default_category').show();
|
||||
}
|
||||
|
||||
$(this).parent().removeClass('tree-selected');
|
||||
});
|
||||
}
|
||||
|
||||
function checkAllRoomTypeOfHotel(node)
|
||||
{
|
||||
$(node).find(':input[type=checkbox]').each(function(){
|
||||
$(this).prop('checked', true);
|
||||
$(this).parent().addClass('tree-selected');
|
||||
});
|
||||
}
|
||||
|
||||
function unCheckAllRoomTypeOfHotel(node)
|
||||
{
|
||||
$(node).find(':input[type=checkbox]').each(function(){
|
||||
$(this).prop('checked', false);
|
||||
$(this).parent().removeClass('tree-selected');
|
||||
});
|
||||
}
|
||||
{/if}
|
||||
$('#{$id|escape:'html':'UTF-8'}').find('.select_hotel').on('click', function(){
|
||||
if ($(this).is(":checked")) {
|
||||
checkAllRoomTypeOfHotel($(this).closest('li.tree-folder').find('ul.tree'));
|
||||
} else {
|
||||
unCheckAllRoomTypeOfHotel($(this).closest('li.tree-folder').find('ul.tree'));
|
||||
}
|
||||
});
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}').find(':input[type=checkbox].select_room_type').on('change', function(){
|
||||
var totalNodes = $(this).closest('ul.tree').find('li.tree-item');
|
||||
var checkedNodes = $(this).closest('ul.tree').find('li.tree-item :input[type=checkbox].select_room_type:checked');
|
||||
if (totalNodes.length == checkedNodes.length) {
|
||||
$(this).closest('li.tree-folder').find(':input[type=checkbox].select_hotel').prop('checked', true).parent().addClass('tree-selected');
|
||||
} else {
|
||||
$(this).closest('li.tree-folder').find(':input[type=checkbox].select_hotel').prop('checked', false).parent().removeClass('tree-selected');
|
||||
}
|
||||
});
|
||||
{if isset($use_search) && $use_search == true}
|
||||
$('#{$id|escape:'html':'UTF-8'}-categories-search').bind('typeahead:selected', function(obj, datum){
|
||||
var match = $('#{$id|escape:'html':'UTF-8'}').find(':input[value="'+datum.id_category+'"]').first();
|
||||
if (match.length)
|
||||
{
|
||||
match.each(function(){
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents('ul.tree').each(function(){
|
||||
$(this).show();
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
});
|
||||
addDefaultCategory($(this));
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
var selected = [];
|
||||
that = this;
|
||||
$('#{$id|escape:'html':'UTF-8'}').find('.tree-selected input').each(
|
||||
function()
|
||||
{
|
||||
selected.push($(this).val());
|
||||
}
|
||||
);
|
||||
{literal}
|
||||
$.get(
|
||||
'ajax-tab.php',
|
||||
{controller:'AdminNormalProducts',token:currentToken,action:'getCategoryTree', fullTree:1, selected:selected},
|
||||
function(content) {
|
||||
{/literal}
|
||||
$('#{$id|escape:'html':'UTF-8'}').html(content);
|
||||
$('#{$id|escape:'html':'UTF-8'}').tree('init');
|
||||
$('#{$id|escape:'html':'UTF-8'}').find(':input[value="'+datum.id_category+'"]').each(function(){
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents('ul.tree').each(function(){
|
||||
$(this).show();
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
});
|
||||
full_loaded = true;
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
{/if}
|
||||
function startTree() {
|
||||
if (typeof $.fn.tree === 'undefined') {
|
||||
setTimeout(startTree, 100);
|
||||
return;
|
||||
}
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}').tree('expandAll');
|
||||
$('#expand-all-{$id|escape:'html':'UTF-8'}').hide();
|
||||
$('#{$id|escape:'html':'UTF-8'}').find(':input[type=radio]').click(treeClickFunc);
|
||||
|
||||
{if isset($selected_hotels)}
|
||||
$('#no_default_category').hide();
|
||||
{assign var=imploded_selected_hotels value='","'|implode:$selected_hotels}
|
||||
var selected_hotels = new Array("{$imploded_selected_hotels}");
|
||||
|
||||
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}').find(':input.select_hotel').each(function(){
|
||||
if ($.inArray($(this).val(), selected_hotels) != -1)
|
||||
{
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents('ul.tree').each(function(){
|
||||
$(this).show();
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
});
|
||||
}
|
||||
});
|
||||
{/if}
|
||||
|
||||
{if isset($selected_roomtypes)}
|
||||
$('#no_default_category').hide();
|
||||
{assign var=imploded_selected_hotels value='","'|implode:$selected_roomtypes}
|
||||
var selected_roomtypes = new Array("{$imploded_selected_hotels}");
|
||||
|
||||
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}').find(':input.select_room_type').each(function(){
|
||||
if ($.inArray($(this).val(), selected_roomtypes) != -1)
|
||||
{
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents('ul.tree').each(function(){
|
||||
$(this).show();
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
});
|
||||
}
|
||||
});
|
||||
{/if}
|
||||
}
|
||||
startTree();
|
||||
</script>
|
||||
@@ -0,0 +1,127 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<div class="panel">
|
||||
{if isset($header)}{$header}{/if}
|
||||
<div id="block_category_tree"{if !$is_category_filter} style="display:none"{/if}>
|
||||
{if isset($nodes)}
|
||||
<ul id="{$id|escape:'html':'UTF-8'}" class="cattree tree">
|
||||
{$nodes}
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var currentToken="{$token|@addslashes}";
|
||||
var treeClickFunc = function() {
|
||||
var newURL = window.location.protocol + "//" + window.location.host + window.location.pathname;
|
||||
var queryString = window.location.search.replace(/&id_category=[0-9]*/, "") + "&id_category=" + $(this).val();
|
||||
location.href = newURL+queryString; // hash part is dropped: window.location.hash
|
||||
};
|
||||
{if isset($use_checkbox) && $use_checkbox == true}
|
||||
function checkAllAssociatedCategories($tree)
|
||||
{
|
||||
$tree.find(":input[type=checkbox]").each(
|
||||
function()
|
||||
{
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function uncheckAllAssociatedCategories($tree)
|
||||
{
|
||||
$tree.find(":input[type=checkbox]").each(
|
||||
function()
|
||||
{
|
||||
$(this).prop("checked", false);
|
||||
$(this).parent().removeClass("tree-selected");
|
||||
}
|
||||
);
|
||||
}
|
||||
{/if}
|
||||
{if isset($use_search) && $use_search == true}
|
||||
$("#{$id|escape:'html':'UTF-8'}-categories-search").bind("typeahead:selected", function(obj, datum) {
|
||||
$("#{$id|escape:'html':'UTF-8'}").find(":input").each(
|
||||
function()
|
||||
{
|
||||
if ($(this).val() == datum.id_category)
|
||||
{
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents("ul.tree").each(
|
||||
function()
|
||||
{
|
||||
$(this).children().children().children(".icon-folder-close")
|
||||
.removeClass("icon-folder-close")
|
||||
.addClass("icon-folder-open");
|
||||
$(this).show();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
{/if}
|
||||
$(document).ready(function () {
|
||||
var tree = $("#{$id|escape:'html':'UTF-8'}").tree("collapseAll");
|
||||
|
||||
tree.on('collapse', function() {
|
||||
$('#expand-all-{$id|escape:'html':'UTF-8'}').show();
|
||||
});
|
||||
|
||||
tree.on('expand', function() {
|
||||
$('#collapse-all-{$id|escape:'html':'UTF-8'}').show();
|
||||
});
|
||||
|
||||
$('#collapse-all-{$id|escape:'html':'UTF-8'}').hide();
|
||||
$("#{$id|escape:'html':'UTF-8'}").find(":input[type=radio]").click(treeClickFunc);
|
||||
|
||||
{if isset($selected_categories)}
|
||||
{assign var=imploded_selected_categories value='","'|implode:$selected_categories}
|
||||
var selected_categories = new Array("{$imploded_selected_categories}");
|
||||
|
||||
$("#{$id|escape:'html':'UTF-8'}").find(":input").each(
|
||||
function()
|
||||
{
|
||||
if ($.inArray($(this).val(), selected_categories) != -1)
|
||||
{
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents("ul.tree").each(
|
||||
function()
|
||||
{
|
||||
$(this).children().children().children(".icon-folder-close")
|
||||
.removeClass("icon-folder-close")
|
||||
.addClass("icon-folder-open");
|
||||
$(this).show();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
{/if}
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,50 @@
|
||||
{*
|
||||
* 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
|
||||
*}
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$('#filter-by-category').click(function() {
|
||||
if ($(this).is(':checked')) {
|
||||
$('#block_category_tree').show();
|
||||
$('#category-tree-toolbar').show();
|
||||
} else {
|
||||
$('#block_category_tree').hide();
|
||||
$('#category-tree-toolbar').hide();
|
||||
location.href = '{$base_url}&reset_filter_category=1';
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="tree-panel-heading-controls clearfix">
|
||||
<div id="category-tree-toolbar" {if !$is_category_filter}style="display:none;"{/if}>
|
||||
{if isset($toolbar)}{$toolbar}{/if}
|
||||
</div>
|
||||
<label class="tree-panel-label-title">
|
||||
<input type="checkbox" id="filter-by-category" name="filter-by-category" {if $is_category_filter}checked="checked"{/if} />
|
||||
<i class="icon-tags"></i>
|
||||
{$title}
|
||||
</label>
|
||||
</div>
|
||||
@@ -0,0 +1,31 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<div class="tree-actions pull-right">
|
||||
{if isset($actions)}
|
||||
{foreach from=$actions item=action}
|
||||
{$action->render()}
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,193 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-12">
|
||||
<input id="{$id|escape:'html':'UTF-8'}" type="file" name="{$name|escape:'html':'UTF-8'}[]"{if isset($url)} data-url="{$url}"{/if}{if isset($multiple) && $multiple} multiple="multiple"{/if} style="width:0px;height:0px;" />
|
||||
<button class="btn btn-default" data-style="expand-right" data-size="s" type="button" id="{$id|escape:'html':'UTF-8'}-add-button">
|
||||
<i class="icon-folder-open"></i> {if isset($multiple) && $multiple}{l s='Add files...'}{else}{l s='Add file...'}{/if}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="well" style="display:none">
|
||||
<div id="{$id|escape:'html':'UTF-8'}-files-list"></div>
|
||||
<button class="ladda-button btn btn-primary" data-style="expand-right" type="button" id="{$id|escape:'html':'UTF-8'}-upload-button" style="display:none;">
|
||||
<span class="ladda-label"><i class="icon-check"></i> {if isset($multiple) && $multiple}{l s='Upload files'}{else}{l s='Upload file'}{/if}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="row" style="display:none">
|
||||
<div class="alert alert-success" id="{$id|escape:'html':'UTF-8'}-success"></div>
|
||||
</div>
|
||||
<div class="row" style="display:none">
|
||||
<div class="alert alert-danger" id="{$id|escape:'html':'UTF-8'}-errors"></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function humanizeSize(bytes)
|
||||
{
|
||||
if (typeof bytes !== 'number') {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (bytes >= 1000000000) {
|
||||
return (bytes / 1000000000).toFixed(2) + ' GB';
|
||||
}
|
||||
|
||||
if (bytes >= 1000000) {
|
||||
return (bytes / 1000000).toFixed(2) + ' MB';
|
||||
}
|
||||
|
||||
return (bytes / 1000).toFixed(2) + ' KB';
|
||||
}
|
||||
|
||||
$( document ).ready(function() {
|
||||
{if isset($multiple) && isset($max_files)}
|
||||
var {$id|escape:'html':'UTF-8'}_max_files = {$max_files - $files|count};
|
||||
{/if}
|
||||
|
||||
{if isset($files) && $files}
|
||||
$('#{$id|escape:'html':'UTF-8'}-images-thumbnails').parent().show();
|
||||
{/if}
|
||||
|
||||
var {$id|escape:'html':'UTF-8'}_upload_button = Ladda.create( document.querySelector('#{$id|escape:'html':'UTF-8'}-upload-button' ));
|
||||
var {$id|escape:'html':'UTF-8'}_total_files = 0;
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}').fileupload({
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
autoUpload: false,
|
||||
singleFileUploads: true,
|
||||
maxFileSize: {$post_max_size},
|
||||
start: function (e) {
|
||||
{$id|escape:'html':'UTF-8'}_upload_button.start();
|
||||
$('#{$id|escape:'html':'UTF-8'}-upload-button').unbind('click'); //Important as we bind it for every elements in add function
|
||||
},
|
||||
fail: function (e, data) {
|
||||
$('#{$id|escape:'html':'UTF-8'}-errors').html(data.errorThrown.message).parent().show();
|
||||
$('#{$id|escape:'html':'UTF-8'}-files-list').html('').parent().hide();
|
||||
},
|
||||
done: function (e, data) {
|
||||
if (data.result) {
|
||||
if (typeof data.result.{$name|escape:'html':'UTF-8'} !== 'undefined') {
|
||||
for (var i=0; i<data.result.{$name|escape:'html':'UTF-8'}.length; i++) {
|
||||
if (typeof data.result.{$name|escape:'html':'UTF-8'}[i].error !== 'undefined' && data.result.{$name|escape:'html':'UTF-8'}[i].error != '') {
|
||||
$('#{$id|escape:'html':'UTF-8'}-errors').html('<strong>'+data.result.{$name|escape:'html':'UTF-8'}[i].name+'</strong> : '+data.result.{$name|escape:'html':'UTF-8'}[i].error).parent().show();
|
||||
$('#{$id|escape:'html':'UTF-8'}-files-list').html('').parent().hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$(data.context).appendTo($('#{$id|escape:'html':'UTF-8'}-success'));
|
||||
$('#{$id|escape:'html':'UTF-8'}-success').parent().show();
|
||||
|
||||
if (data.result.{$name|escape:'html':'UTF-8'}[i] !== null && data.result.{$name|escape:'html':'UTF-8'}[i].status == 'ok')
|
||||
{
|
||||
var response = data.result.{$name|escape:'html':'UTF-8'}[i];
|
||||
var cover = "icon-check-empty";
|
||||
var legend = '';
|
||||
|
||||
if (response.cover == "1")
|
||||
cover = "icon-check-sign";
|
||||
|
||||
if (typeof response.legend !== 'undefined' && response.legend != null)
|
||||
legend = response.legend[{$default_language|intval}];
|
||||
|
||||
imageLine(response.id, response.path, response.position, cover, response.shops, legend);
|
||||
$("#countImage").html(parseInt($("#countImage").html()) + 1);
|
||||
$("#img" + id).remove();
|
||||
$("#imageTable").tableDnDUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$(data.context).find('button').remove();
|
||||
}
|
||||
},
|
||||
}).on('fileuploadalways', function (e, data) {
|
||||
{$id|escape:'html':'UTF-8'}_total_files--;
|
||||
|
||||
if ({$id|escape:'html':'UTF-8'}_total_files == 0)
|
||||
{
|
||||
{$id|escape:'html':'UTF-8'}_upload_button.stop();
|
||||
$('#{$id|escape:'html':'UTF-8'}-upload-button').unbind('click');
|
||||
$('#{$id|escape:'html':'UTF-8'}-files-list').parent().hide();
|
||||
}
|
||||
}).on('fileuploadadd', function(e, data) {
|
||||
if (typeof {$id|escape:'html':'UTF-8'}_max_files !== 'undefined') {
|
||||
if ({$id|escape:'html':'UTF-8'}_total_files >= {$id|escape:'html':'UTF-8'}_max_files) {
|
||||
e.preventDefault();
|
||||
alert('{l s='You can upload a maximum of %s files'|sprintf:$max_files}');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
data.context = $('<div/>').addClass('form-group').appendTo($('#{$id|escape:'html':'UTF-8'}-files-list'));
|
||||
var file_name = $('<span/>').append('<i class="icon-picture-o"></i> <strong>'+data.files[0].name+'</strong> ('+humanizeSize(data.files[0].size)+')').appendTo(data.context);
|
||||
|
||||
var button = $('<button/>').addClass('btn btn-default pull-right').prop('type', 'button').html('<i class="icon-trash"></i> {l s='Remove file'}').appendTo(data.context).on('click', function() {
|
||||
{$id|escape:'html':'UTF-8'}_total_files--;
|
||||
data.files = null;
|
||||
|
||||
var total_elements = $(this).parent().siblings('div.form-group').length;
|
||||
$(this).parent().remove();
|
||||
|
||||
if (total_elements == 0) {
|
||||
$('#{$id|escape:'html':'UTF-8'}-files-list').html('').parent().hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}-files-list').parent().show();
|
||||
$('#{$id|escape:'html':'UTF-8'}-upload-button').show().bind('click', function () {
|
||||
if (data.files != null)
|
||||
data.submit();
|
||||
});
|
||||
|
||||
{$id|escape:'html':'UTF-8'}_total_files++;
|
||||
}).on('fileuploadprocessalways', function (e, data) {
|
||||
var index = data.index, file = data.files[index];
|
||||
|
||||
if (file.error) {
|
||||
$('#{$id|escape:'html':'UTF-8'}-errors').append('<div class="form-group"><i class="icon-picture-o"></i> <strong>'+file.name+'</strong> ('+humanizeSize(file.size)+') : '+file.error+'</div>').parent().show();
|
||||
$('#{$id|escape:'html':'UTF-8'}-files-list').html('').parent().hide();
|
||||
$(data.context).find('button').trigger('click');
|
||||
}
|
||||
}).on('fileuploadsubmit', function (e, data) {
|
||||
var params = new Object();
|
||||
|
||||
$('input[id^="legend_"]').each(function()
|
||||
{
|
||||
id = $(this).prop("id").replace("legend_", "legend[") + "]";
|
||||
params[id] = $(this).val();
|
||||
});
|
||||
|
||||
data.formData = params;
|
||||
});
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}-add-button').on('click', function() {
|
||||
$('#{$id|escape:'html':'UTF-8'}-success').html('').parent().hide();
|
||||
$('#{$id|escape:'html':'UTF-8'}-errors').html('').parent().hide();
|
||||
$('#{$id|escape:'html':'UTF-8'}').trigger('click');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,119 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<div class="col-lg-8">
|
||||
<input id="{$id|escape:'html':'UTF-8'}" type="file" name="{$name|escape:'html':'UTF-8'}"{if isset($url)} data-url="{$url|escape:'html':'UTF-8'}"{/if} class="hide" />
|
||||
<button class="btn btn-default" data-style="expand-right" data-size="s" type="button" id="{$id|escape:'html':'UTF-8'}-add-button">
|
||||
<i class="icon-plus-sign"></i> {l s='Add file'}
|
||||
</button>
|
||||
<!--
|
||||
<div class="alert alert-success" id="{$id|escape:'html':'UTF-8'}-success" style="display:none">{l s='Upload successful'}</div>
|
||||
<div class="alert alert-danger" id="{$id|escape:'html':'UTF-8'}-errors" style="display:none"></div>
|
||||
-->
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function humanizeSize(bytes)
|
||||
{
|
||||
if (typeof bytes !== 'number') {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (bytes >= 1000000000) {
|
||||
return (bytes / 1000000000).toFixed(2) + ' GB';
|
||||
}
|
||||
|
||||
if (bytes >= 1000000) {
|
||||
return (bytes / 1000000).toFixed(2) + ' MB';
|
||||
}
|
||||
|
||||
return (bytes / 1000).toFixed(2) + ' KB';
|
||||
}
|
||||
|
||||
$( document ).ready(function() {
|
||||
var {$id|escape:'html':'UTF-8'}_add_button = Ladda.create( document.querySelector('#{$id|escape:'html':'UTF-8'}-add-button' ));
|
||||
var {$id|escape:'html':'UTF-8'}_total_files = 0;
|
||||
var success_message = '{l s='Upload successful' js=1}';
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}').fileupload({
|
||||
dataType: 'json',
|
||||
autoUpload: true,
|
||||
singleFileUploads: true,
|
||||
maxFileSize: {$post_max_size},
|
||||
success: function (e) {
|
||||
//showSuccessMessage(success_message);
|
||||
},
|
||||
start: function (e) {
|
||||
{$id|escape:'html':'UTF-8'}_add_button.start();
|
||||
},
|
||||
fail: function (e, data) {
|
||||
showErrorMessage(data.errorThrown.message);
|
||||
},
|
||||
done: function (e, data) {
|
||||
if (data.result) {
|
||||
if (typeof data.result.attachment_file !== 'undefined') {
|
||||
if (typeof data.result.attachment_file.error !== 'undefined' && data.result.attachment_file.error.length > 0)
|
||||
$.each(data.result.attachment_file.error, function(index, error) {
|
||||
showErrorMessage(data.result.attachment_file.name + ' : ' + error);
|
||||
});
|
||||
else {
|
||||
showSuccessMessage(success_message);
|
||||
$('#selectAttachment2').append('<option value="'+data.result.attachment_file.id_attachment+'">'+data.result.attachment_file.filename+'</option>');
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}).on('fileuploadalways', function (e, data) {
|
||||
{$id|escape:'html':'UTF-8'}_add_button.stop();
|
||||
}).on('fileuploadprocessalways', function (e, data) {
|
||||
var index = data.index, file = data.files[index];
|
||||
//if (file.error)
|
||||
//$('#{$id|escape:'html':'UTF-8'}-errors').append('<div class="row"><strong>'+file.name+'</strong> ('+humanizeSize(file.size)+') : '+file.error+'</div>').show();
|
||||
}).on('fileuploadsubmit', function (e, data) {
|
||||
var params = new Object();
|
||||
|
||||
$('input[id^="attachment_name_"]').each(function()
|
||||
{
|
||||
id = $(this).prop("id").replace("attachment_name_", "attachment_name[") + "]";
|
||||
params[id] = $(this).val();
|
||||
});
|
||||
|
||||
$('textarea[id^="attachment_description_"]').each(function()
|
||||
{
|
||||
id = $(this).prop("id").replace("attachment_description_", "attachment_description[") + "]";
|
||||
params[id] = $(this).val();
|
||||
});
|
||||
|
||||
|
||||
data.formData = params;
|
||||
});
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}-add-button').on('click', function() {
|
||||
//$('#{$id|escape:'html':'UTF-8'}-success').hide();
|
||||
//$('#{$id|escape:'html':'UTF-8'}-errors').html('').hide();
|
||||
{$id|escape:'html':'UTF-8'}_total_files = 0;
|
||||
$('#{$id|escape:'html':'UTF-8'}').trigger('click');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../../../../../../');
|
||||
exit;
|
||||
@@ -0,0 +1,142 @@
|
||||
{*
|
||||
* 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($files) && $files|count > 0}
|
||||
{assign var='show_thumbnail' value=false}
|
||||
{foreach $files as $file}
|
||||
{if isset($file.image) && $file.type == 'image'}
|
||||
{assign var='show_thumbnail' value=true}
|
||||
{/if}
|
||||
{/foreach}
|
||||
{if $show_thumbnail}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-12" id="{$id|escape:'html':'UTF-8'}-images-thumbnails">
|
||||
{foreach $files as $file}
|
||||
{if isset($file.image) && $file.type == 'image'}
|
||||
<div class="img-thumbnail text-center">
|
||||
<p>{$file.image}</p>
|
||||
{if isset($file.size)}<p>{l s='File size'} {$file.size}kb</p>{/if}
|
||||
{if isset($file.delete_url)}
|
||||
<p>
|
||||
<a class="btn btn-default" href="{$file.delete_url}">
|
||||
<i class="icon-trash"></i> {l s='Delete'}
|
||||
</a>
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
{if isset($max_files) && $files|count >= $max_files}
|
||||
<div class="row">
|
||||
<div class="alert alert-warning">{l s='You have reached the limit (%s) of files to upload, please remove files to continue uploading' sprintf=$max_files}</div>
|
||||
</div>
|
||||
{else}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-12">
|
||||
<input id="{$id|escape:'html':'UTF-8'}" type="file" name="{$name|escape:'html':'UTF-8'}"{if isset($multiple) && $multiple} multiple="multiple"{/if} class="hide"/>
|
||||
<div class="dummyfile input-group">
|
||||
<span class="input-group-addon"><i class="icon-file"></i></span>
|
||||
<input id="{$id|escape:'html':'UTF-8'}-name" type="text" name="filename" readonly />
|
||||
<span class="input-group-btn">
|
||||
<button id="{$id|escape:'html':'UTF-8'}-selectbutton" type="button" name="submitAddAttachments" class="btn btn-default">
|
||||
<i class="icon-folder-open"></i> {if isset($multiple) && $multiple}{l s='Add files'}{else}{l s='Add file'}{/if}
|
||||
</button>
|
||||
{if (!isset($multiple) || !$multiple) && isset($files) && $files|count == 1 && isset($files[0].download_url)}
|
||||
<a href="{$files[0].download_url|escape:'html':'UTF-8'}" class="btn btn-default">
|
||||
<i class="icon-cloud-download"></i>
|
||||
{if isset($size)}{l s='Download current file (%skb)' sprintf=$size}{else}{l s='Download current file'}{/if}
|
||||
</a>
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
{if isset($multiple) && isset($max_files)}
|
||||
var {$id|escape:'html':'UTF-8'}_max_files = {$max_files - $files|count};
|
||||
{/if}
|
||||
|
||||
$(document).ready(function(){
|
||||
$('#{$id|escape:'html':'UTF-8'}-selectbutton').click(function(e) {
|
||||
$('#{$id|escape:'html':'UTF-8'}').trigger('click');
|
||||
});
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}-name').click(function(e) {
|
||||
$('#{$id|escape:'html':'UTF-8'}').trigger('click');
|
||||
});
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}-name').on('dragenter', function(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}-name').on('dragover', function(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}-name').on('drop', function(e) {
|
||||
e.preventDefault();
|
||||
var files = e.originalEvent.dataTransfer.files;
|
||||
$('#{$id|escape:'html':'UTF-8'}')[0].files = files;
|
||||
$(this).val(files[0].name);
|
||||
});
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}').change(function(e) {
|
||||
if ($(this)[0].files !== undefined)
|
||||
{
|
||||
var files = $(this)[0].files;
|
||||
var name = '';
|
||||
|
||||
$.each(files, function(index, value) {
|
||||
name += value.name+', ';
|
||||
});
|
||||
|
||||
$('#{$id|escape:'html':'UTF-8'}-name').val(name.slice(0, -2));
|
||||
$('#virtual_product_name').val(name.slice(0, -2));
|
||||
}
|
||||
else // Internet Explorer 9 Compatibility
|
||||
{
|
||||
var name = $(this).val().split(/[\\/]/);
|
||||
$('#{$id|escape:'html':'UTF-8'}-name').val(name[name.length-1]);
|
||||
$('#virtual_product_name').val(name[name.length-1]);
|
||||
}
|
||||
});
|
||||
|
||||
if (typeof {$id|escape:'html':'UTF-8'}_max_files !== 'undefined')
|
||||
{
|
||||
$('#{$id|escape:'html':'UTF-8'}').closest('form').on('submit', function(e) {
|
||||
if ($('#{$id|escape:'html':'UTF-8'}')[0].files.length > {$id|escape:'html':'UTF-8'}_max_files) {
|
||||
e.preventDefault();
|
||||
alert('{l s='You can upload a maximum of %s files'|sprintf:$max_files}');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/if}
|
||||
@@ -0,0 +1,356 @@
|
||||
{*
|
||||
* 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($id_product) && isset($product)}
|
||||
<div id="product-images" class="panel product-tab">
|
||||
<input type="hidden" name="submitted_tabs[]" value="Images" />
|
||||
<div class="panel-heading tab" >
|
||||
{l s='Images'}
|
||||
<span class="badge" id="countImage">{$countImages}</span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3 file_upload_label">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='Format:'} JPG, GIF, PNG. {l s='Filesize:'} {$max_image_size|string_format:"%.2f"} {l s='MB max.'}">
|
||||
{if isset($id_image)}{l s='Edit this product\'s image:'}{else}{l s='Add a new image to this product'}{/if}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
{$image_uploader}
|
||||
</div>
|
||||
<div class="col-lg-9 col-lg-offset-3">
|
||||
<div class="help-block">{l s='Please upload a square image (Recommended resolution 800 x 800px)'}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='Update all captions at once, or select the position of the image whose caption you wish to edit. Invalid characters: %s' sprintf=['<>;=#{}']}">
|
||||
{l s='Caption'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-4">
|
||||
{foreach from=$languages item=language}
|
||||
{if $languages|count > 1}
|
||||
<div class="translatable-field row lang-{$language.id_lang}">
|
||||
<div class="col-lg-8">
|
||||
{/if}
|
||||
<input type="text" id="legend_{$language.id_lang}"{if isset($input_class)} class="{$input_class}"{/if} name="legend_{$language.id_lang}" value="{if $images|count}{$images[0]->legend[$language.id_lang]|escape:'html':'UTF-8'}{else}{$product->name[$language.id_lang]|escape:'html':'UTF-8'}{/if}"{if !$product->id} disabled="disabled"{/if}/>
|
||||
{if $languages|count > 1}
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" tabindex="-1">
|
||||
{$language.iso_code}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{foreach from=$languages item=language}
|
||||
<li>
|
||||
<a href="javascript:hideOtherLanguage({$language.id_lang});">{$language.name}</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</div>
|
||||
<div class="col-lg-2{if $images|count <= 1} hidden{/if}" id="caption_selection">
|
||||
<select name="id_caption">
|
||||
<option value="0">{l s='All captions'}</option>
|
||||
{foreach from=$images item=image}
|
||||
<option value="{$image->id_image|intval}">
|
||||
{l s='Position %d' sprintf=$image->position|intval}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<button type="submit" class="btn btn-default" name="submitAddproductAndStay" value="update_legends"><i class="icon-random"></i> {l s='Update'}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table tableDnD" id="imageTable">
|
||||
<thead>
|
||||
<tr class="nodrag nodrop">
|
||||
<th class="fixed-width-lg"><span class="title_box">{l s='Image'}</span></th>
|
||||
<th class="fixed-width-lg"><span class="title_box">{l s='Caption'}</span></th>
|
||||
<th class="fixed-width-xs"><span class="title_box">{l s='Position'}</span></th>
|
||||
{if $shops}
|
||||
{foreach from=$shops item=shop}
|
||||
<th class="fixed-width-xs"><span class="title_box">{$shop.name}</span></th>
|
||||
{/foreach}
|
||||
{/if}
|
||||
<th class="fixed-width-xs"><span class="title_box">{l s='Cover'}</span></th>
|
||||
<th></th> <!-- action -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="imageList">
|
||||
</tbody>
|
||||
</table>
|
||||
<table id="lineType" style="display:none;">
|
||||
<tr id="image_id">
|
||||
<td>
|
||||
<a href="{$link->getMediaLink("`$smarty.const._THEME_PROD_DIR_`image_path.jpg")}" class="fancybox"> {* by webkul to get media link *}
|
||||
<img
|
||||
src="{$link->getMediaLink("`$smarty.const._THEME_PROD_DIR_`$iso_lang-default-`$imageType`.jpg")}"
|
||||
alt="legend"
|
||||
title="legend"
|
||||
class="img-thumbnail" />
|
||||
</a>
|
||||
</td>
|
||||
<td>legend</td>
|
||||
<td id="td_image_id" class="pointer dragHandle center positionImage">
|
||||
<div class="dragGroup">
|
||||
<div class="positions">
|
||||
image_position
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
{if $shops}
|
||||
{foreach from=$shops item=shop}
|
||||
<td>
|
||||
<input
|
||||
type="checkbox"
|
||||
class="image_shop"
|
||||
name="id_image"
|
||||
id="{$shop.id_shop}image_id"
|
||||
value="{$shop.id_shop}" />
|
||||
</td>
|
||||
{/foreach}
|
||||
{/if}
|
||||
<td class="cover">
|
||||
<a href="#">
|
||||
<i class="icon-check-empty icon-2x covered"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="#" class="delete_product_image pull-right btn btn-default" >
|
||||
<i class="icon-trash"></i> {l s='Delete this image'}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="panel-footer">
|
||||
<a href="{$link->getAdminLink('AdminNormalProducts')|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 upbutton = '{l s='Upload an image'}';
|
||||
var come_from = '{$table}';
|
||||
var success_add = '{l s='The image has been successfully added.'}';
|
||||
var id_tmp = 0;
|
||||
var current_shop_id = {$current_shop_id|intval};
|
||||
{literal}
|
||||
//Ready Function
|
||||
|
||||
function imageLine(id, path, position, cover, shops, legend)
|
||||
{
|
||||
line = $("#lineType").html();
|
||||
line = line.replace(/image_id/g, id);
|
||||
line = line.replace(/(\/)?[a-z]{0,2}-default/g, function($0, $1){
|
||||
return $1 ? $1 + path : $0;
|
||||
});
|
||||
line = line.replace(/image_path/g, path);
|
||||
line = line.replace(/\.jpg"\s/g, '.jpg?time=' + new Date().getTime() + '" ');
|
||||
line = line.replace(/image_position/g, position);
|
||||
line = line.replace(/legend/g, legend);
|
||||
line = line.replace(/icon-check-empty/g, cover);
|
||||
line = line.replace(/<tbody>/gi, "");
|
||||
line = line.replace(/<\/tbody>/gi, "");
|
||||
if (shops != false)
|
||||
{
|
||||
$.each(shops, function(key, value){
|
||||
if (value == 1)
|
||||
line = line.replace('id="' + key + '' + id + '"','id="' + key + '' + id + '" checked=checked');
|
||||
});
|
||||
}
|
||||
$("#imageList").append(line);
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
{/literal}
|
||||
{foreach from=$images item=image}
|
||||
assoc = {literal}"{"{/literal};
|
||||
{if $shops}
|
||||
{foreach from=$shops item=shop}
|
||||
assoc += '"{$shop.id_shop}" : {if $image->isAssociatedToShop($shop.id_shop)}1{else}0{/if},';
|
||||
{/foreach}
|
||||
{/if}
|
||||
if (assoc != {literal}"{"{/literal})
|
||||
{
|
||||
assoc = assoc.slice(0, -1);
|
||||
assoc += {literal}"}"{/literal};
|
||||
assoc = jQuery.parseJSON(assoc);
|
||||
}
|
||||
else
|
||||
assoc = false;
|
||||
imageLine({$image->id}, "{$image->getExistingImgPath()}", {$image->position}, "{if $image->cover}icon-check-sign{else}icon-check-empty{/if}", assoc, "{$image->legend[$default_language]|escape:'htmlall'}");
|
||||
{/foreach}
|
||||
{literal}
|
||||
var originalOrder = false;
|
||||
|
||||
$("#imageTable").tableDnD(
|
||||
{ dragHandle: 'dragHandle',
|
||||
onDragClass: 'myDragClass',
|
||||
onDragStart: function(table, row) {
|
||||
originalOrder = $.tableDnD.serialize();
|
||||
reOrder = ':even';
|
||||
if (table.tBodies[0].rows[1] && $('#' + table.tBodies[0].rows[1].id).hasClass('alt_row'))
|
||||
reOrder = ':odd';
|
||||
$(table).find('#' + row.id).parent('tr').addClass('myDragClass');
|
||||
},
|
||||
onDrop: function(table, row) {
|
||||
if (originalOrder != $.tableDnD.serialize()) {
|
||||
current = $(row).attr("id");
|
||||
stop = false;
|
||||
image_up = "{";
|
||||
$("#imageList").find("tr").each(function(i) {
|
||||
$("#td_" + $(this).attr("id")).html('<div class="dragGroup"><div class="positions">'+(i + 1)+'</div></div>');
|
||||
if (!stop || (i + 1) == 2)
|
||||
image_up += '"' + $(this).attr("id") + '" : ' + (i + 1) + ',';
|
||||
});
|
||||
image_up = image_up.slice(0, -1);
|
||||
image_up += "}";
|
||||
updateImagePosition(image_up);
|
||||
}
|
||||
}
|
||||
});
|
||||
/**
|
||||
* on success function
|
||||
*/
|
||||
function afterDeleteProductImage(data)
|
||||
{
|
||||
data = $.parseJSON(data);
|
||||
if (data)
|
||||
{
|
||||
cover = 0;
|
||||
id = data.content.id;
|
||||
if (data.status == 'ok')
|
||||
{
|
||||
if ($("#" + id + ' .covered').hasClass('icon-check-sign'))
|
||||
cover = 1;
|
||||
$("#" + id).remove();
|
||||
}
|
||||
if (cover)
|
||||
$("#imageTable tr").eq(1).find(".covered").addClass('icon-check-sign');
|
||||
$("#countImage").html(parseInt($("#countImage").html()) - 1);
|
||||
refreshImagePositions($("#imageTable"));
|
||||
showSuccessMessage(data.confirmations);
|
||||
|
||||
if (parseInt($("#countImage").html()) <= 1)
|
||||
$('#caption_selection').addClass('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
$('.delete_product_image').die().live('click', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
id = $(this).parent().parent().attr('id');
|
||||
if (confirm("{/literal}{l s='Delete selected item?' js=1}{literal}"))
|
||||
doAdminAjax({
|
||||
"action":"deleteProductImage",
|
||||
"id_image":id,
|
||||
"id_product" : {/literal}{$id_product}{literal},
|
||||
"id_category" : {/literal}{$id_category_default}{literal},
|
||||
"token" : "{/literal}{$token|escape:'html':'UTF-8'}{literal}",
|
||||
"tab" : "AdminNormalProducts",
|
||||
"ajax" : 1 }, afterDeleteProductImage
|
||||
);
|
||||
});
|
||||
|
||||
$('.covered').die().live('click', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
id = $(this).parent().parent().parent().attr('id');
|
||||
$("#imageList .cover i").each( function(i){
|
||||
$(this).removeClass('icon-check-sign').addClass('icon-check-empty');
|
||||
});
|
||||
$(this).removeClass('icon-check-empty').addClass('icon-check-sign');
|
||||
|
||||
if (current_shop_id != 0)
|
||||
$('#' + current_shop_id + id).attr('check', true);
|
||||
else
|
||||
$(this).parent().parent().parent().children('td input').attr('check', true);
|
||||
doAdminAjax({
|
||||
"action":"UpdateCover",
|
||||
"id_image":id,
|
||||
"id_product" : {/literal}{$id_product}{literal},
|
||||
"token" : "{/literal}{$token|escape:'html':'UTF-8'}{literal}",
|
||||
"controller" : "AdminNormalProducts",
|
||||
"ajax" : 1 }
|
||||
);
|
||||
});
|
||||
|
||||
$('.image_shop').die().live('click', function()
|
||||
{
|
||||
active = false;
|
||||
if ($(this).attr("checked"))
|
||||
active = true;
|
||||
id = $(this).parent().parent().attr('id');
|
||||
id_shop = $(this).attr("id").replace(id, "");
|
||||
doAdminAjax(
|
||||
{
|
||||
"action":"UpdateProductImageShopAsso",
|
||||
"id_image":id,
|
||||
"id_product":id_product,
|
||||
"id_shop": id_shop,
|
||||
"active":active,
|
||||
"token" : "{/literal}{$token|escape:'html':'UTF-8'}{literal}",
|
||||
"tab" : "AdminNormalProducts",
|
||||
"ajax" : 1
|
||||
});
|
||||
});
|
||||
|
||||
function updateImagePosition(json)
|
||||
{
|
||||
doAdminAjax(
|
||||
{
|
||||
"action":"updateImagePosition",
|
||||
"json":json,
|
||||
"token" : "{/literal}{$token|escape:'html':'UTF-8'}{literal}",
|
||||
"tab" : "AdminNormalProducts",
|
||||
"ajax" : 1
|
||||
});
|
||||
}
|
||||
|
||||
function delQueue(id)
|
||||
{
|
||||
$("#img" + id).fadeOut("slow");
|
||||
$("#img" + id).remove();
|
||||
}
|
||||
|
||||
|
||||
$('.fancybox').fancybox();
|
||||
});
|
||||
if (tabs_manager.allow_hide_other_languages)
|
||||
hideOtherLanguage(default_language);
|
||||
{/literal}
|
||||
</script>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../../../../');
|
||||
exit;
|
||||
@@ -0,0 +1,601 @@
|
||||
{*
|
||||
* 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 $check_product_association_ajax}
|
||||
{assign var=class_input_ajax value='check_product_name '}
|
||||
{else}
|
||||
{assign var=class_input_ajax value=''}
|
||||
{/if}
|
||||
|
||||
<div id="product-informations" class="panel product-tab">
|
||||
<input type="hidden" name="submitted_tabs[]" value="Informations" />
|
||||
<h3 class="tab"> <i class="icon-info"></i> {l s='Information'}</h3>
|
||||
<script type="text/javascript">
|
||||
|
||||
var msg_select_one = "{l s='Please select at least one room type.' js=1}";
|
||||
var msg_set_quantity = "{l s='Please set a quantity to add a room type.' js=1}";
|
||||
|
||||
{if isset($ps_force_friendly_product) && $ps_force_friendly_product}
|
||||
var ps_force_friendly_product = 1;
|
||||
{else}
|
||||
var ps_force_friendly_product = 0;
|
||||
{/if}
|
||||
{if isset($PS_ALLOW_ACCENTED_CHARS_URL) && $PS_ALLOW_ACCENTED_CHARS_URL}
|
||||
var PS_ALLOW_ACCENTED_CHARS_URL = 1;
|
||||
{else}
|
||||
var PS_ALLOW_ACCENTED_CHARS_URL = 0;
|
||||
{/if}
|
||||
{$combinationImagesJs}
|
||||
{if $check_product_association_ajax}
|
||||
var search_term = '';
|
||||
$('document').ready( function() {
|
||||
$(".check_product_name")
|
||||
.autocomplete(
|
||||
'{$link->getAdminLink('AdminNormalProducts', true)|addslashes}', {
|
||||
minChars: 3,
|
||||
max: 10,
|
||||
width: $(".check_product_name").width(),
|
||||
selectFirst: false,
|
||||
scroll: false,
|
||||
dataType: "json",
|
||||
formatItem: function(data, i, max, value, term) {
|
||||
search_term = term;
|
||||
// adding the little
|
||||
if ($('.ac_results').find('.separation').length == 0)
|
||||
$('.ac_results').css('background-color', '#EFEFEF')
|
||||
.prepend('<div style="color:#585A69; padding:2px 5px">{l s='Use a product from the list'}<div class="separation"></div></div>');
|
||||
return value;
|
||||
},
|
||||
parse: function(data) {
|
||||
var mytab = new Array();
|
||||
for (var i = 0; i < data.length; i++)
|
||||
mytab[mytab.length] = { data: data[i], value: data[i].name };
|
||||
return mytab;
|
||||
},
|
||||
extraParams: {
|
||||
ajax: 1,
|
||||
action: 'checkProductName',
|
||||
id_lang: {$id_lang}
|
||||
}
|
||||
}
|
||||
)
|
||||
.result(function(event, data, formatted) {
|
||||
// keep the searched term in the input
|
||||
$('#name_{$id_lang}').val(search_term);
|
||||
jConfirm('{l s='Do you want to use this product?'} <strong>'+data.name+'</strong>', '{l s='Confirmation'}', function(confirm){
|
||||
if (confirm == true)
|
||||
document.location.href = '{$link->getAdminLink('AdminNormalProducts', true)}&updateproduct&id_product='+data.id_product;
|
||||
else
|
||||
return false;
|
||||
});
|
||||
});
|
||||
});
|
||||
{/if}
|
||||
</script>
|
||||
|
||||
{if isset($display_common_field) && $display_common_field}
|
||||
<div class="alert alert-warning" style="display: block">{l s='Warning, if you change the value of fields with an orange bullet %s, the value will be changed for all other shops for this product' sprintf=$bullet_common_field}</div>
|
||||
{/if}
|
||||
|
||||
{include file="controllers/products/multishop/check_fields.tpl" product_tab="Informations"}
|
||||
|
||||
<div id="product-pack-container" {if $product_type != Product::PTYPE_PACK}style="display:none"{/if}></div>
|
||||
|
||||
{*<hr />*}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="name" type="default" multilang="true"}</span></div>
|
||||
<label class="control-label col-lg-2 required" id="name" for="name_{$id_lang}">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Write the name of the Product for ex. water bottle, etc.'} {l s='Invalid characters:'} <>;=#{}">
|
||||
{l s='Name'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-5">
|
||||
{include file="controllers/products/input_text_lang.tpl"
|
||||
languages=$languages
|
||||
input_class="{$class_input_ajax}{if !$product->id || Configuration::get('PS_FORCE_FRIENDLY_PRODUCT')}copy2friendlyUrl{/if} updateCurrentText"
|
||||
input_value=$product->name
|
||||
input_name="name"
|
||||
required=true
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group hidden">
|
||||
<label class="control-label col-lg-3" for="reference">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='Your internal reference code for this product.'} {l s='Allowed special characters:'} .-_#\">
|
||||
{$bullet_common_field} {l s='Reference code'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-5">
|
||||
<input type="text" id="reference" name="reference" value="{$product->reference|htmlentitiesUTF8}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group hidden">
|
||||
<label class="control-label col-lg-3" for="ean13">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='This type of product code is specific to Europe and Japan, but is widely used internationally. It is a superset of the UPC code: all products marked with an EAN will be accepted in North America.'}">
|
||||
{$bullet_common_field} {l s='EAN-13 or JAN barcode'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-3">
|
||||
<input maxlength="13" type="text" id="ean13" name="ean13" value="{$product->ean13|htmlentitiesUTF8}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group hidden">
|
||||
<label class="control-label col-lg-3" for="upc">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='This type of product code is widely used in the United States, Canada, the United Kingdom, Australia, New Zealand and in other countries.'}">
|
||||
{$bullet_common_field} {l s='UPC barcode'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-3">
|
||||
<input maxlength="12" type="text" id="upc" name="upc" value="{$product->upc|escape:'html':'UTF-8'}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <hr/> -->
|
||||
|
||||
{* status informations *}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="active" type="radio" onclick=""}</span></div>
|
||||
<label class="control-label col-lg-2">
|
||||
{l s='Enabled'}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<span class="switch prestashop-switch fixed-width-lg">
|
||||
<input onclick="toggleDraftWarning(false);showOptions(true);showRedirectProductOptions(false);" type="radio" name="active" id="active_on" value="1" {if $product->active || !$product->isAssociatedToShop()}checked="checked" {/if} />
|
||||
<label for="active_on" class="radioCheck">
|
||||
{l s='Yes'}
|
||||
</label>
|
||||
<input onclick="toggleDraftWarning(true);showOptions(false);showRedirectProductOptions(true);" type="radio" name="active" id="active_off" value="0" {if !$product->active && $product->isAssociatedToShop()}checked="checked"{/if} />
|
||||
<label for="active_off" class="radioCheck">
|
||||
{l s='No'}
|
||||
</label>
|
||||
<a class="slide-button btn"></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group redirect_product_options" style="display:none">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="redirect_type" type="radio" onclick=""}</span></div>
|
||||
<label class="control-label col-lg-2" for="redirect_type">
|
||||
{l s='Redirect when disabled'}
|
||||
</label>
|
||||
<div class="col-lg-5">
|
||||
<select name="redirect_type" id="redirect_type">
|
||||
<option value="404" {if $product->redirect_type == '404'} selected="selected" {/if}>{l s='No redirect (404)'}</option>
|
||||
<option value="301" {if $product->redirect_type == '301'} selected="selected" {/if}>{l s='Redirected permanently (301)'}</option>
|
||||
<option value="302" {if $product->redirect_type == '302'} selected="selected" {/if}>{l s='Redirected temporarily (302)'}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group redirect_product_options" style="display:none">
|
||||
<div class="col-lg-9 col-lg-offset-3">
|
||||
<div class="alert alert-info">
|
||||
{l s='404 Not Found = Do not redirect and display a 404 page.'}<br/>
|
||||
{l s='301 Moved Permanently = Permanently display another product instead.'}<br/>
|
||||
{l s='302 Moved Temporarily = Temporarily display another product instead.'}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group redirect_product_options redirect_product_options_product_choise" style="display:none">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="id_product_redirected" type="radio" onclick=""}</span></div>
|
||||
<label class="control-label col-lg-2" for="related_product_autocomplete_input">
|
||||
{l s='Related product:'}
|
||||
</label>
|
||||
<div class="col-lg-7">
|
||||
<input type="hidden" value="" name="id_product_redirected" />
|
||||
|
||||
<div class="input-group">
|
||||
<input type="text" id="related_product_autocomplete_input" name="related_product_autocomplete_input" autocomplete="off" class="ac_input" />
|
||||
<span class="input-group-addon"><i class="icon-search"></i></span>
|
||||
</div>
|
||||
|
||||
<div class="form-control-static">
|
||||
<span id="related_product_name"><i class="icon-warning-sign"></i> {l s='No related product.'}</span>
|
||||
<span id="related_product_remove" style="display:none">
|
||||
<a class="btn btn-default" href="#" onclick="removeRelatedProduct(); return false" id="related_product_remove_link">
|
||||
<i class="icon-remove text-danger"></i>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
var no_related_product = '{l s='No related product'}';
|
||||
var id_product_redirected = {$product->id_product_redirected|intval};
|
||||
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="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="category_box" type="category_box"}</span></div>
|
||||
<label class="control-label col-lg-2" for="category_block">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select room type and hotels for which this service will be available.'}">
|
||||
{l s='Associated Hotels and Room Types'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<div id="category_block">
|
||||
{$hotel_tree}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="auto_add_to_cart_container">
|
||||
<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'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-3">
|
||||
<span class="switch prestashop-switch fixed-width-lg">
|
||||
<input type="radio" name="auto_add_to_cart" id="auto_add_to_cart_on" value="1" {if $product->auto_add_to_cart}checked="checked"{/if}/>
|
||||
<label for="auto_add_to_cart_on" class="radioCheck">
|
||||
{l s='Yes'}
|
||||
</label>
|
||||
<input type="radio" name="auto_add_to_cart" id="auto_add_to_cart_off" value="0" {if !$product->auto_add_to_cart || !$product->isAssociatedToShop()}checked="checked"{/if}/>
|
||||
<label for="auto_add_to_cart_off" class="radioCheck">
|
||||
{l s='No'}
|
||||
</label>
|
||||
<a class="slide-button btn"></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="price_addition_type_container" {if !$product->auto_add_to_cart || !$product->isAssociatedToShop()}style="display:none;"{/if}>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3" for="service_product_type">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select whether price will be added in the base room price or as Convenience Fee'}">
|
||||
{l s='Price display preference'}
|
||||
<span>
|
||||
</label>
|
||||
<div class="col-lg-4">
|
||||
<select name="price_addition_type" id="price_addition_type">
|
||||
<option value="{Product::PRICE_ADDITION_TYPE_WITH_ROOM}" {if $product->price_addition_type == Product::PRICE_ADDITION_TYPE_WITH_ROOM}selected="selected"{/if} >{l s='Add price in room price'}</option>
|
||||
<option value="{Product::PRICE_ADDITION_TYPE_INDEPENDENT}" {if $product->price_addition_type == Product::PRICE_ADDITION_TYPE_INDEPENDENT}selected="selected"{/if} >{l s='Add price as convenience Fee'}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-8 col-lg-offset-3">
|
||||
<div class="alert alert-info">
|
||||
{l s='Select how this service price will be added in booking.'}
|
||||
<ul>
|
||||
<li>
|
||||
<b>{l s='Add price in room price'}</b> : {l s='Service price will be added in room base price.'}<br>{l s='(e.g., Room price : 500, service price: 50, final room price : 550)'}
|
||||
</li>
|
||||
<li><b>{l s='Add price as convenience fee'}</b> : {l s='Service price will be dispalyed in order summary as "Convenience Fees"'}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</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.'}">
|
||||
{l s='Show at front office'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-3">
|
||||
<span class="switch prestashop-switch fixed-width-lg">
|
||||
<input type="radio" name="show_at_front" id="show_at_front_on" value="1" {if $product->show_at_front || !$product->isAssociatedToShop()}checked="checked"{/if}/>
|
||||
<label for="show_at_front_on" class="radioCheck">
|
||||
{l s='Yes'}
|
||||
</label>
|
||||
<input type="radio" name="show_at_front" id="show_at_front_off" value="0" {if !$product->show_at_front && $product->isAssociatedToShop()}checked="checked"{/if}/>
|
||||
<label for="show_at_front_off" class="radioCheck">
|
||||
{l s='No'}
|
||||
</label>
|
||||
<a class="slide-button btn"></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="available_for_order_container" {if (!$product->show_at_front && $product->isAssociatedToShop()) || $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 sold from front office of your website.'}">
|
||||
{l s='Availabe for order'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-3">
|
||||
<span class="switch prestashop-switch fixed-width-lg">
|
||||
<input type="radio" name="available_for_order" id="available_for_order_on" value="1" {if $product->available_for_order || !$product->isAssociatedToShop()}checked="checked"{/if}/>
|
||||
<label for="available_for_order_on" class="radioCheck">
|
||||
{l s='Yes'}
|
||||
</label>
|
||||
<input type="radio" name="available_for_order" id="available_for_order_off" value="0" {if !$product->available_for_order && $product->isAssociatedToShop()}checked="checked"{/if}/>
|
||||
<label for="available_for_order_off" class="radioCheck">
|
||||
{l s='No'}
|
||||
</label>
|
||||
<a class="slide-button btn"></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="show_price_container" {if $product->available_for_order || (!$product->show_at_front && $product->isAssociatedToShop()) || !$product->isAssociatedToShop() || $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 show product price even when product is not availabe to be sold at front office.'}">
|
||||
{l s='Show price'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-3">
|
||||
<span class="switch prestashop-switch fixed-width-lg">
|
||||
<input type="radio" name="show_price" id="show_price_on" value="1" {if $product->show_price || !$product->isAssociatedToShop()}checked="checked"{/if}/>
|
||||
<label for="show_price_on" class="radioCheck">
|
||||
{l s='Yes'}
|
||||
</label>
|
||||
<input type="radio" name="show_price" id="show_price_off" value="0" {if !$product->show_price && $product->isAssociatedToShop()}checked="checked"{/if}/>
|
||||
<label for="show_price_off" class="radioCheck">
|
||||
{l s='No'}
|
||||
</label>
|
||||
<a class="slide-button btn"></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group hidden">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="visibility" type="default"}</span></div>
|
||||
<label class="control-label col-lg-2" for="visibility">
|
||||
{l s='Visibility'}
|
||||
</label>
|
||||
<div class="col-lg-3">
|
||||
<select name="visibility" id="visibility">
|
||||
<option value="both" {if $product->visibility == 'both'}selected="selected"{/if} >{l s='Everywhere'}</option>
|
||||
<option value="catalog" {if $product->visibility == 'catalog'}selected="selected"{/if} >{l s='Catalog only'}</option>
|
||||
<option value="search" {if $product->visibility == 'search'}selected="selected"{/if} >{l s='Search only'}</option>
|
||||
<option value="none" {if $product->visibility == 'none'}selected="selected"{/if} selected="selected">{l s='Nowhere'}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="allow_multiple_quantity_container" {if (!$product->available_for_order && $product->isAssociatedToShop()) || $product->auto_add_to_cart}style="display:none;"{/if}>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='When enabled, customer can order multiple quantity of product otherwise only one quantity can be purchased by customer per room/hotel'}">
|
||||
{l s='Allow ordering of multiple quantities'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<span class="switch prestashop-switch fixed-width-lg">
|
||||
<input type="radio" name="allow_multiple_quantity" id="allow_multiple_quantity_on"{if $product->allow_multiple_quantity}checked="checked"{/if} value="1"/>
|
||||
<label for="allow_multiple_quantity_on" class="radioCheck">
|
||||
{l s='Yes'}
|
||||
</label>
|
||||
<input type="radio" name="allow_multiple_quantity" id="allow_multiple_quantity_off"{if !$product->allow_multiple_quantity}checked="checked"{/if} value="0"/>
|
||||
<label for="allow_multiple_quantity_off" class="radioCheck">
|
||||
{l s='No'}
|
||||
</label>
|
||||
<a class="slide-button btn"></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="max_quantity_container" class="form-group" {if (!$product->available_for_order && $product->isAssociatedToShop()) || $product->auto_add_to_cart || !$product->allow_multiple_quantity}style="display:none;"{/if}>
|
||||
<label class="control-label col-lg-3" for="max_quantity">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='Enter max allowed quantity per room, enter 0 for unlimited.'}">
|
||||
{l s='Max quantity allow'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-3">
|
||||
<input type="text" id="max_quantity" name="max_quantity" value="{$product->max_quantity|escape:'html':'UTF-8'}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-6 col-lg-offset-3">
|
||||
<div class="alert alert-info">
|
||||
{l s='By default all products have infinte quantity, Using this setting you can restrict customer to purchase only one product per room.'}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="description_short" type="tinymce" multilang="true"}</span></div>
|
||||
<label class="control-label col-lg-2" for="description_short_{$id_lang}">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Appears in the product list(s), and at the top of the product page.'}">
|
||||
{l s='Short description'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
{include
|
||||
file="controllers/products/textarea_lang.tpl"
|
||||
languages=$languages
|
||||
input_name='description_short'
|
||||
class="autoload_rte"
|
||||
input_value=$product->description_short
|
||||
max=$PS_PRODUCT_SHORT_DESC_LIMIT}
|
||||
</div>
|
||||
</div>
|
||||
{* <div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="description" type="tinymce" multilang="true"}</span></div>
|
||||
<label class="control-label col-lg-2" for="description_{$id_lang}">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='Appears in the body of the room type.'}">
|
||||
{l s='Description'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
{include
|
||||
file="controllers/products/textarea_lang.tpl"
|
||||
languages=$languages input_name='description'
|
||||
class="autoload_rte"
|
||||
input_value=$product->description}
|
||||
</div>
|
||||
</div>
|
||||
{if $images}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-9 col-lg-offset-3">
|
||||
<div class="alert alert-info">
|
||||
{capture}<a class="addImageDescription" href="javascript:void(0);">{l s='Click here'}</a>{/capture}
|
||||
{l s='Would you like to add an image in your description? %s and paste the given tag in the description.' sprintf=$smarty.capture.default}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="createImageDescription" class="panel" style="display:none">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3" for="smallImage_0">{l s='Select your image'}</label>
|
||||
<div class="col-lg-9">
|
||||
<ul class="list-inline">
|
||||
{foreach from=$images item=image key=key}
|
||||
<li>
|
||||
<input type="radio" name="smallImage" id="smallImage_{$key}" value="{$image.id_image}" {if $key == 0}checked="checked"{/if} >
|
||||
<label for="smallImage_{$key}" >
|
||||
<img src="{$image.src}" alt="{$image.legend}" />
|
||||
</label>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3" for="leftRight_1">{l s='Position'}</label>
|
||||
<div class="col-lg-5">
|
||||
<p class="checkbox">
|
||||
<input type="radio" name="leftRight" id="leftRight_1" value="left" checked>
|
||||
<label for="leftRight_1" >{l s='left'}</label>
|
||||
</p>
|
||||
<p class="checkbox">
|
||||
<input type="radio" name="leftRight" id="leftRight_2" value="right">
|
||||
<label for="leftRight_2" >{l s='right'}</label>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3" for="imageTypes_0">{l s='Select the type of picture'}</label>
|
||||
<div class="col-lg-5">
|
||||
{foreach from=$imagesTypes key=key item=type}
|
||||
<p class="checkbox">
|
||||
<input type="radio" name="imageTypes" id="imageTypes_{$key}" value="{$type.name}" {if $key == 0}checked="checked"{/if}>
|
||||
<label for="imageTypes_{$key}" >
|
||||
{$type.name} <span>{l s='%dpx by %dpx' sprintf=[$type.width, $type.height]}</span>
|
||||
</label>
|
||||
</p>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3" for="resultImage">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='The tag to copy/paste into the description.'}">
|
||||
{l s='Image tag to insert'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-4">
|
||||
<input type="text" id="resultImage" name="resultImage" />
|
||||
</div>
|
||||
<p class="help-block"></p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}*}
|
||||
|
||||
{* <div class="form-group">
|
||||
<label class="control-label col-lg-3" for="tags_{$id_lang}">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='Will be displayed in the tags block when enabled. Tags help customers easily find your room types.'}">
|
||||
{l s='Tags:'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
{if $languages|count > 1}
|
||||
<div class="row">
|
||||
{/if}
|
||||
{foreach from=$languages item=language}
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
$().ready(function () {
|
||||
var input_id = '{/literal}tags_{$language.id_lang}{literal}';
|
||||
$('#'+input_id).tagify({delimiters: [13,44], addTagPrompt: '{/literal}{l s='Add tag' js=1}{literal}'});
|
||||
$({/literal}'#{$table}{literal}_form').submit( function() {
|
||||
$(this).find('#'+input_id).val($('#'+input_id).tagify('serialize'));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/literal}
|
||||
{if $languages|count > 1}
|
||||
<div class="translatable-field lang-{$language.id_lang}">
|
||||
<div class="col-lg-9">
|
||||
{/if}
|
||||
<input type="text" id="tags_{$language.id_lang}" class="tagify updateCurrentText" name="tags_{$language.id_lang}" value="{$product->getTags($language.id_lang, true)|htmlentitiesUTF8}" />
|
||||
{if $languages|count > 1}
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
{$language.iso_code}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{foreach from=$languages item=language}
|
||||
<li>
|
||||
<a href="javascript:tabs_manager.allow_hide_other_languages = false;hideOtherLanguage({$language.id_lang});">{$language.name}</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{if $languages|count > 1}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-lg-9 col-lg-offset-3">
|
||||
<div class="help-block">{l s='Each tag has to be followed by a comma. The following characters are forbidden: %s' sprintf='!<;>;?=+#"°{}_$%.'}
|
||||
</div>
|
||||
</div>
|
||||
</div> *}
|
||||
<div class="panel-footer">
|
||||
<a href="{$link->getAdminLink('AdminNormalProducts')|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>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
hideOtherLanguage({$default_form_language});
|
||||
var missing_product_name = '{l s='Please fill product name input field' js=1}';
|
||||
</script>
|
||||
@@ -0,0 +1,77 @@
|
||||
{*
|
||||
* 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
|
||||
*}
|
||||
|
||||
{foreach from=$languages item=language}
|
||||
{if $languages|count > 1}
|
||||
<div class="translatable-field row lang-{$language.id_lang}">
|
||||
<div class="col-lg-9">
|
||||
{/if}
|
||||
{if isset($maxchar)}
|
||||
<div class="input-group">
|
||||
<span id="{$input_name}_{$language.id_lang}_counter" class="input-group-addon">
|
||||
<span class="text-count-down">{$maxchar}</span>
|
||||
</span>
|
||||
{/if}
|
||||
<input type="text"
|
||||
id="{$input_name}_{$language.id_lang}"
|
||||
class="form-control {if isset($input_class)}{$input_class} {/if}"
|
||||
name="{$input_name}_{$language.id_lang}"
|
||||
value="{$input_value[$language.id_lang]|htmlentitiesUTF8|default:''}"
|
||||
onkeyup="if (isArrowKey(event)) return ;updateFriendlyURL();"
|
||||
onblur="updateLinkRewrite();"
|
||||
{if isset($required)} required="required"{/if}
|
||||
{if isset($maxchar)} data-maxchar="{$maxchar}"{/if}
|
||||
{if isset($maxlength)} maxlength="{$maxlength}"{/if} />
|
||||
{if isset($maxchar)}
|
||||
</div>
|
||||
{/if}
|
||||
{if $languages|count > 1}
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" tabindex="-1">
|
||||
{$language.iso_code}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{foreach from=$languages item=language}
|
||||
<li>
|
||||
<a href="javascript:tabs_manager.allow_hide_other_languages = false;hideOtherLanguage({$language.id_lang});">{$language.name}</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{if isset($maxchar)}
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function(){
|
||||
{foreach from=$languages item=language}
|
||||
countDown($("#{$input_name}_{$language.id_lang}"), $("#{$input_name}_{$language.id_lang}_counter"));
|
||||
{/foreach}
|
||||
});
|
||||
</script>
|
||||
{/if}
|
||||
@@ -0,0 +1,56 @@
|
||||
{*
|
||||
* 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($display_multishop_checkboxes) && $display_multishop_checkboxes}
|
||||
<div class="panel clearfix">
|
||||
<label class="control-label col-lg-3">
|
||||
<i class="icon-sitemap"></i> {l s='Multistore'}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
<span class="switch prestashop-switch">
|
||||
<input type="radio" name="multishop_{$product_tab}" id="multishop_{$product_tab}_on" value="1" onclick="$('#product-tab-content-{$product_tab} input[name^=\'multishop_check[\']').attr('checked', true); ProductMultishop.checkAll{$product_tab}()">
|
||||
<label for="multishop_{$product_tab}_on">
|
||||
{l s='Yes'}
|
||||
</label>
|
||||
<input type="radio" name="multishop_{$product_tab}" id="multishop_{$product_tab}_off" value="0" checked="checked" onclick="$('#product-tab-content-{$product_tab} input[name^=\'multishop_check[\']').attr('checked', false); ProductMultishop.checkAll{$product_tab}()">
|
||||
<label for="multishop_{$product_tab}_off">
|
||||
{l s='No'}
|
||||
</label>
|
||||
<a class="slide-button btn"></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<p class="help-block">
|
||||
<strong>{l s='Check / Uncheck all'}</strong> {l s='(If you are editing this page for several shops, some fields may be disabled. If you need to edit them, you will need to check the box for each field)'}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -0,0 +1,41 @@
|
||||
{*
|
||||
* 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($display_multishop_checkboxes) && $display_multishop_checkboxes}
|
||||
{if isset($multilang) && $multilang}
|
||||
{if isset($only_checkbox)}
|
||||
{foreach from=$languages item=language}
|
||||
<input type="checkbox" name="multishop_check[{$field}][{$language.id_lang}]" value="1" onclick="ProductMultishop.checkField(this.checked, '{$field}_{$language.id_lang}', '{$type}')" {if !empty($multishop_check[$field][$language.id_lang])}checked="checked"{/if} />
|
||||
{/foreach}
|
||||
{else}
|
||||
{foreach from=$languages item=language}
|
||||
<input style="{if !$language.is_default}display: none;{/if}" class="multishop_lang_{$language.id_lang} lang-{$language.id_lang} translatable-field" type="checkbox" name="multishop_check[{$field}][{$language.id_lang}]" value="1" onclick="ProductMultishop.checkField(this.checked, '{$field}_{$language.id_lang}','{$type}')"
|
||||
{if !empty($multishop_check[$field][$language.id_lang])}checked="checked"{/if} />
|
||||
{/foreach}
|
||||
{/if}
|
||||
{else}
|
||||
<input type="checkbox" name="multishop_check[{$field}]" value="1" onclick="ProductMultishop.checkField(this.checked, '{$field}', '{$type}')" {if !empty($multishop_check[$field])}checked="checked"{/if} />
|
||||
{/if}
|
||||
{/if}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../../../../../');
|
||||
exit;
|
||||
@@ -0,0 +1,627 @@
|
||||
{*
|
||||
* 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
|
||||
*}
|
||||
|
||||
<script type="text/javascript">
|
||||
var Customer = new Object();
|
||||
var product_url = '{$link->getAdminLink('AdminNormalProducts', true)|addslashes}';
|
||||
var ecotax_tax_excl = parseFloat({$ecotax_tax_excl});
|
||||
var priceDisplayPrecision = {$smarty.const._PS_PRICE_DISPLAY_PRECISION_|intval};
|
||||
|
||||
$(document).ready(function () {
|
||||
Customer = {
|
||||
"hiddenField": jQuery('#id_customer'),
|
||||
"field": jQuery('#customer'),
|
||||
"container": jQuery('#customers'),
|
||||
"loader": jQuery('#customerLoader'),
|
||||
"init": function() {
|
||||
jQuery(Customer.field).typeWatch({
|
||||
"captureLength": 1,
|
||||
"highlight": true,
|
||||
"wait": 50,
|
||||
"callback": Customer.search
|
||||
}).focus(Customer.placeholderIn).blur(Customer.placeholderOut);
|
||||
},
|
||||
"placeholderIn": function() {
|
||||
if (this.value == '{l s='All customers'}') {
|
||||
this.value = '';
|
||||
}
|
||||
},
|
||||
"placeholderOut": function() {
|
||||
if (this.value == '') {
|
||||
this.value = '{l s='All customers'}';
|
||||
}
|
||||
},
|
||||
"search": function()
|
||||
{
|
||||
Customer.showLoader();
|
||||
jQuery.ajax({
|
||||
"type": "POST",
|
||||
"url": "{$link->getAdminLink('AdminCustomers')|addslashes}",
|
||||
"async": true,
|
||||
"dataType": "json",
|
||||
"data": {
|
||||
"ajax": "1",
|
||||
"token": "{getAdminToken tab='AdminCustomers'}",
|
||||
"tab": "AdminCustomers",
|
||||
"action": "searchCustomers",
|
||||
"customer_search": Customer.field.val()
|
||||
},
|
||||
"success": Customer.success
|
||||
});
|
||||
},
|
||||
"success": function(result)
|
||||
{
|
||||
if(result.found) {
|
||||
var html = '<ul class="list-unstyled">';
|
||||
jQuery.each(result.customers, function() {
|
||||
html += '<li><a class="fancybox" href="{$link->getAdminLink('AdminCustomers')}&id_customer='+this.id_customer+'&viewcustomer&liteDisplaying=1">'+this.firstname+' '+this.lastname+'</a>'+(this.birthday ? ' - '+this.birthday:'');
|
||||
html += ' - '+this.email;
|
||||
html += '<a onclick="Customer.select('+this.id_customer+', \''+this.firstname+' '+this.lastname+'\'); return false;" href="#" class="btn btn-default">{l s='Choose'}</a></li>';
|
||||
});
|
||||
html += '</ul>';
|
||||
}
|
||||
else
|
||||
html = '<div class="alert alert-warning">{l s='No customers found'}</div>';
|
||||
Customer.hideLoader();
|
||||
Customer.container.html(html);
|
||||
jQuery('.fancybox', Customer.container).fancybox();
|
||||
},
|
||||
"select": function(id_customer, fullname)
|
||||
{
|
||||
Customer.hiddenField.val(id_customer);
|
||||
Customer.field.val(fullname);
|
||||
Customer.container.empty();
|
||||
return false;
|
||||
},
|
||||
"showLoader": function() {
|
||||
Customer.loader.fadeIn();
|
||||
},
|
||||
"hideLoader": function() {
|
||||
Customer.loader.fadeOut();
|
||||
}
|
||||
};
|
||||
Customer.init();
|
||||
});
|
||||
</script>
|
||||
{capture assign=priceDisplayPrecisionFormat}{'%.'|cat:$smarty.const._PS_PRICE_DISPLAY_PRECISION_|cat:'f'}{/capture}
|
||||
<div id="product-prices" class="panel product-tab">
|
||||
<input type="hidden" name="submitted_tabs[]" value="Prices" />
|
||||
<h3>{l s='product price'}</h3>
|
||||
<div class="alert alert-info" {if !$country_display_tax_label || $tax_exclude_taxe_option}style="display:none;"{/if}>
|
||||
{l s='You must enter either the pre-tax retail price, or the retail price with tax. The input field will be automatically calculated.'}
|
||||
</div>
|
||||
{include file="controllers/products/multishop/check_fields.tpl" product_tab="Prices"}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="wholesale_price" type="default"}</span></div>
|
||||
<label class="control-label col-lg-2" for="wholesale_price">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='The price is the price you paid for the product. Do not include the tax.'}">{if !$country_display_tax_label || $tax_exclude_taxe_option}{l s='Wholesale price'}{else}{l s='Pre-tax wholesale price'}{/if}</span>
|
||||
</label>
|
||||
<div class="col-lg-2">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
|
||||
<input maxlength="27" name="wholesale_price" id="wholesale_price" type="text" value="{{toolsConvertPrice price=$product->wholesale_price}|string_format:$priceDisplayPrecisionFormat}" onchange="this.value = this.value.replace(/,/g, '.');" />
|
||||
</div>
|
||||
{if isset($pack) && $pack->isPack($product->id)}<p class="help-block">{l s='The sum of wholesale prices of the product in the pack is %s%s%s' sprintf=[$currency->prefix,{toolsConvertPrice price=$pack->noPackWholesalePrice($product->id)|string_format:$priceDisplayPrecisionFormat},$currency->suffix]}</p>{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="price" type="price"}</span></div>
|
||||
<label class="control-label col-lg-2" for="priceTE">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='The pre-tax retail price is the price for which you intend sell this product to your customers. It should be higher than the pre-tax wholesale price: the difference between the two will be your margin.'}">{if !$country_display_tax_label || $tax_exclude_taxe_option}{l s='Retail price'}{else}{l s='Pre-tax retail price'}{/if}</span>
|
||||
</label>
|
||||
<div class="col-lg-2">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
|
||||
<input type="hidden" id="priceTEReal" name="price" value="{toolsConvertPrice price=$product->price}"/>
|
||||
<input size="11" maxlength="27" id="priceTE" name="price_displayed" type="text" value="{{toolsConvertPrice price=$product->price}|string_format:'%.6f'}" onchange="noComma('priceTE'); $('#priceTEReal').val(this.value);" onkeyup="$('#priceType').val('TE'); $('#priceTEReal').val(this.value.replace(/,/g, '.')); if (isArrowKey(event)) return; calcPriceTI();" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="id_tax_rules_group" type="default"}</span></div>
|
||||
<label class="control-label col-lg-2" for="id_tax_rules_group">
|
||||
{l s='Tax rule:'}
|
||||
</label>
|
||||
<div class="col-lg-8">
|
||||
<script type="text/javascript">
|
||||
noTax = {if $tax_exclude_taxe_option}true{else}false{/if};
|
||||
taxesArray = new Array();
|
||||
{foreach $taxesRatesByGroup as $tax_by_group}
|
||||
taxesArray[{$tax_by_group.id_tax_rules_group}] = {$tax_by_group|json_encode};
|
||||
{/foreach}
|
||||
ecotaxTaxRate = {$ecotaxTaxRate / 100};
|
||||
</script>
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<select onchange="javascript:calcPrice(); {*unitPriceWithTax('unit');*}" name="id_tax_rules_group" id="id_tax_rules_group" {if $tax_exclude_taxe_option}disabled="disabled"{/if} >
|
||||
<option value="0">{l s='No Tax'}</option>
|
||||
{foreach from=$tax_rules_groups item=tax_rules_group}
|
||||
<option value="{$tax_rules_group.id_tax_rules_group}" {if $product->getIdTaxRulesGroup() == $tax_rules_group.id_tax_rules_group}selected="selected"{/if} >
|
||||
{$tax_rules_group['name']|htmlentitiesUTF8}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<a class="btn btn-link confirm_leave" href="{$link->getAdminLink('AdminTaxRulesGroup')|escape:'html':'UTF-8'}&addtax_rules_group&id_product={$product->id}"{if $tax_exclude_taxe_option} disabled="disabled"{/if}>
|
||||
<i class="icon-plus-sign"></i> {l s='Create new tax'} <i class="icon-external-link-sign"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{if $tax_exclude_taxe_option}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-9 col-lg-offset-3">
|
||||
<div class="alert">
|
||||
{l s='Taxes are currently disabled:'}
|
||||
<a href="{$link->getAdminLink('AdminTaxes')|escape:'html':'UTF-8'}">{l s='Click here to open the Taxes configuration page.'}</a>
|
||||
<input type="hidden" value="{$product->getIdTaxRulesGroup()}" name="id_tax_rules_group" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="form-group" {if !$ps_use_ecotax} style="display:none;"{/if}>
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="ecotax" type="default"}</span></div>
|
||||
<label class="control-label col-lg-2" for="ecotax">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='The ecotax is a local set of taxes intended to "promote ecologically sustainable activities via economic incentives". It is already included in retail price: the higher this ecotax is, the lower your margin will be.'}">{l s='Ecotax (tax incl.)'}</span>
|
||||
</label>
|
||||
<div class="input-group col-lg-2">
|
||||
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
|
||||
<input maxlength="27" id="ecotax" name="ecotax" type="text" value="{$product->ecotax|string_format:$priceDisplayPrecisionFormat}" onkeyup="$('#priceType').val('TI');if (isArrowKey(event))return; calcPriceTE(); this.value = this.value.replace(/,/g, '.'); if (parseInt(this.value) > getE('priceTE').value) this.value = getE('priceTE').value; if (isNaN(this.value)) this.value = 0;" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" {if !$country_display_tax_label || $tax_exclude_taxe_option}style="display:none;"{/if} >
|
||||
<label class="control-label col-lg-3" for="priceTI">{l s='Retail price with tax'}</label>
|
||||
<div class="input-group col-lg-2">
|
||||
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
|
||||
<input id="priceType" name="priceType" type="hidden" value="TE" />
|
||||
<input id="priceTI" name="priceTI" type="text" value="" onchange="noComma('priceTI');" maxlength="27" onkeyup="$('#priceType').val('TI');if (isArrowKey(event)) return; calcPriceTE();" />
|
||||
</div>
|
||||
{if isset($pack) && $pack->isPack($product->id)}<p class="col-lg-9 col-lg-offset-3 help-block">{l s='The sum of prices of the products in the pack is %s%s%s' sprintf=[$currency->prefix,{toolsConvertPrice price=$pack->noPackPrice($product->id)|string_format:$priceDisplayPrecisionFormat},$currency->suffix]}</p>{/if}
|
||||
</div>
|
||||
{* As no use in QloApps currently so commented *}
|
||||
{* <div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="unit_price" type="unit_price"}</span></div>
|
||||
<label class="control-label col-lg-2" for="unit_price">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='When selling a pack of items, you can indicate the unit price for each item of the pack. For instance, "per bottle" or "per pound".'}">{l s='Unit price (tax excl.)'}</span>
|
||||
</label>
|
||||
<div class="col-lg-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
|
||||
<input id="unit_price" name="unit_price" type="text" value="{$unit_price|string_format:'%.6f'}" maxlength="27" onkeyup="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.'); unitPriceWithTax('unit');"/>
|
||||
<span class="input-group-addon">{l s='per'}</span>
|
||||
<input id="unity" name="unity" type="text" value="{$product->unity|htmlentitiesUTF8}" maxlength="255" onkeyup="if (isArrowKey(event)) return ;unitySecond();" onchange="unitySecond();"/>
|
||||
</div>
|
||||
</div>
|
||||
</div> *}
|
||||
{if isset($product->unity) && $product->unity}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-9 col-lg-offset-3">
|
||||
<div class="alert alert-warning">
|
||||
<span>{l s='or'}
|
||||
{$currency->prefix}<span id="unit_price_with_tax">0.00</span>{$currency->suffix}
|
||||
{l s='per'} <span id="unity_second">{$product->unity}</span>{if $ps_tax && $country_display_tax_label} {l s='(tax incl.)'}{/if}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{* <div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="on_sale" type="default"}</span></div>
|
||||
<label class="control-label col-lg-2" for="on_sale"> </label>
|
||||
<div class="col-lg-9">
|
||||
<div class="checkbox">
|
||||
<label class="control-label" for="on_sale" >
|
||||
<input type="checkbox" name="on_sale" id="on_sale" {if $product->on_sale}checked="checked"{/if} value="1" />
|
||||
{l s='Display the "on sale" icon on the product page, and in the text found within the product listing.'}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div> *}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-9 col-lg-offset-3">
|
||||
<div class="alert alert-warning">
|
||||
<strong>{l s='Final retail price:'}</strong>
|
||||
<span>
|
||||
{$currency->prefix}
|
||||
<span id="finalPrice" >0.00</span>
|
||||
{$currency->suffix}
|
||||
<span{if !$ps_tax} style="display:none;"{/if}> ({l s='tax incl.'})</span>
|
||||
</span>
|
||||
<span{if !$ps_tax} style="display:none;"{/if} >
|
||||
{if $country_display_tax_label}
|
||||
/
|
||||
{/if}
|
||||
{$currency->prefix}
|
||||
<span id="finalPriceWithoutTax"></span>
|
||||
{$currency->suffix}
|
||||
{if $country_display_tax_label}({l s='tax excl.'}){/if}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel-footer">
|
||||
<a href="{$link->getAdminLink('AdminNormalProducts')|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>
|
||||
</div>
|
||||
|
||||
{* <div class="panel">
|
||||
<h3>{l s='Feature Price Plans'}</h3>
|
||||
<div class="alert alert-info">
|
||||
{l s='You can set feature price plans by visiting '}
|
||||
<a target="_blank" href="{$link->getAdminLink('AdminHotelFeaturePricesSettings')}">{l s='create feature price plans'}</a>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#{l s='Id'}</th>
|
||||
<th>{l s='Plan Name'}</th>
|
||||
<th>{l s='Impact way'}</th>
|
||||
<th>{l s='Impact Type'}</th>
|
||||
<th>{l s='Impact Value'}</th>
|
||||
<th>{l s='Date From'}</th>
|
||||
<th>{l s='Date To'}</th>
|
||||
<th class="text-center">{l s='Status'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if isset($productFeaturePrices) && $productFeaturePrices}
|
||||
{foreach $productFeaturePrices as $featurePlan}
|
||||
<tr>
|
||||
<td>
|
||||
{$featurePlan['id_feature_price']}
|
||||
</td>
|
||||
<td>
|
||||
{$featurePlan['feature_price_name']}
|
||||
</td>
|
||||
<td>
|
||||
{if $featurePlan['impact_type'] == 1}
|
||||
{l s='Percentage'}
|
||||
{else}
|
||||
{l s='Fixed Amount'}
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{if $featurePlan['impact_way'] == 1}
|
||||
{l s='Decrease'}
|
||||
{else}
|
||||
{l s='Increase'}
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{if $featurePlan['impact_type'] == 1}
|
||||
{$featurePlan['impact_value']|round:2}%
|
||||
{else}
|
||||
{displayPrice price=$featurePlan['impact_value']}
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{dateFormat date=$featurePlan['date_from'] full=0}
|
||||
</td>
|
||||
<td>
|
||||
{if $featurePlan['date_selection_type'] == 1}
|
||||
{dateFormat date=$featurePlan['date_to'] full=0}
|
||||
{else}
|
||||
<span class="badge badge-success">{l s='Specific date'}</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{if $featurePlan['active'] == 1}
|
||||
<i class="icon-check text-success"></i>
|
||||
{else}
|
||||
<i class="icon-times text-danger"></i>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td class="text-center" colspan="6">
|
||||
<i class="icon-warning-sign"></i> {l s='No feature price plans.'}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> *}
|
||||
|
||||
{if isset($specificPriceModificationForm)}
|
||||
<div class="panel">
|
||||
<h3>{l s='Specific prices'}</h3>
|
||||
<div class="alert alert-info">
|
||||
{l s='You can set specific prices for clients belonging to different groups, different countries, etc.'}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-12">
|
||||
<a class="btn btn-default" href="#" id="show_specific_price">
|
||||
<i class="icon-plus-sign"></i> {l s='Add a new specific price'}
|
||||
</a>
|
||||
<a class="btn btn-default" href="#" id="hide_specific_price" style="display:none">
|
||||
<i class="icon-remove text-danger"></i> {l s='Cancel new specific price'}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var product_prices = new Array();
|
||||
{foreach from=$combinations item='combination'}
|
||||
product_prices['{$combination.id_product_attribute}'] = '{$combination.price|@addcslashes:'\''}';
|
||||
{/foreach}
|
||||
</script>
|
||||
<div id="add_specific_price" class="well clearfix" style="display: none;">
|
||||
<div class="col-lg-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-2" for="{if !$multi_shop}spm_currency_0{else}sp_id_shop{/if}">{l s='For'}</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="row">
|
||||
{if !$multi_shop}
|
||||
<input type="hidden" name="sp_id_shop" value="0" />
|
||||
{else}
|
||||
<div class="col-lg-3">
|
||||
<select name="sp_id_shop" id="sp_id_shop">
|
||||
{if !$admin_one_shop}<option value="0">{l s='All shops'}</option>{/if}
|
||||
{foreach from=$shops item=shop}
|
||||
<option value="{$shop.id_shop}">{$shop.name|htmlentitiesUTF8}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="col-lg-3">
|
||||
<select name="sp_id_currency" id="spm_currency_0" onchange="changeCurrencySpecificPrice(0);">
|
||||
<option value="0">{l s='All currencies'}</option>
|
||||
{foreach from=$currencies item=curr}
|
||||
<option value="{$curr.id_currency}">{$curr.name|htmlentitiesUTF8}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<select name="sp_id_country" id="sp_id_country">
|
||||
<option value="0">{l s='All countries'}</option>
|
||||
{foreach from=$countries item=country}
|
||||
<option value="{$country.id_country}">{$country.name|htmlentitiesUTF8}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<select name="sp_id_group" id="sp_id_group">
|
||||
<option value="0">{l s='All groups'}</option>
|
||||
{foreach from=$groups item=group}
|
||||
<option value="{$group.id_group}">{$group.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-2" for="customer">{l s='Customer'}</label>
|
||||
<div class="col-lg-4">
|
||||
<input type="hidden" name="sp_id_customer" id="id_customer" value="0" />
|
||||
<div class="input-group">
|
||||
<input type="text" name="customer" value="{l s='All customers'}" id="customer" autocomplete="off" />
|
||||
<span class="input-group-addon"><i id="customerLoader" class="icon-refresh icon-spin" style="display: none;"></i> <i class="icon-search"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-10 col-lg-offset-2">
|
||||
<div id="customers"></div>
|
||||
</div>
|
||||
</div>
|
||||
{if $combinations|@count != 0}
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-2" for="sp_id_product_attribute">{l s='Combination:'}</label>
|
||||
<div class="col-lg-4">
|
||||
<select id="sp_id_product_attribute" name="sp_id_product_attribute">
|
||||
<option value="0">{l s='Apply to all combinations'}</option>
|
||||
{foreach from=$combinations item='combination'}
|
||||
<option value="{$combination.id_product_attribute}">{$combination.attributes}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-2" for="sp_from">{l s='Available'}</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{l s='from'}</span>
|
||||
<input type="text" name="sp_from" class="datepicker" value="" style="text-align: center" id="sp_from" />
|
||||
<span class="input-group-addon"><i class="icon-calendar-empty"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{l s='to'}</span>
|
||||
<input type="text" name="sp_to" class="datepicker" value="" style="text-align: center" id="sp_to" />
|
||||
<span class="input-group-addon"><i class="icon-calendar-empty"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-2" for="sp_price">{l s='product price'}
|
||||
{if $country_display_tax_label}
|
||||
{l s='(tax excl.)'}
|
||||
{/if}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
|
||||
<input type="text" disabled="disabled" name="sp_price" id="sp_price" value="{$product->price|string_format:$priceDisplayPrecisionFormat}" onchange="noComma('sp_price');" />
|
||||
</div>
|
||||
<p class="checkbox">
|
||||
<label for="leave_bprice">{l s='Leave base price:'}</label>
|
||||
<input type="checkbox" id="leave_bprice" name="leave_bprice" value="1" checked="checked" />
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-2" for="sp_reduction">{l s='Apply a discount of'}</label>
|
||||
<div class="col-lg-4">
|
||||
<div class="row">
|
||||
<div class="col-lg-3">
|
||||
<input type="text" name="sp_reduction" id="sp_reduction" value="0.00" onchange="noComma('sp_reduction');"/>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<select name="sp_reduction_type" id="sp_reduction_type">
|
||||
<option value="amount" selected="selected">{$currency->name|escape:'html':'UTF-8'}</option>
|
||||
<option value="percentage">{l s='%'}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<select name="sp_reduction_tax" id="sp_reduction_tax">
|
||||
<option value="0">{l s='Tax excluded'}</option>
|
||||
<option value="1" selected="selected">{l s='Tax included'}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var currencyName = '{$currency->name|escape:'html':'UTF-8'|@addcslashes:'\''}';
|
||||
$(document).ready(function(){
|
||||
var adv_payment = $(".adv_payment_active:checked").val();
|
||||
if (adv_payment == 1)
|
||||
$(".adv_payment_field").show();
|
||||
else
|
||||
$(".adv_payment_field").hide();
|
||||
|
||||
$(".adv_payment_active").on('change',function()
|
||||
{
|
||||
var adv_payment = $(".adv_payment_active:checked").val();
|
||||
if (adv_payment == 1)
|
||||
$(".adv_payment_field").show();
|
||||
else if (adv_payment == 0)
|
||||
$(".adv_payment_field").hide();
|
||||
});
|
||||
|
||||
var payment_type = $(".payment_type:checked").val();
|
||||
if (payment_type == 1)
|
||||
{
|
||||
$("#type_percent").show();
|
||||
$("#type_amount").hide();
|
||||
}
|
||||
else if (payment_type == 2)
|
||||
{
|
||||
$("#type_percent").hide();
|
||||
$("#type_amount").show();
|
||||
}
|
||||
|
||||
$(".payment_type").on('change',function()
|
||||
{
|
||||
var payment_type = $(".payment_type:checked").val();
|
||||
if (payment_type == 1)
|
||||
{
|
||||
$("#type_percent").show();
|
||||
$("#type_amount").hide();
|
||||
}
|
||||
else if (payment_type == 2)
|
||||
{
|
||||
$("#type_percent").hide();
|
||||
$("#type_amount").show();
|
||||
}
|
||||
});
|
||||
|
||||
product_prices['0'] = $('#sp_current_ht_price').html();
|
||||
$('#id_product_attribute').change(function() {
|
||||
$('#sp_current_ht_price').html(product_prices[$('#id_product_attribute option:selected').val()]);
|
||||
});
|
||||
$('#leave_bprice').click(function() {
|
||||
if (this.checked)
|
||||
$('#sp_price').attr('disabled', 'disabled');
|
||||
else
|
||||
$('#sp_price').removeAttr('disabled');
|
||||
});
|
||||
$('.datepicker').datetimepicker({
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
dateFormat: 'yy-mm-dd',
|
||||
// Define a custom regional settings in order to use PrestaShop translation tools
|
||||
currentText: '{l s='Now' js=1}',
|
||||
closeText: '{l s='Done' js=1}',
|
||||
ampm: false,
|
||||
amNames: ['AM', 'A'],
|
||||
pmNames: ['PM', 'P'],
|
||||
timeFormat: 'hh:mm:ss tt',
|
||||
timeSuffix: '',
|
||||
timeOnlyTitle: '{l s='Choose Time' js=1}',
|
||||
timeText: '{l s='Time' js=1}',
|
||||
hourText: '{l s='Hour' js=1}',
|
||||
minuteText: '{l s='Minute' js=1}'
|
||||
});
|
||||
$('#sp_reduction_type').on('change', function() {
|
||||
if (this.value == 'percentage')
|
||||
$('#sp_reduction_tax').hide();
|
||||
else
|
||||
$('#sp_reduction_tax').show();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="table-responsive">
|
||||
<table id="specific_prices_list" class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{l s='Rule'}</th>
|
||||
{* <th>{l s='Combination'}</th> *}
|
||||
{if $multi_shop}<th>{l s='Shop'}</th>{/if}
|
||||
<th>{l s='Currency'}</th>
|
||||
<th>{l s='Country'}</th>
|
||||
<th>{l s='Group'}</th>
|
||||
<th>{l s='Customer'}</th>
|
||||
{if $country_display_tax_label}
|
||||
<th>{l s='Fixed price (tax excl.)'}</th>
|
||||
{else}
|
||||
<th>{l s='Fixed price'}</th>
|
||||
{/if}
|
||||
<th>{l s='Impact'}</th>
|
||||
<th>{l s='Period'}</th>
|
||||
<th>{l s='Action'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{$specificPriceModificationForm}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
delete_price_rule = '{l s="Do you really want to remove this price rule?"}';
|
||||
calcPriceTI();
|
||||
//unitPriceWithTax('unit');
|
||||
});
|
||||
</script>
|
||||
{/if}
|
||||
@@ -0,0 +1,116 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<div id="product-seo" class="panel product-tab">
|
||||
<input type="hidden" name="submitted_tabs[]" value="Seo" />
|
||||
<h3>{l s='SEO'}</h3>
|
||||
{include file="controllers/products/multishop/check_fields.tpl" product_tab="Seo"}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="meta_title" type="default" multilang="true"}</span></div>
|
||||
<label class="control-label col-lg-2" for="meta_title_{$id_lang}">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='Public title for the product\'s page, and for search engines. Leave blank to use the room type name.'} {l s='The number of remaining characters is displayed to the left of the field.'}">
|
||||
{l s='Meta title'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-8">
|
||||
{include file="controllers/products/input_text_lang.tpl"
|
||||
languages=$languages
|
||||
input_name='meta_title'
|
||||
input_value=$product->meta_title
|
||||
maxchar=70
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="meta_description" type="default" multilang="true"}</span></div>
|
||||
<label class="control-label col-lg-2" for="meta_description_{$id_lang}">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='This description will appear in search engines. You need a single sentence, shorter than 160 characters (including spaces).'}">
|
||||
{l s='Meta description'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-8">
|
||||
{include file="controllers/products/textarea_lang.tpl"
|
||||
languages=$languages
|
||||
input_name='meta_description'
|
||||
input_value=$product->meta_description
|
||||
maxchar=160
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
{* Removed for simplicity *}
|
||||
<div class="form-group hide">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="meta_keywords" type="default" multilang="true"}</span></div>
|
||||
<label class="control-label col-lg-2" for="meta_keywords_{$id_lang}">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='Keywords for search engines, separated by commas.'}">
|
||||
{l s='Meta keywords'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-8">
|
||||
{include file="controllers/products/input_text_lang.tpl" languages=$languages
|
||||
input_value=$product->meta_keywords
|
||||
input_name='meta_keywords'}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="link_rewrite" type="seo_friendly_url" multilang="true"}</span></div>
|
||||
<label class="control-label col-lg-2" for="link_rewrite_{$id_lang}">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='This is the human-readable URL, as generated from the room type\'s name. You can change it if you want.'}">
|
||||
{l s='Friendly URL:'}
|
||||
</span>
|
||||
|
||||
</label>
|
||||
<div class="col-lg-6">
|
||||
{include file="controllers/products/input_text_lang.tpl"
|
||||
languages=$languages
|
||||
input_value=$product->link_rewrite
|
||||
input_name='link_rewrite'}
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<button type="button" class="btn btn-default" id="generate-friendly-url" onmousedown="updateFriendlyURLByName();"><i class="icon-random"></i> {l s='Generate'}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-9 col-lg-offset-3">
|
||||
{foreach from=$languages item=language}
|
||||
<div class="alert alert-warning translatable-field lang-{$language.id_lang}">
|
||||
<i class="icon-link"></i> {l s='The product link will look like this:'}<br/>
|
||||
<strong>{if isset($rewritten_links[$language.id_lang][0])}{$rewritten_links[$language.id_lang][0]|escape:'html':'UTF-8'}{/if}<span id="friendly-url_{$language.id_lang}">{$product->link_rewrite[$language.id_lang]|escape:'html':'UTF-8'}</span>{if isset($rewritten_links[$language.id_lang][1])}{$rewritten_links[$language.id_lang][1]|escape:'html':'UTF-8'}{/if}</strong>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<a href="{$link->getAdminLink('AdminNormalProducts')|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>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
if (tabs_manager.allow_hide_other_languages)
|
||||
hideOtherLanguage({$default_form_language});
|
||||
</script>
|
||||
@@ -0,0 +1,27 @@
|
||||
{*
|
||||
* 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
|
||||
*}
|
||||
{foreach from=$option_list item='row'}
|
||||
<option value="{$row[$key_id]|intval}">{$row[$key_value]|escape:'html':'UTF-8'}</option>
|
||||
{/foreach}
|
||||
@@ -0,0 +1,69 @@
|
||||
{*
|
||||
* 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
|
||||
*}
|
||||
|
||||
{foreach from=$languages item=language}
|
||||
{if $languages|count > 1}
|
||||
<div class="translatable-field row lang-{$language.id_lang}">
|
||||
<div class="col-lg-9">
|
||||
{/if}
|
||||
{if isset($maxchar) && $maxchar}
|
||||
<div class="input-group">
|
||||
<span id="{if isset($input_id)}{$input_id}_{$language.id_lang}{else}{$input_name}_{$language.id_lang}{/if}_counter" class="input-group-addon">
|
||||
<span class="text-count-down">{$maxchar|intval}</span>
|
||||
</span>
|
||||
{/if}
|
||||
<textarea id="{$input_name}_{$language.id_lang}" name="{$input_name}_{$language.id_lang}" class="{if isset($class)}{$class}{else}textarea-autosize{/if}"{if isset($maxlength) && $maxlength} maxlength="{$maxlength|intval}"{/if}{if isset($maxchar) && $maxchar} data-maxchar="{$maxchar|intval}"{/if}>{if isset($input_value[$language.id_lang])}{$input_value[$language.id_lang]|htmlentitiesUTF8}{/if}</textarea>
|
||||
<span class="counter" data-max="{if isset($max)}{$max|intval}{/if}{if isset($maxlength)}{$maxlength|intval}{/if}{if !isset($max) && !isset($maxlength)}none{/if}"></span>
|
||||
{if isset($maxchar) && $maxchar}
|
||||
</div>
|
||||
{/if}
|
||||
{if $languages|count > 1}
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
{$language.iso_code}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{foreach from=$languages item=language}
|
||||
<li><a href="javascript:tabs_manager.allow_hide_other_languages = false;hideOtherLanguage({$language.id_lang});">{$language.name}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
|
||||
<script type="text/javascript">
|
||||
{if isset($maxchar) && $maxchar}
|
||||
$(document).ready(function(){
|
||||
{foreach from=$languages item=language}
|
||||
countDown($("#{$input_name}_{$language.id_lang}"), $("#{$input_name}_{$language.id_lang}_counter"));
|
||||
{/foreach}
|
||||
});
|
||||
{/if}
|
||||
$(".textarea-autosize").autosize();
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
{**
|
||||
* 2010-2023 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* 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 CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2023 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*}
|
||||
|
||||
{if is_array($booking_documents) && count($booking_documents)}
|
||||
{foreach from=$booking_documents item=booking_document}
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<a href="{$link->getAdminLink('AdminBookingDocument')}&action=getDocument&id_document={$booking_document.id_htl_booking_document}&is_preview=1" target="_blank">
|
||||
{if $booking_document.file_type == HotelBookingDocument::FILE_TYPE_IMAGE}
|
||||
<img class="img img-responsive img-thumbnail" src="{$link->getAdminLink('AdminBookingDocument')}&action=getDocument&id_document={$booking_document.id_htl_booking_document}&is_preview=1">
|
||||
{elseif $booking_document.file_type == HotelBookingDocument::FILE_TYPE_PDF}
|
||||
<img class="img img-responsive img-thumbnail" src="{$pdf_icon_link}">
|
||||
{/if}
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-left">{$booking_document.title}</td>
|
||||
<td class="text-center">{dateFormat date=$booking_document.date_add full=1}</td>
|
||||
<td class="text-center">
|
||||
<a class="btn btn-info" href="{$link->getAdminLink('AdminBookingDocument')}&action=getDocument&id_document={$booking_document.id_htl_booking_document}">
|
||||
<i class="icon icon-cloud-download"></i>
|
||||
</a>
|
||||
<a class="btn btn-danger btn-delete-document" data-id-htl-booking-document="{$booking_document.id_htl_booking_document}">
|
||||
<i class="icon icon-trash"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td class="list-empty" colspan="4">
|
||||
<div class="list-empty-msg">
|
||||
<i class="icon-warning-sign list-empty-icon"></i>
|
||||
{l s='No documents uploaded yet.'}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
@@ -0,0 +1,101 @@
|
||||
{**
|
||||
* 2010-2023 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* 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 CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2023 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*}
|
||||
|
||||
<div class="modal-body text-center">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="text-left errors-wrap"></div>
|
||||
<div class="documents-list">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">{l s='Preview'}</th>
|
||||
<th class="text-left">{l s='Title'}</th>
|
||||
<th class="text-center">{l s='Upload Date'}</th>
|
||||
<th class="text-center">{l s='Actions'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="add-new-document-form" style="margin-top: 10px;">
|
||||
<div class="text-left add-new-wrap">
|
||||
<a class="btn btn-primary btn-add-new-document">
|
||||
{l s='Upload new document'}
|
||||
</a>
|
||||
<span></span>
|
||||
</div>
|
||||
<form id="form-add-new-document" class="well" method="post" action="#" style="display: none; margin-top: 5px;">
|
||||
|
||||
<input type="hidden" name="id_htl_booking" value="0">
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Write the title for the document. Invalid characters <>;=#{}'}">
|
||||
{l s='Title'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group fixed-width-xxl">
|
||||
<input type="text" name="title" value="" placeholder="{l s='Eg. Passport, Driving license'}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label required col-sm-2">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Choose the document file to be uploaded.'}">
|
||||
{l s='File'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-file-wrap"></div>
|
||||
<div class="input-group fixed-width-xxl">
|
||||
<span class="input-group-addon"><i class="icon-file"></i></span>
|
||||
<input type="text" class="file-name" readonly="">
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-default btn-add-file">
|
||||
<i class="icon-folder-open"></i>
|
||||
{l s='Add file'}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
<p class="text-left" style="margin-top: 4px; font-style: italic;">
|
||||
{l s='Upload a PDF or an image file. Allowed image formats: .gif, .jpg, .jpeg and .png'}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix btn-group-add-new">
|
||||
<button class="btn btn-primary pull-right upload" type="submit" name="submitAddPayment">
|
||||
{l s='Upload'}
|
||||
</button>
|
||||
<button class="btn btn-default pull-left cancel">
|
||||
{l s='Cancel'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{addJsDefL name=txt_booking_document_upload_success}{l s='Document uploaded successfully.' js=1}{/addJsDefL}
|
||||
{addJsDefL name=txt_booking_document_delete_confirm}{l s='Are you sure?' js=1}{/addJsDefL}
|
||||
{addJsDefL name=txt_booking_document_delete_success}{l s='Document deleted successfully.' js=1}{/addJsDefL}
|
||||
@@ -17,55 +17,155 @@
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
{if isset($selectedRoomDemands) && $selectedRoomDemands}
|
||||
{assign var=roomCount value=1}
|
||||
{foreach $selectedRoomDemands as $key => $roomDemand}
|
||||
<div class="row room_demands_container">
|
||||
<div class="col-sm-12 demand_header">
|
||||
<span>
|
||||
<i class="icon-bed"></i>
|
||||
{if isset($roomDemand['room_num']) && $roomDemand['room_num']}
|
||||
{l s='Room'} {$roomDemand['room_num']|escape:'html':'UTF-8'}
|
||||
{else}
|
||||
{l s='Room'} {$roomCount|escape:'html':'UTF-8'}
|
||||
<div class="modal" tabindex="-1" role="dialog" id="rooms_type_extra_demands">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
{if isset($selectedRoomDemands) && $selectedRoomDemands}
|
||||
<li role="presentation" class="active"><a href="#room_type_demands_desc" aria-controls="facilities" role="tab" data-toggle="tab">{l s='Facilities'}</a></li>
|
||||
{/if}
|
||||
</span>
|
||||
{if isset($roomTypeServiceProducts) && $roomTypeServiceProducts}
|
||||
<li role="presentation" {if !isset($selectedRoomDemands) || !$selectedRoomDemands}class="active"{/if}><a href="#room_type_service_product_desc" aria-controls="services" role="tab" data-toggle="tab">{l s='Services'}</a></li>
|
||||
{/if}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-sm-12 room_demand_detail">
|
||||
{if isset($roomTypeDemands) && $roomTypeDemands}
|
||||
{foreach $roomTypeDemands as $idGlobalDemand => $demand}
|
||||
<div class="row room_demand_block">
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="col-xs-2">
|
||||
<input id_cart_booking="{$roomDemand['id']}" value="{$idGlobalDemand|escape:'html':'UTF-8'}" type="checkbox" class="id_room_type_demand" {if isset($roomDemand['selected_global_demands']) && $roomDemand['selected_global_demands'] && ($idGlobalDemand|in_array:$roomDemand['selected_global_demands'])}checked{/if} />
|
||||
</div>
|
||||
<div class="col-xs-10 demand_adv_option_block">
|
||||
<p>{$demand['name']|escape:'html':'UTF-8'}</p>
|
||||
{if isset($demand['adv_option']) && $demand['adv_option']}
|
||||
<select class="id_option">
|
||||
{foreach $demand['adv_option'] as $idOption => $option}
|
||||
{assign var=demand_key value="`$idGlobalDemand`-`$idOption`"}
|
||||
<option optionPrice="{$option['price']|escape:'html':'UTF-8'}" value="{$idOption|escape:'html':'UTF-8'}" {if isset($roomDemand['extra_demands'][$demand_key])}selected{/if} key="{$demand_key}">{$option['name']}</option>
|
||||
{if isset($roomDemand['extra_demands'][$demand_key])}
|
||||
{assign var=selected_adv_option value="$idOption"}
|
||||
<div class="modal-body" id="rooms_extra_demands">
|
||||
<div class="tab-content">
|
||||
{if isset($selectedRoomDemands) && $selectedRoomDemands}
|
||||
<div id="room_type_demands_desc" class="tab-pane active">
|
||||
<div class="rooms_extra_demands_head">
|
||||
<p class="rooms_extra_demands_text">{l s='Add below facilities to the room for better hotel experience'}</p>
|
||||
</div>
|
||||
<div id="room_type_demands_desc">
|
||||
{if isset($selectedRoomDemands) && $selectedRoomDemands}
|
||||
{assign var=roomCount value=1}
|
||||
{foreach $selectedRoomDemands as $key => $roomDemand}
|
||||
<div class="row room_demands_container">
|
||||
<div class="col-sm-12 demand_header">
|
||||
<span>
|
||||
<i class="icon-bed"></i>
|
||||
{if isset($roomDemand['room_num']) && $roomDemand['room_num']}
|
||||
{l s='Room'} {$roomDemand['room_num']|escape:'html':'UTF-8'}
|
||||
{else}
|
||||
{l s='Room'} {$roomCount|escape:'html':'UTF-8'}
|
||||
{/if}
|
||||
{/foreach}
|
||||
</select>
|
||||
{else}
|
||||
<input type="hidden" class="id_option" value="0" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-sm-12 room_demand_detail">
|
||||
{if isset($roomTypeDemands) && $roomTypeDemands}
|
||||
{foreach $roomTypeDemands as $idGlobalDemand => $demand}
|
||||
<div class="row room_demand_block">
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="col-xs-2">
|
||||
<input id_cart_booking="{$roomDemand['id']}" value="{$idGlobalDemand|escape:'html':'UTF-8'}" type="checkbox" class="id_room_type_demand" {if isset($roomDemand['selected_global_demands']) && $roomDemand['selected_global_demands'] && ($idGlobalDemand|in_array:$roomDemand['selected_global_demands'])}checked{/if} />
|
||||
</div>
|
||||
<div class="col-xs-10 demand_adv_option_block">
|
||||
<p>{$demand['name']|escape:'html':'UTF-8'}</p>
|
||||
{if isset($demand['adv_option']) && $demand['adv_option']}
|
||||
<select class="id_option">
|
||||
{foreach $demand['adv_option'] as $idOption => $option}
|
||||
{assign var=demand_key value="`$idGlobalDemand`-`$idOption`"}
|
||||
<option optionPrice="{$option['price_tax_excl']|escape:'html':'UTF-8'}" value="{$idOption|escape:'html':'UTF-8'}" {if isset($roomDemand['extra_demands'][$demand_key])}selected{/if} key="{$demand_key}">{$option['name']}</option>
|
||||
{if isset($roomDemand['extra_demands'][$demand_key])}
|
||||
{assign var=selected_adv_option value="$idOption"}
|
||||
{/if}
|
||||
{/foreach}
|
||||
</select>
|
||||
{else}
|
||||
<input type="hidden" class="id_option" value="0" />
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<p class="pull-right">
|
||||
<span class="extra_demand_option_price">
|
||||
{if isset($selected_adv_option) && isset($demand['adv_option'][$selected_adv_option]['price_tax_excl'])}{convertPrice price = $demand['adv_option'][$selected_adv_option]['price_tax_excl']|escape:'html':'UTF-8'}{else if isset($demand['adv_option']) && $demand['adv_option']}{convertPrice price = $demand['adv_option'][$demand['adv_option']|@key]['price_tax_excl']}{else}{convertPrice price = $demand['price_tax_excl']|escape:'html':'UTF-8'}{/if}
|
||||
</span>
|
||||
{if $demand['price_calc_method'] == HotelRoomTypeGlobalDemand::WK_PRICE_CALC_METHOD_EACH_DAY}
|
||||
{l s='/ night'}
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{assign var=roomCount value=$roomCount+1}
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($roomTypeServiceProducts) && $roomTypeServiceProducts}
|
||||
<div id="room_type_service_product_desc" class="tab-pane{if !isset($selectedRoomDemands) || !$selectedRoomDemands} active{/if}">
|
||||
<div class="rooms_extra_demands_head">
|
||||
<p class="rooms_extra_demands_text">{l s='Add below services to the rooms for better hotel experience'}</p>
|
||||
</div>
|
||||
<div id="room_type_services_desc">
|
||||
{assign var=roomCount value=1}
|
||||
<div class="row room_demands_container">
|
||||
<div class="col-sm-12 demand_header">
|
||||
<span>
|
||||
<i class="icon-bed"></i>
|
||||
{if isset($selectedRoomServiceProduct['room_num']) && $selectedRoomServiceProduct['room_num']}
|
||||
{l s='Room'} {$selectedRoomServiceProduct['room_num']|escape:'html':'UTF-8'}
|
||||
{else}
|
||||
{l s='Room'} {$roomCount|escape:'html':'UTF-8'}
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-sm-12 room_demand_detail">
|
||||
{if isset($roomTypeServiceProducts) && $roomTypeServiceProducts}
|
||||
{foreach $roomTypeServiceProducts as $product}
|
||||
<div class="row room_demand_block">
|
||||
<div class="col-xs-5">
|
||||
<div class="row">
|
||||
<div class="col-xs-2">
|
||||
<input data-id_cart_booking="{$selectedRoomServiceProduct['id']}" value="{$product['id_product']|escape:'html':'UTF-8'}" type="checkbox" class="change_room_type_service_product" {if isset($selectedRoomServiceProduct['selected_service']) && $selectedRoomServiceProduct['selected_service'] && ($product['id_product']|array_key_exists:$selectedRoomServiceProduct['selected_service'])}checked{/if}/>
|
||||
</div>
|
||||
<div class="col-xs-10">
|
||||
<p>{$product['name']|escape:'html':'UTF-8'}</p>
|
||||
{if $product.allow_multiple_quantity}
|
||||
<div class="qty_container">
|
||||
<input type="number" class="form-control room_type_service_product_qty qty" id="qty_{$product.id_product}" name="service_product_qty_{$product.id_product}" data-id-product="{$product.id_product}" min="1" value="{if isset($selectedRoomServiceProduct['selected_service']) && $selectedRoomServiceProduct['selected_service'] && ($product['id_product']|array_key_exists:$selectedRoomServiceProduct['selected_service'])}{$selectedRoomServiceProduct['selected_service'][$product['id_product']]['quantity']}{else}1{/if}">
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
{if $product['auto_add_to_cart'] && $product['price_addition_type'] == Product::PRICE_ADDITION_TYPE_INDEPENDENT}
|
||||
<span class="badge badge-info label">{l s='Convenience fee'}</span>
|
||||
{/if}
|
||||
{if $product['auto_add_to_cart'] && $product['price_addition_type'] == Product::PRICE_ADDITION_TYPE_WITH_ROOM}
|
||||
<span class="badge badge-info label">{l s='Auto added'}</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
{if ($product.show_price && !isset($restricted_country_mode)) || isset($groups)}
|
||||
<span class="pull-right">{convertPrice price=$product.price_tax_exc}</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<p><span class="pull-right extra_demand_option_price">{if isset($selected_adv_option) && isset($demand['adv_option'][$selected_adv_option]['price'])}{convertPrice price = $demand['adv_option'][$selected_adv_option]['price']|escape:'html':'UTF-8'}{else}{convertPrice price = $demand['price']|escape:'html':'UTF-8'}{/if}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">{l s='Close'}</button>
|
||||
</div>
|
||||
</div>
|
||||
{assign var=roomCount value=$roomCount+1}
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -25,90 +25,82 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12 table-responsive">
|
||||
<table class="table" id="customer_cart_details_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><span class="title_box">{l s='Room No.'}</span></th>
|
||||
<th><span class="title_box">{l s='Room Image'}</th>
|
||||
<th><span class="title_box">{l s='Room Type'}</span></th>
|
||||
<th><span class="title_box">{l s='Duration'}</span></th>
|
||||
{if $occupancy_required_for_booking}
|
||||
{if isset($cart_detail_data) && $cart_detail_data}
|
||||
<thead>
|
||||
<tr>
|
||||
<th><span class="title_box">{l s='Room No.'}</span></th>
|
||||
<th><span class="title_box">{l s='Room Image'}</th>
|
||||
<th><span class="title_box">{l s='Room Type'}</span></th>
|
||||
<th><span class="title_box">{l s='Duration'}</span></th>
|
||||
{if $occupancy_required_for_booking}
|
||||
<th><span class="fixed-width-lg title_box">{l s='Occupancy'}</span></th>
|
||||
{/if}
|
||||
<th><span class="title_box">{l s='Unit Price (tax excl)'}</span></th>
|
||||
<th><span class="title_box">{l s='Additinal Facilities (tax excl)'}</span></th>
|
||||
<th><span class="title_box">{l s='Total Rooms Price (tax excl)'}</span></th>
|
||||
<th><span class="title_box">{l s='Total Price (tax excl)'}</span></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if isset($cart_detail_data) && $cart_detail_data}
|
||||
{assign var=curr_id value=$cart->id_currency|intval}
|
||||
{foreach from=$cart_detail_data item=data}
|
||||
<tr data-id-booking-data="{$data.id}" data-id-product="{$data.id_product}" data-id-room="{$data.id_room}" data-date-from="{$data.date_from}" data-date-to="{$data.date_to}" >
|
||||
<td>{$data.room_num|escape:'html':'UTF-8'}</td>
|
||||
<td><img src="{$data.image_link|escape:'html':'UTF-8'}" title="Room image" /></td>
|
||||
<td>
|
||||
<p>{$data.room_type|escape:'html':'UTF-8'}</p>
|
||||
{if isset($data.selected_demands) && $data.selected_demands}
|
||||
<ul class="extra-demand-list">
|
||||
{foreach $data.selected_demands as $selDemand}
|
||||
<li>
|
||||
{$selDemand.name|escape:'html':'UTF-8'}
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{/if}
|
||||
</td>
|
||||
<td>{dateFormat date=$data.date_from} - {dateFormat date=$data.date_to}</td>
|
||||
{if $occupancy_required_for_booking}
|
||||
<th><span class="title_box">{l s='Extra Services / Fees (tax excl)'}</span></th>
|
||||
{* <th><span class="title_box">{l s='Total Rooms Price (tax excl)'}</span></th> *}
|
||||
<th><span class="title_box">{l s='Total Price (tax excl)'}</span></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{assign var=curr_id value=$cart->id_currency|intval}
|
||||
{foreach from=$cart_detail_data item=data}
|
||||
<tr data-id-booking-data="{$data.id}" data-id-product="{$data.id_product}" data-id-room="{$data.id_room}" data-date-from="{$data.date_from}" data-date-to="{$data.date_to}" >
|
||||
<td>{$data.room_num|escape:'html':'UTF-8'}</td>
|
||||
<td><img src="{$data.image_link|escape:'html':'UTF-8'}" title="Room image" /></td>
|
||||
<td>
|
||||
<div class="dropdown">
|
||||
<button class="booking_guest_occupancy btn btn-default btn-left btn-block input-occupancy" type="button">
|
||||
<span>
|
||||
{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
|
||||
</span>
|
||||
</button>
|
||||
<div class="dropdown-menu booking_occupancy_wrapper fixed-width-xxl">
|
||||
<div class="booking_occupancy_inner">
|
||||
<input type="hidden" class="max_adults" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_adults']|escape:'html':'UTF-8'}{/if}">
|
||||
<input type="hidden" class="max_children" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_children']|escape:'html':'UTF-8'}{/if}">
|
||||
<input type="hidden" class="max_guests" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_guests']|escape:'html':'UTF-8'}{/if}">
|
||||
<div class="occupancy_info_block selected" occ_block_index="0">
|
||||
<div class="occupancy_info_head col-sm-12"><span class="room_num_wrapper">{l s='Room - 1'}</span></div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6 occupancy_count_block">
|
||||
<div class="col-sm-12">
|
||||
<label>{l s='Adults'}</label>
|
||||
<input type="number" class="form-control num_occupancy num_adults" name="occupancy[0][adults]" value="{$data['adults']}" min="1" max="{$data['room_type_info']['max_adults']|escape:'html':'UTF-8'}">
|
||||
<p>{$data.room_type|escape:'html':'UTF-8'}</p>
|
||||
</td>
|
||||
<td>{dateFormat date=$data.date_from} - {dateFormat date=$data.date_to}</td>
|
||||
{if $occupancy_required_for_booking}
|
||||
<td>
|
||||
<div class="dropdown">
|
||||
<button class="booking_guest_occupancy btn btn-default btn-left btn-block input-occupancy" type="button">
|
||||
<span>
|
||||
{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
|
||||
</span>
|
||||
</button>
|
||||
<div class="dropdown-menu booking_occupancy_wrapper fixed-width-xxl">
|
||||
<div class="booking_occupancy_inner">
|
||||
<input type="hidden" class="max_adults" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_adults']|escape:'html':'UTF-8'}{/if}">
|
||||
<input type="hidden" class="max_children" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_children']|escape:'html':'UTF-8'}{/if}">
|
||||
<input type="hidden" class="max_guests" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_guests']|escape:'html':'UTF-8'}{/if}">
|
||||
<div class="occupancy_info_block selected" occ_block_index="0">
|
||||
<div class="occupancy_info_head col-sm-12"><span class="room_num_wrapper">{l s='Room - 1'}</span></div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6 occupancy_count_block">
|
||||
<div class="col-sm-12">
|
||||
<label>{l s='Adults'}</label>
|
||||
<input type="number" class="form-control num_occupancy num_adults" name="occupancy[0][adults]" value="{$data['adults']}" min="1" max="{$data['room_type_info']['max_adults']|escape:'html':'UTF-8'}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 occupancy_count_block">
|
||||
<div class="col-sm-12">
|
||||
<label>{l s='Children'} <span class="label-desc-txt"></span></label>
|
||||
<input type="number" class="form-control num_occupancy num_children" name="occupancy[0][children]" value="{$data['children']}" min="0" max="{$data['room_type_info']['max_children']|escape:'html':'UTF-8'}">
|
||||
({l s='Below'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years'})
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 occupancy_count_block">
|
||||
<div class="row children_age_info_block" {if !isset($data['child_ages']) || !$data['child_ages']}style="display:none"{/if}>
|
||||
<div class="col-sm-12">
|
||||
<label>{l s='Child'} <span class="label-desc-txt"></span></label>
|
||||
<input type="number" class="form-control num_occupancy num_children" name="occupancy[0][children]" value="{$data['children']}" min="0" max="{$data['room_type_info']['max_children']|escape:'html':'UTF-8'}">
|
||||
({l s='Below'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years'})
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row children_age_info_block" {if !isset($data['child_ages']) || !$data['child_ages']}style="display:none"{/if}>
|
||||
<div class="col-sm-12">
|
||||
<label class="col-sm-12">{l s='All Children'}</label>
|
||||
<div class="col-sm-12">
|
||||
<div class="row children_ages">
|
||||
{if isset($data['child_ages']) && $data['child_ages']}
|
||||
{foreach $data['child_ages'] as $childAge}
|
||||
<p class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
|
||||
<select class="guest_child_age room_occupancies" name="occupancy[0][child_ages][]">
|
||||
<option value="-1" {if $childAge == -1}selected{/if}>{l s='Select 1'}</option>
|
||||
<option value="0" {if $childAge == 0}selected{/if}>{l s='Under 1'}</option>
|
||||
{for $age=1 to ($max_child_age-1)}
|
||||
<option value="{$age|escape:'htmlall':'UTF-8'}" {if $childAge == $age}selected{/if}>{$age|escape:'htmlall':'UTF-8'}</option>
|
||||
{/for}
|
||||
</select>
|
||||
</p>
|
||||
{/foreach}
|
||||
{/if}
|
||||
<label class="col-sm-12">{l s='All Children'}</label>
|
||||
<div class="col-sm-12">
|
||||
<div class="row children_ages">
|
||||
{if isset($data['child_ages']) && $data['child_ages']}
|
||||
{foreach $data['child_ages'] as $childAge}
|
||||
<p class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
|
||||
<select class="guest_child_age room_occupancies" name="occupancy[0][child_ages][]">
|
||||
<option value="-1" {if $childAge == -1}selected{/if}>{l s='Select 1'}</option>
|
||||
<option value="0" {if $childAge == 0}selected{/if}>{l s='Under 1'}</option>
|
||||
{for $age=1 to ($max_child_age-1)}
|
||||
<option value="{$age|escape:'htmlall':'UTF-8'}" {if $childAge == $age}selected{/if}>{$age|escape:'htmlall':'UTF-8'}</option>
|
||||
{/for}
|
||||
</select>
|
||||
</p>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -116,78 +108,89 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
{/if}
|
||||
<td id="cart_detail_data_unit_price_{$data.id|escape:'html':'UTF-8'}">
|
||||
{if $data.feature_price_diff != 0}
|
||||
{assign var=shown_room_type_price value=$data.feature_price_tax_excl}
|
||||
{else}
|
||||
{assign var=shown_room_type_price value=$data.product_price_tax_excl}
|
||||
{/if}
|
||||
<div class="input-group">
|
||||
<input type="text" class="room_unit_price" value="{$shown_room_type_price|escape:'html':'UTF-8'}">
|
||||
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
|
||||
</div>
|
||||
</td>
|
||||
{/if}
|
||||
<td id="cart_detail_data_unit_price_{$data.id|escape:'html':'UTF-8'}">
|
||||
{if $data.feature_price_diff != 0}
|
||||
{assign var=shown_room_type_price value=$data.feature_price_tax_excl}
|
||||
{else}
|
||||
{assign var=shown_room_type_price value=$data.product_price_tax_excl}
|
||||
{/if}
|
||||
<input type="text" class="room_unit_price" value="{$shown_room_type_price|escape:'html':'UTF-8'}">
|
||||
</td>
|
||||
<td>
|
||||
{if isset($data.extra_demands) && $data.extra_demands}
|
||||
{displayPrice price=$data.demand_price|escape:'html':'UTF-8'}
|
||||
{else}
|
||||
{displayPrice price=0}
|
||||
{/if}
|
||||
</td>
|
||||
<td class="cart_line_total_rooms_price" id="cart_detail_data_price_{$data.id|escape:'html':'UTF-8'}">{displayPrice price=$data.amt_with_qty}</td>
|
||||
<td class="cart_line_total_price">
|
||||
{if isset($data.extra_demands) && $data.extra_demands}
|
||||
{displayPrice price=$data.amt_with_qty|escape:'html':'UTF-8'+$data.demand_price|escape:'html':'UTF-8'}
|
||||
{else}
|
||||
{displayPrice price=$data.amt_with_qty|escape:'html':'UTF-8'}
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
<button class="delete_hotel_cart_data btn btn-danger" data-id_room={$data.id_room|escape:'html':'UTF-8'} data-id_product={$data.id_product|escape:'html':'UTF-8'} data-id = {$data.id|escape:'html':'UTF-8'} data-id_cart = {$data.id_cart|escape:'html':'UTF-8'} data-date_to = {$data.date_to|escape:'html':'UTF-8'} data-date_from = {$data.date_from|escape:'html':'UTF-8'}>
|
||||
<i class="icon-trash"></i> {l s='Delete'}
|
||||
</button>
|
||||
{if isset($data.extra_demands) && $data.extra_demands}
|
||||
<br />
|
||||
<a href="#" id_room={$data.id_room|escape:'html':'UTF-8'} date_from="{$data.date_from|escape:'html':'UTF-8'}" date_to="{$data.date_to|escape:'html':'UTF-8'}" id_product="{$data.id_product|escape:'html':'UTF-8'}" id_cart="{$data.id_cart|escape:'html':'UTF-8'}" class="open_rooms_extra_demands btn btn-success" title="{l s='Click here to add or remove the additinal facilities of this room type.'}">
|
||||
<i class="icon-plus"></i> {l s='Facilities'}
|
||||
</a>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td>{l s='No Room Found in the cart.'}</td>
|
||||
</tr>
|
||||
<td>
|
||||
{if (isset($data.extra_demands) && $data.extra_demands) || (isset($data.additional_service) && $data.additional_service)}
|
||||
{displayPrice price=($data.demand_price + $data.additional_service_price + $data.additional_services_auto_add_price)|escape:'html':'UTF-8'}
|
||||
{else}
|
||||
{displayPrice price=0}
|
||||
{/if}
|
||||
</td>
|
||||
{* <td class="cart_line_total_rooms_price" id="cart_detail_data_price_{$data.id|escape:'html':'UTF-8'}">
|
||||
{displayPrice price=$data.amt_with_qty}</td> *}
|
||||
<td class="cart_line_total_price">
|
||||
{if (isset($data.extra_demands) && $data.extra_demands) || (isset($data.additional_service) && $data.additional_service)}
|
||||
{displayPrice price=($data.amt_with_qty + $data.additional_services_auto_add_price + $data.demand_price + $data.additional_service_price)|escape:'html':'UTF-8'}
|
||||
{else}
|
||||
{displayPrice price=$data.amt_with_qty|escape:'html':'UTF-8'}
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
<button class="delete_hotel_cart_data btn btn-danger" data-id_room={$data.id_room|escape:'html':'UTF-8'} data-id_product={$data.id_product|escape:'html':'UTF-8'} data-id = {$data.id|escape:'html':'UTF-8'} data-id_cart = {$data.id_cart|escape:'html':'UTF-8'} data-date_to = {$data.date_to|escape:'html':'UTF-8'} data-date_from = {$data.date_from|escape:'html':'UTF-8'}>
|
||||
<i class="icon-trash"></i> {l s='Delete'}
|
||||
</button>
|
||||
{if (isset($data.extra_demands) && $data.extra_demands) || isset($data.additional_service) && $data.additional_service}
|
||||
<br />
|
||||
<a href="#" id_room={$data.id_room|escape:'html':'UTF-8'} date_from="{$data.date_from|escape:'html':'UTF-8'}" date_to="{$data.date_to|escape:'html':'UTF-8'}" id_product="{$data.id_product|escape:'html':'UTF-8'}" id_cart="{$data.id_cart|escape:'html':'UTF-8'}" class="open_rooms_extra_demands btn btn-success" title="{l s='Click here to add or remove the extra services of this room type.'}">
|
||||
<i class="icon-pencil"></i> {l s='Services'}
|
||||
</a>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
{/if}
|
||||
{if isset($cart_normal_data) && $cart_normal_data}
|
||||
<thead>
|
||||
<tr>
|
||||
<th><span class="title_box">{l s='Image'}</th>
|
||||
<th><span class="title_box">{l s='Name'}</span></th>
|
||||
<th colspan="2"><span class="title_box">{l s='Hotel Name'}</span></th>
|
||||
<th colspan="2"><span class="title_box">{l s='Unit Price (tax excl)'}</span></th>
|
||||
<th><span class="title_box">{l s='Quantity'}</span></th>
|
||||
<th><span class="title_box">{l s='Total Price (Tax incl.)'}</span></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $cart_normal_data as $product}
|
||||
<tr>
|
||||
<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 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>{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'}>
|
||||
<i class="icon-trash"></i> {l s='Delete'}
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* Modal for extra demands *}
|
||||
<div class="modal" tabindex="-1" role="dialog" id="rooms_type_extra_demands">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h3 class="modal-title">{l s='Additional Facilities'}</h3>
|
||||
</div>
|
||||
<div class="modal-body" id="rooms_extra_demands">
|
||||
<div class="rooms_extra_demands_head">
|
||||
<p class="rooms_extra_demands_text">{l s='Add below additional facilities to the room for better hotel experience'}</p>
|
||||
</div>
|
||||
<div id="room_type_demands_desc"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">{l s='Close'}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{* <div class="modal" tabindex="-1" role="dialog" id="rooms_type_extra_demands">
|
||||
|
||||
</div> *}
|
||||
|
||||
{strip}
|
||||
{addJsDefL name=txtExtraDemandSucc}{l s='Updated Successfully' js=1}{/addJsDefL}
|
||||
@@ -205,6 +208,8 @@
|
||||
color:#979797;
|
||||
font-size:12px;}
|
||||
/*Extra demands CSS*/
|
||||
#rooms_type_extra_demands .modal-header {
|
||||
padding-bottom: 0px}
|
||||
#rooms_extra_demands {
|
||||
font-size: 16px;}
|
||||
#rooms_extra_demands .room_demands_container {
|
||||
@@ -212,7 +217,7 @@
|
||||
#rooms_extra_demands .demand_header {
|
||||
padding: 10px;
|
||||
color: #333;
|
||||
border-bottom: 1px solid #ddd;}
|
||||
border-bottom: 1px solid #ddd;}
|
||||
#rooms_extra_demands .rooms_extra_demands_head {
|
||||
margin-bottom: 18px;}
|
||||
#rooms_extra_demands .room_demand_block {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<tr id="new_product" style="display:none">
|
||||
<td style="display:none;" colspan="2" class="text-center">
|
||||
<td style="display:none;" colspan="3" class="text-center">
|
||||
<input type="hidden" id="add_product_product_id" name="add_product[product_id]" value="0" />
|
||||
|
||||
<div class="form-group">
|
||||
@@ -50,7 +50,7 @@
|
||||
<div class="room_check_in_div">
|
||||
<div class="input-group fixed-width-xl">
|
||||
<div class="input-group-addon">{l s='Check In'}</div>
|
||||
<input type="text" class="form-control add_product_date_from" name="add_product[date_from]" readonly />
|
||||
<input type="text" class="form-control add_room_date_from" name="add_product[date_from]" readonly />
|
||||
<div class="input-group-addon"><i class="icon-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -58,33 +58,13 @@
|
||||
<div class="room_check_out_div">
|
||||
<div class="input-group fixed-width-xl">
|
||||
<div class="input-group-addon">{l s='Check Out'}</div>
|
||||
<input type="text" class="form-control add_product_date_to" name="add_product[date_to]" readonly/>
|
||||
<input type="text" class="form-control add_room_date_to" name="add_product[date_to]" readonly/>
|
||||
<div class="input-group-addon"><i class="icon-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</center>
|
||||
</td>
|
||||
<td style="display:none;" class="text-center">
|
||||
<center>
|
||||
<div class="row">
|
||||
<div class="input-group fixed-width-xl">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
|
||||
<input type="text" name="add_product[product_price_tax_excl]" id="add_product_product_price_tax_excl" value="" />
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="row">
|
||||
<div class="input-group fixed-width-xl">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
|
||||
<input type="text" name="add_product[product_price_tax_incl]" id="add_product_product_price_tax_incl" value="" />
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
</center>
|
||||
</td>
|
||||
|
||||
<td style="display:none;" class="productQuantity text-center" colspan="2">
|
||||
<td style="display:none;" class="productQuantity text-center" colspan="1">
|
||||
{if $order->with_occupancy}
|
||||
<div class="booking_occupancy">
|
||||
<div class="dropdown">
|
||||
@@ -121,8 +101,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="occupancy-info-separator col-sm-12">
|
||||
</div>
|
||||
<hr class="occupancy-info-separator col-sm-12">
|
||||
</div>
|
||||
<div class="add_occupancy_block">
|
||||
<a class="add_new_occupancy_btn" href="#"><i class="icon-plus"></i> <span>{l s='Add Room'}</span></a>
|
||||
@@ -137,6 +117,27 @@
|
||||
{/if}
|
||||
|
||||
</td>
|
||||
<td style="display:none;" class="text-center" colspan="2">
|
||||
<center>
|
||||
<div class="row">
|
||||
<div class="input-group fixed-width-xl">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
|
||||
<input type="text" name="add_product[product_price_tax_excl]" id="add_product_product_price_tax_excl" value="" />
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="row">
|
||||
<div class="input-group fixed-width-xl">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
|
||||
<input type="text" name="add_product[product_price_tax_incl]" id="add_product_product_price_tax_incl" value="" />
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
</center>
|
||||
</td>
|
||||
|
||||
|
||||
{*{if ($order->hasBeenPaid())}<td style="display:none;" class="productQuantity"></td>{/if}
|
||||
{if $display_warehouse}<td></td>{/if}
|
||||
{if ($order->hasBeenDelivered())}<td style="display:none;" class="productQuantity"></td>{/if}
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
{*
|
||||
* 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
|
||||
*}
|
||||
<tr id="new_normal_product" style="display:none">
|
||||
<td style="display:none;" colspan="2">
|
||||
<input type="hidden" id="add_normal_product_product_id" name="add_product[product_id]" value="0" />
|
||||
|
||||
<div class="form-group">
|
||||
<label>{l s='Product:'}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" id="add_normal_product_product_name" value=""/>
|
||||
<div class="input-group-addon">
|
||||
<i class="icon-search"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* <div id="add_product_product_attribute_area" class="form-group" style="display: none;">
|
||||
<label>{l s='Combinations'}</label>
|
||||
<select name="add_product[product_attribute_id]" id="add_normal_product_attribute_id"></select>
|
||||
</div>
|
||||
|
||||
<div id="add_product_product_warehouse_area" class="form-group" style="display: none;">
|
||||
<label>{l s='Warehouse'}</label>
|
||||
<select id="add_product_warehouse" name="add_product_warehouse"></select>
|
||||
</div> *}
|
||||
</td>
|
||||
{if ($order->getTaxCalculationMethod() != $smarty.const.PS_TAX_EXC)}
|
||||
<td></td>
|
||||
{/if}
|
||||
<td style="display:none;">
|
||||
<div class="row">
|
||||
<div class="input-group fixed-width-xl">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
|
||||
<input type="text" name="add_product[product_price_tax_excl]" id="add_normal_product_price_tax_excl" value="" disabled="disabled" readonly="true"/>
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="row">
|
||||
<div class="input-group fixed-width-xl">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
|
||||
<input type="text" name="add_product[product_price_tax_incl]" id="add_normal_product_price_tax_incl" value="" disabled="disabled" readonly="true" />
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td style="display:none;" class="productQuantity">
|
||||
<input type="number" class="form-control fixed-width-sm" name="add_product[product_quantity]" id="add_normal_product_quantity" value="1" disabled="disabled" />
|
||||
</td>
|
||||
{if ($order->hasBeenPaid())}<td style="display:none;" class="productQuantity"></td>{/if}
|
||||
{if $display_warehouse}<td></td>{/if}
|
||||
{if ($order->hasBeenDelivered())}<td style="display:none;" class="productQuantity"></td>{/if}
|
||||
<td style="display:none;" class="productQuantity" id="add_normal_product_stock">0</td>
|
||||
<td style="display:none;" id="add_normal_product_total">{displayPrice price=0 currency=$currency->id}</td>
|
||||
<td style="display:none;" colspan="2">
|
||||
{if sizeof($invoices_collection)}
|
||||
<select class="form-control" name="add_product[invoice]" id="add_normal_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>
|
||||
{/if}
|
||||
</td>
|
||||
<td style="display:none;">
|
||||
<button type="button" class="btn btn-default" id="cancelAddNormalProduct">
|
||||
<i class="icon-remove text-danger"></i>
|
||||
{l s='Cancel'}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" id="submitAddNormalProduct" disabled="disabled">
|
||||
<i class="icon-ok text-success"></i>
|
||||
{l s='Add'}
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{* <tr id="new_invoice" style="display:none">
|
||||
<td colspan="10">
|
||||
<h4>{l s='New invoice information'}</h4>
|
||||
<div class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Carrier'}</label>
|
||||
<div class="col-lg-9">
|
||||
<p class="form-control-static"><strong>{$carrier->name}</strong></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Shipping Cost'}</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="add_invoice[free_shipping]" value="1" />
|
||||
{l s='Free shipping'}
|
||||
</label>
|
||||
<p class="help-block">{l s='If you don\'t select "Free shipping," the normal shipping cost will be applied.'}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr> *}
|
||||
@@ -23,7 +23,7 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<tr class="product-line-row" data-id_room="{$data.id_room}" data-id_product="{$data.id_product}" data-id_hotel="{$data.id_hotel}" data-date_from="{$data.date_from}" data-date_to="{$data.date_to}" data-product_price="{$data.unit_amt_tax_incl}" data-order_detail_id="{$data.id_order_detail}">
|
||||
<tr class="product-line-row" data-id_room="{$data.id_room}" data-id_product="{$data.id_product}" data-id_hotel="{$data.id_hotel}" data-date_from="{$data.date_from}" data-date_to="{$data.date_to}" data-product_price="{$data.unit_amt_tax_incl}" data-id_order_detail="{$data.id_order_detail}">
|
||||
{if $refund_allowed}
|
||||
<td class="standard_refund_fields" style="display:none">
|
||||
<input type="checkbox" name="id_htl_booking[]" value="{$data.id|escape:'html':'UTF-8'}" {if isset($refundReqBookings) && ($data.id|in_array:$refundReqBookings)}disabled{/if}/>
|
||||
@@ -37,16 +37,16 @@
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<p>{$data.room_type}</p>
|
||||
<p class="room_extra_demands {if !isset($data['extra_demands']) || !$data['extra_demands']}edit_product_fields{/if}" {if !isset($data['extra_demands']) || !$data['extra_demands']}style="display: none;"{/if}>
|
||||
<a href="#" data-toggle="modal" data-target="#rooms_type_extra_demands" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" class="open_room_extra_demands" id_htl_booking="{$data['id']}" edit_orde_line="0">
|
||||
{l s='Additional Features'}
|
||||
{* <p class="room_extra_demands {if !isset($data['extra_demands']) || !$data['extra_demands']}edit_product_fields{/if}" {if (!isset($data['extra_demands']) || !$data['extra_demands']) && (!isset($data['additional_services']) || !$data['additional_services'])}style="display: none;"{/if}>
|
||||
<a href="#" data-toggle="modal" data-target="#rooms_type_extra_demands" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" class="open_room_extra_services" id_htl_booking="{$data['id']}" edit_orde_line="0">
|
||||
{l s='Extra Services'}
|
||||
</a>
|
||||
</p>
|
||||
{if isset($data['extra_demands']) && $data['extra_demands']}
|
||||
</p> *}
|
||||
{* {if (isset($data['extra_demands']) && $data['extra_demands']) || (isset($data['additional_services']) && $data['additional_services'])}
|
||||
<p>
|
||||
{convertPriceWithCurrency price=$data['extra_demands_price_ti'] currency=$currency->id}
|
||||
{convertPriceWithCurrency price=($data['extra_demands_price_ti'] + $data['additional_services_price_ti']) currency=$currency->id}
|
||||
</p>
|
||||
{/if}
|
||||
{/if} *}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a href="{$link->getAdminLink('AdminAddHotel')}&id={$data['id_hotel']}&updatehtl_branch_info" target="_blank">
|
||||
@@ -162,21 +162,43 @@
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span class="room_unit_price_show">
|
||||
{if $data.feature_price_diff != 0}
|
||||
{* {if $data['feature_price_diff'] != 0}
|
||||
<span class="product_original_price room_type_old_price">
|
||||
{convertPriceWithCurrency price=$data.unit_price_without_reduction_tax_excl currency=$currency->id}
|
||||
{convertPriceWithCurrency price=$data['unit_price_without_reduction_tax_excl'] currency=$currency->id}
|
||||
</span>
|
||||
{/if}
|
||||
<span class="room_type_current_price">
|
||||
{convertPriceWithCurrency price=$data.paid_unit_price_tax_excl currency=$currency->id}
|
||||
</span>
|
||||
{/if} *}
|
||||
<p>
|
||||
<span class="room_type_current_price">
|
||||
{convertPriceWithCurrency price=$data['total_price_tax_excl'] currency=$currency->id}
|
||||
</span>
|
||||
</p>
|
||||
<p class="help-block">{l s='Per day price:'} {convertPriceWithCurrency price=$data['paid_unit_price_tax_excl'] currency=$currency->id}</p>
|
||||
</span>
|
||||
<div class="room_unit_price_edit" style="display: none;">
|
||||
<input type="text" class="room_unit_price" name="room_unit_price" value="{$data.paid_unit_price_tax_excl}">
|
||||
<input type="text" class="room_unit_price" name="room_unit_price" value="{$data['paid_unit_price_tax_excl']}">
|
||||
<p class="help-block">{l s='Set per day price'}</p>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span class="product_price_show">{convertPriceWithCurrency price=$data.amt_with_qty_tax_incl currency=$currency->id}</span>
|
||||
<span class="extra_service_show">
|
||||
{convertPriceWithCurrency price=($data['extra_demands_price_te'] + $data['additional_services_price_te'] + $data['convenience_fee_te'] + $data['additional_services_price_auto_add_te']) currency=$currency->id}
|
||||
{if ($data['extra_demands_price_te'] + $data['additional_services_price_te'] + $data['convenience_fee_te'] + $data['additional_services_price_auto_add_te']) > 0}
|
||||
<a href="#" data-toggle="modal" data-target="#rooms_type_extra_demands" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" class="open_room_extra_services" id_htl_booking="{$data['id']}">
|
||||
<i class="icon icon-lg icon-info-circle"></i>
|
||||
</a>
|
||||
{/if}
|
||||
</span>
|
||||
<span class="extra_service_edit" style="display: none;">
|
||||
<a href="#" data-toggle="modal" data-target="#rooms_type_extra_demands" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" class="open_room_extra_services" id_htl_booking="{$data['id']}">
|
||||
{convertPriceWithCurrency price=($data['extra_demands_price_te'] + $data['additional_services_price_te'] + $data['convenience_fee_te'] + $data['additional_services_price_auto_add_te']) currency=$currency->id}
|
||||
</a>
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span class="product_price_show">{convertPriceWithCurrency price=($data['total_room_tax']) currency=$currency->id}</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span class="product_price_show">{convertPriceWithCurrency price=($data['total_room_price_ti']) currency=$currency->id}</span>
|
||||
{if $can_edit}
|
||||
<div class="product_price_edit" style="display:none;">
|
||||
<div class="form-group">
|
||||
@@ -211,19 +233,6 @@
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
|
||||
<td class="text-center">
|
||||
{if $data.booking_type == HotelBookingDetail::ALLOTMENT_MANUAL && $data.comment|count_characters > 0}
|
||||
<p><strong>{l s='Message: '}</strong> <span>{$data.comment|escape:'htmlall':'UTF-8'}</span></p>
|
||||
{/if}
|
||||
{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 ($can_edit && !$order->hasBeenDelivered())}
|
||||
<td class="product_invoice" style="display: none;">
|
||||
{if sizeof($invoices_collection)}
|
||||
@@ -241,7 +250,7 @@
|
||||
<td class="product_action text-right">
|
||||
{* edit/delete controls *}
|
||||
<div class="btn-group pull-right">
|
||||
<button type="button" class="btn btn-default edit_product_change_link">
|
||||
<button type="button" class="btn btn-default edit_room_change_link">
|
||||
<i class="icon-pencil"></i>
|
||||
{l s='Edit'}
|
||||
</button>
|
||||
@@ -250,7 +259,13 @@
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="#" class="delete_product_line">
|
||||
<a href="#" 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}'>
|
||||
<i class="icon-refresh"></i>
|
||||
{l s='Reallocate Room'}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" class="delete_room_line">
|
||||
<i class="icon-trash"></i>
|
||||
{l s='Delete'}
|
||||
</a>
|
||||
@@ -258,11 +273,11 @@
|
||||
</ul>
|
||||
</div>
|
||||
{* Update controls *}
|
||||
<button type="button" class="btn btn-default submitProductChange" style="display: none;">
|
||||
<button type="button" class="btn btn-default submitRoomChange" 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;">
|
||||
<button type="button" class="btn btn-default cancel_room_change_link" style="display: none;">
|
||||
<i class="icon-remove"></i>
|
||||
{l s='Cancel'}
|
||||
</button>
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title"><i class="icon-tasks"></i> {l s='Additional Facilities'} {if isset($orderEdit) && $orderEdit}<span class="badge badge-success demand_edit_badge">{l s='edit'}</span>{/if} <button type="button" class="close pull-right" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="modal-body" id="rooms_extra_demands">
|
||||
<div id="room_type_demands_desc" class="row">
|
||||
<input type="hidden" value="0" id="id_htl_booking">
|
||||
{if isset($orderEdit) && $orderEdit}
|
||||
<p class="col-sm-12 facility_nav_btn">
|
||||
<button id="btn_new_room_facility" class="btn btn-success"><i class="icon-plus"></i> {l s='Add new facility'}</button>
|
||||
<button id="back_to_facilities_btn" class="btn btn-default"><i class="icon-arrow-left"></i> {l s='Back'}</button>
|
||||
</p>
|
||||
|
||||
{* Already selected room demands *}
|
||||
<div class="col-sm-12 room_ordered_demands table-responsive">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
{if isset($extraDemands) && $extraDemands}
|
||||
{foreach $extraDemands as $roomDemand}
|
||||
{foreach $roomDemand['extra_demands'] as $demand}
|
||||
<tr>
|
||||
<td>{$demand['name']}</td>
|
||||
<td>{displayPrice price=$demand['total_price_tax_incl'] currency=$orderCurrency}</td>
|
||||
<td><a class="btn btn-danger pull-right del-order-room-demand" href="#" id_booking_demand="{$demand['id_booking_demand']}"><i class="icon-trash"></i></a></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<i class="icon-warning"></i> {l s='No additional facilities added yet.'}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{* Room demands available for the current editing room*}
|
||||
<div class="col-sm-12 room_demands_container">
|
||||
<div class="room_demand_detail">
|
||||
{if isset($roomTypeDemands) && $roomTypeDemands}
|
||||
{foreach $roomTypeDemands as $idGlobalDemand => $demand}
|
||||
<div class="row room_demand_block">
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="col-xs-2">
|
||||
<input id_cart_booking="{$roomDemand['id']}" value="{$idGlobalDemand|escape:'html':'UTF-8'}" type="checkbox" class="id_room_type_demand" {if isset($roomDemand['selected_global_demands']) && $roomDemand['selected_global_demands'] && ($idGlobalDemand|in_array:$roomDemand['selected_global_demands'])}checked{/if} />
|
||||
</div>
|
||||
<div class="col-xs-10 demand_adv_option_block">
|
||||
<p>{$demand['name']|escape:'html':'UTF-8'}</p>
|
||||
{if isset($demand['adv_option']) && $demand['adv_option']}
|
||||
<select class="id_option">
|
||||
{foreach $demand['adv_option'] as $idOption => $option}
|
||||
{assign var=demand_key value="`$idGlobalDemand`-`$idOption`"}
|
||||
<option optionPrice="{$option['price']|escape:'html':'UTF-8'}" value="{$idOption|escape:'html':'UTF-8'}" {if isset($roomDemand['extra_demands'][$demand_key])}selected{/if} key="{$demand_key}">{$option['name']}</option>
|
||||
{if isset($roomDemand['extra_demands'][$demand_key])}
|
||||
{assign var=selected_adv_option value="$idOption"}
|
||||
{/if}
|
||||
{/foreach}
|
||||
</select>
|
||||
{else}
|
||||
<input type="hidden" class="id_option" value="0" />
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<p><span class="pull-right extra_demand_option_price">{if isset($selected_adv_option) && isset($demand['adv_option'][$selected_adv_option]['price'])}{convertPrice price = $demand['adv_option'][$selected_adv_option]['price']|escape:'html':'UTF-8'}{else}{convertPrice price = $demand['price']|escape:'html':'UTF-8'}{/if}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{elseif isset($extraDemands) && $extraDemands}
|
||||
{foreach $extraDemands as $roomDemand}
|
||||
<div class="col-sm-12">
|
||||
<div class="col-sm-12 room_demand_detail">
|
||||
{foreach $roomDemand['extra_demands'] as $demand}
|
||||
<p>
|
||||
<span>{$demand['name']}</span>
|
||||
<span class="pull-right">{displayPrice price=$demand['total_price_tax_incl'] currency=$orderCurrency}</span>
|
||||
</p>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary pull-left" data-dismiss="modal">{l s='Close'}</button>
|
||||
<button type="button" id="save_room_facilities" class="btn btn-success pull-right"><i class="icon-save"></i> {l s='Save'}</button>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{* Css for handling extra demands changes *}
|
||||
<style type="text/css">
|
||||
/*Extra demands CSS*/
|
||||
#rooms_type_extra_demands .modal-title {
|
||||
margin: 0px;}
|
||||
#rooms_type_extra_demands .demand_edit_badge {
|
||||
font-size: 14px;}
|
||||
#rooms_extra_demands .room_ordered_demands td, #rooms_extra_demands .room_demand_detail {
|
||||
font-size: 14px;}
|
||||
#rooms_extra_demands .demand_header {
|
||||
padding: 10px;
|
||||
color: #333;
|
||||
border-bottom: 1px solid #ddd;}
|
||||
#rooms_extra_demands .room_demand_block {
|
||||
margin-bottom: 15px;
|
||||
color: #333;
|
||||
font-size: 14px;}
|
||||
#rooms_extra_demands .facility_nav_btn {
|
||||
margin-bottom: 20px;}
|
||||
#rooms_extra_demands .room_demands_container {
|
||||
display: none;}
|
||||
#room_extra_demand_content #save_room_facilities, #room_extra_demand_content #back_to_facilities_btn {
|
||||
display: none;}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
{*
|
||||
* 2010-2023 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-2023 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active"><a href="#room_type_demands_desc" aria-controls="facilities" role="tab" data-toggle="tab">{l s='Facilities'}</a></li>
|
||||
<li role="presentation"><a href="#room_type_service_product_desc" aria-controls="services" role="tab" data-toggle="tab">{l s='Services'}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="modal-body" id="rooms_extra_demands">
|
||||
<div class="tab-content clearfix">
|
||||
{include file='controllers/orders/_room_facilities_block.tpl'}
|
||||
{include file='controllers/orders/_room_services_block.tpl'}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* Css for handling extra demands changes *}
|
||||
<style type="text/css">
|
||||
/*Extra demands CSS*/
|
||||
#room_extra_demand_content .modal-header {
|
||||
padding-bottom: 0px;}
|
||||
#rooms_type_extra_demands .modal-title {
|
||||
margin: 0px;}
|
||||
#rooms_extra_demands .demand_header {
|
||||
padding: 10px;
|
||||
color: #333;
|
||||
border-bottom: 1px solid #ddd;}
|
||||
#rooms_extra_demands .room_demand_block {
|
||||
margin-bottom: 15px;
|
||||
color: #333;
|
||||
font-size: 14px;}
|
||||
#rooms_extra_demands .facility_nav_btn {
|
||||
margin-bottom: 20px;}
|
||||
#rooms_extra_demands .room_demands_container, #rooms_extra_demands .room_services_container {
|
||||
display: none;}
|
||||
#room_extra_demand_content #save_room_demands, #room_extra_demand_content #back_to_demands_btn, #room_extra_demand_content #save_service_service, #room_extra_demand_content #back_to_service_btn {
|
||||
display: none;}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
{*
|
||||
* 2010-2023 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-2023 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div id="room_type_demands_desc" class="tab-pane active">
|
||||
<input type="hidden" value="{$id_booking_detail}" id="id_htl_booking">
|
||||
{if isset($orderEdit) && $orderEdit}
|
||||
<p class="col-sm-12 facility_nav_btn">
|
||||
<button id="btn_new_room_demand" class="btn btn-success"><i class="icon-plus"></i> {l s='Add new facility'}</button>
|
||||
<button id="back_to_demands_btn" class="btn btn-default"><i class="icon-arrow-left"></i> {l s='Back'}</button>
|
||||
</p>
|
||||
|
||||
{* Already selected room demands *}
|
||||
<div class="col-sm-12 room_ordered_demands table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{l s='Name'}</th>
|
||||
<th>{l s='Unit price'}</th>
|
||||
<th>{l s='Total price'}</th>
|
||||
<th class="text-right">{l s='Action'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if isset($extraDemands) && $extraDemands}
|
||||
{foreach $extraDemands as $roomDemand}
|
||||
{foreach $roomDemand['extra_demands'] as $demand}
|
||||
<tr>
|
||||
<td>{$demand['name']}</td>
|
||||
<td>
|
||||
{displayPrice price=$demand['unit_price_tax_excl'] currency=$orderCurrency}
|
||||
{if $demand['price_calc_method'] == HotelRoomTypeGlobalDemand::WK_PRICE_CALC_METHOD_EACH_DAY}
|
||||
{l s='/ night'}
|
||||
{/if}
|
||||
</td>
|
||||
<td>{displayPrice price=$demand['total_price_tax_excl'] currency=$orderCurrency}</td>
|
||||
<td><a class="btn btn-danger pull-right del-order-room-demand" href="#" id_booking_demand="{$demand['id_booking_demand']}"><i class="icon-trash"></i></a></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<i class="icon-warning"></i> {l s='No facilities added yet.'}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{* Room demands available for the current editing room*}
|
||||
<div class="col-sm-12 room_demands_container">
|
||||
<div class="room_demand_detail">
|
||||
{if isset($roomTypeDemands) && $roomTypeDemands}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>{l s='Name'}</th>
|
||||
<th>{l s='Option'}</th>
|
||||
<th class="text-right">{l s='Price'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $roomTypeDemands as $idGlobalDemand => $demand}
|
||||
<tr class="room_demand_block">
|
||||
<td>
|
||||
<input id_cart_booking="{$roomDemand['id']}" value="{$idGlobalDemand|escape:'html':'UTF-8'}" type="checkbox" class="id_room_type_demand" {if isset($roomDemand['selected_global_demands']) && $roomDemand['selected_global_demands'] && ($idGlobalDemand|in_array:$roomDemand['selected_global_demands'])}checked{/if} />
|
||||
</td>
|
||||
<td>
|
||||
{$demand['name']|escape:'html':'UTF-8'}
|
||||
</td>
|
||||
<td class="demand_adv_option_block">
|
||||
{if isset($demand['adv_option']) && $demand['adv_option']}
|
||||
<select class="id_option">
|
||||
{foreach $demand['adv_option'] as $idOption => $option}
|
||||
{assign var=demand_key value="`$idGlobalDemand`-`$idOption`"}
|
||||
<option optionPrice="{$option['price_tax_excl']|escape:'html':'UTF-8'}" value="{$idOption|escape:'html':'UTF-8'}" {if isset($roomDemand['extra_demands'][$demand_key])}selected{/if} key="{$demand_key}">{$option['name']}</option>
|
||||
{if isset($roomDemand['extra_demands'][$demand_key])}
|
||||
{assign var=selected_adv_option value="$idOption"}
|
||||
{/if}
|
||||
{/foreach}
|
||||
</select>
|
||||
{else}
|
||||
{l s='--'}
|
||||
<input type="hidden" class="id_option" value="0" />
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span class="extra_demand_option_price">
|
||||
{if isset($selected_adv_option) && isset($demand['adv_option'][$selected_adv_option]['price_tax_excl'])}{convertPrice price = $demand['adv_option'][$selected_adv_option]['price_tax_excl']|escape:'html':'UTF-8'}{else if isset($demand['adv_option']) && $demand['adv_option']}{convertPrice price = $demand['adv_option'][$demand['adv_option']|@key]['price_tax_excl']}{else}{convertPrice price = $demand['price_tax_excl']|escape:'html':'UTF-8'}{/if}
|
||||
</span>
|
||||
{if $demand['price_calc_method'] == HotelRoomTypeGlobalDemand::WK_PRICE_CALC_METHOD_EACH_DAY}
|
||||
{l s='/ night'}
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{else}
|
||||
<i class="icon-warning"></i> {l s='No facilities available for this room.'}
|
||||
{/if}
|
||||
</div>
|
||||
<button type="button" id="save_room_demands" class="btn btn-success pull-right"><i class="icon-save"></i> {l s='Save'}</button>
|
||||
</div>
|
||||
{elseif isset($extraDemands) && $extraDemands}
|
||||
{foreach $extraDemands as $roomDemand}
|
||||
<div class="row room_demand_detail">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{l s='Name'}</th>
|
||||
<th>{l s='Unit price'}</th>
|
||||
<th class="text-right">{l s='Total price'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $roomDemand['extra_demands'] as $demand}
|
||||
<tr class="room_demand_block">
|
||||
<td>{$demand['name']}</td>
|
||||
<td>
|
||||
{displayPrice price=$demand['unit_price_tax_excl'] currency=$orderCurrency}
|
||||
{if $demand['price_calc_method'] == HotelRoomTypeGlobalDemand::WK_PRICE_CALC_METHOD_EACH_DAY}
|
||||
{l s='night'}
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-right">{displayPrice price=$demand['total_price_tax_excl'] currency=$orderCurrency}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{/foreach}
|
||||
{else}
|
||||
{l s='No facilities selected!'}
|
||||
{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,167 @@
|
||||
{*
|
||||
* 2010-2023 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-2023 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div id="room_type_service_product_desc" class="tab-pane {if isset($show_active) && $show_active}active{/if}">
|
||||
{if isset($orderEdit) && $orderEdit}
|
||||
|
||||
<p class="col-sm-12 facility_nav_btn">
|
||||
<button id="btn_new_room_service" class="btn btn-success"><i class="icon-plus"></i> {l s='Add new service'}</button>
|
||||
<button id="back_to_service_btn" class="btn btn-default"><i class="icon-arrow-left"></i> {l s='Back'}</button>
|
||||
</p>
|
||||
|
||||
{* Already selected room services *}
|
||||
<div class="col-sm-12 room_ordered_services table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{l s='Name'}</th>
|
||||
<th></th>
|
||||
<th class="fixed-width-md">{l s='Quantity'}</th>
|
||||
<th>{l s='Price'}</th>
|
||||
<th class="text-right">{l s='Action'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if isset($additionalServices) && $additionalServices}
|
||||
{foreach $additionalServices['additional_services'] as $service}
|
||||
<tr class="room_demand_block">
|
||||
<td>
|
||||
<div>{$service['name']|escape:'html':'UTF-8'}</div>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{if $service['product_auto_add'] && $service['product_price_addition_type'] == Product::PRICE_ADDITION_TYPE_WITH_ROOM}
|
||||
<span class="badge badge-info label">{l s='Auto added'}</span><br>
|
||||
{/if}
|
||||
{if $service['product_auto_add'] && $service['product_price_addition_type'] == Product::PRICE_ADDITION_TYPE_INDEPENDENT}
|
||||
<span class="badge badge-info label">{l s='Convenience fee'}</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{if $service['allow_multiple_quantity']}
|
||||
<div class="qty_container">
|
||||
<input type="number" class="form-control qty" min="1" data-id_room_type_service_product_order_detail="{$service['id_room_type_service_product_order_detail']}" data-id_product="{$service['id_product']|escape:'html':'UTF-8'}" value="{$service['quantity']|escape:'html':'UTF-8'}">
|
||||
</div>
|
||||
{else}
|
||||
--
|
||||
{/if}
|
||||
</td>
|
||||
<td>{displayPrice price=$service['total_price_tax_excl']|escape:'html':'UTF-8' currency=$orderCurrency}</td>
|
||||
<td><a class="btn btn-danger pull-right del_room_additional_service" data-id_room_type_service_product_order_detail="{$service['id_room_type_service_product_order_detail']}" href="#"><i class="icon-trash"></i></a></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<i class="icon-warning"></i> {l s='No services added yet.'}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<form id="add_room_services_form" class="col-sm-12 room_services_container">
|
||||
<div class="room_demand_detail">
|
||||
{if isset($roomTypeServiceProducts) && $roomTypeServiceProducts}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>{l s='Name'}</th>
|
||||
<th></th>
|
||||
<th class="fixed-width-md">{l s='Quantity'}</th>
|
||||
<th class="text-right">{l s='Price'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $roomTypeServiceProducts as $product}
|
||||
<tr class="room_demand_block">
|
||||
<td>
|
||||
<input data-id_booking_detail="{$id_booking_detail}" value="{$product['id_product']|escape:'html':'UTF-8'}" name="selected_service[]" type="checkbox" class="id_room_type_service"/>
|
||||
</td>
|
||||
<td>
|
||||
{$product['name']|escape:'html':'UTF-8'}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{if $product['auto_add_to_cart'] && $product['price_addition_type'] == Product::PRICE_ADDITION_TYPE_WITH_ROOM}
|
||||
<span class="badge badge-info label">{l s='Auto added'}</span><br>
|
||||
{/if}
|
||||
{if $product['auto_add_to_cart'] && $product['price_addition_type'] == Product::PRICE_ADDITION_TYPE_INDEPENDENT}
|
||||
<span class="badge badge-info label">{l s='Convenience fee'}</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{if $product.allow_multiple_quantity}
|
||||
<div class="qty_container">
|
||||
<input type="number" class="form-control qty" min="1" id="qty_{$product['id_product']|escape:'html':'UTF-8'}" name="service_qty[{$product['id_product']|escape:'html':'UTF-8'}]" data-id-product="{$product.id_product|escape:'html':'UTF-8'}" value="1">
|
||||
</div>
|
||||
{else}
|
||||
{l s='--'}
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-right">
|
||||
{convertPrice price=$product.price_tax_exc}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{else}
|
||||
<i class="icon-warning"></i> {l s='No services available to add to this room.'}
|
||||
{/if}
|
||||
</div>
|
||||
<input type="hidden" name="id_booking_detail" value="{$id_booking_detail}">
|
||||
<button type="submit" id="save_service_service" class="btn btn-success pull-right"><i class="icon-save"></i> {l s='Save'}</button>
|
||||
</form>
|
||||
|
||||
{elseif isset($additionalServices) && $additionalServices}
|
||||
<table class="table room_demand_detail">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{l s='ID'}</th>
|
||||
<th>{l s='Name'}</th>
|
||||
<th></th>
|
||||
<th class="text-right">{l s='Total Price'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
{foreach $additionalServices['additional_services'] as $service}
|
||||
<tr class="room_demand_block">
|
||||
<td>
|
||||
{$service['id_product']|escape:'html':'UTF-8'} <a target="blank" href="{$link->getAdminLink('AdminNormalProducts')|escape:'html':'UTF-8'}&id_product={$service['id_product']|escape:'html':'UTF-8'}&updateproduct"><i class="icon-external-link-sign"></i></a>
|
||||
</td>
|
||||
<td>{$service['name']|escape:'html':'UTF-8'}</td>
|
||||
<td class="text-center">
|
||||
{if $service['product_auto_add'] && $service['product_price_addition_type'] == Product::PRICE_ADDITION_TYPE_INDEPENDENT}
|
||||
<span class="badge badge-info label">{l s='Convenience fee'}</span>
|
||||
{/if}
|
||||
{if $service['product_auto_add'] && $service['product_price_addition_type'] == Product::PRICE_ADDITION_TYPE_WITH_ROOM}
|
||||
<span class="badge badge-info label">{l s='Auto added'}</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-right">
|
||||
{displayPrice price=$service['total_price_tax_excl'] currency=$orderCurrency}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{else}
|
||||
{l s='No services selected!'}
|
||||
{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,44 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<table class="table" id="customer_cart_details">
|
||||
<thead>
|
||||
<tr>
|
||||
{if $refund_allowed}
|
||||
<th class="standard_refund_fields" style="display:none"></th>
|
||||
{/if}
|
||||
<th class="text-center"><span class="title_box">{l s='Room No.'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Room Image'}</th>
|
||||
<th class="text-center"><span class="title_box">{l s='Room Type'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Hotel Name'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Duration'}</span></th>
|
||||
<th class="text-center fixed-width-lg"><span class="title_box">{l s='Occupancy'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Room Price (Tax excl.)'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Extra Services/Fee (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($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}
|
||||
{if ($can_edit && !$order->hasBeenDelivered())}
|
||||
<th class="text-center"><span class="title_box">{l s='Edit Order'}</th>
|
||||
{/if}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if $order_detail_data}
|
||||
{foreach from=$order_detail_data item=data}
|
||||
{* Include product line partial *}
|
||||
{include file='controllers/orders/_product_line.tpl'}
|
||||
{/foreach}
|
||||
{else}
|
||||
{* <tr>
|
||||
<td>{l s='No Data Found.'}</td>
|
||||
</tr> *}
|
||||
{/if}
|
||||
{* Include product line partial *}
|
||||
{include file='controllers/orders/_new_product.tpl'}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,139 @@
|
||||
{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>
|
||||
@@ -0,0 +1,41 @@
|
||||
<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>
|
||||
@@ -180,6 +180,42 @@
|
||||
$(this).closest("tr").remove();
|
||||
}
|
||||
});
|
||||
|
||||
$('body').on('click', '.delete_service_product', function(){
|
||||
if (confirm("{l s='Are you sure?'}"))
|
||||
{
|
||||
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url: "{$link->getAdminLink('AdminOrders')|addslashes}",
|
||||
data : {
|
||||
ajax: true,
|
||||
action: "deleteProductProcess",
|
||||
id_product: $(this).data('id_product'),
|
||||
id_cart: $(this).data('id_cart'),
|
||||
id_hotel: $(this).data('id_hotel'),
|
||||
},
|
||||
dataType:"json",
|
||||
success : function(data)
|
||||
{
|
||||
if (data.status == 'deleted')
|
||||
{
|
||||
showSuccessMessage("{l s='Remove successful'}");
|
||||
location.reload();
|
||||
{* if (data.cart_rooms)
|
||||
location.reload();
|
||||
else
|
||||
window.location.href = "{$link->getAdminLink('AdminHotelRoomsBooking',true)}"; *}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("l s='Some error occured.please try again.'}");
|
||||
}
|
||||
}
|
||||
});
|
||||
$(this).closest("tr").remove();
|
||||
}
|
||||
});
|
||||
/*END*/
|
||||
|
||||
$('input:radio[name="free_shipping"]').on('change',function() {
|
||||
@@ -613,7 +649,6 @@
|
||||
|
||||
function updateRoomOccupancy(params, cart_row)
|
||||
{
|
||||
debugger;
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
|
||||
@@ -640,10 +675,11 @@
|
||||
}
|
||||
|
||||
function updateCartSummaryData(summaryData) {
|
||||
$('#total_products').html(formatCurrency(parseFloat(summaryData.summary.total_products), currency_format, currency_sign, currency_blank));
|
||||
$('#total_extra_demands').html(formatCurrency(parseFloat(summaryData.summary.total_extra_demands_tax_exc), currency_format, currency_sign, currency_blank));
|
||||
$('#total_rooms').html(formatCurrency(parseFloat(jsonSummary.summary.total_rooms + jsonSummary.summary.total_extra_demands + jsonSummary.summary.total_additional_services + jsonSummary.summary.total_additional_services_auto_add), currency_format, currency_sign, currency_blank));
|
||||
$('#total_vouchers').html(formatCurrency(parseFloat(summaryData.summary.total_discounts_tax_exc), currency_format, currency_sign, currency_blank));
|
||||
$('#total_without_taxes').html(formatCurrency(parseFloat(summaryData.summary.total_price_without_tax), currency_format, currency_sign, currency_blank));
|
||||
$('#total_convenience_fees').html(formatCurrency(parseFloat(jsonSummary.summary.convenience_fee), currency_format, currency_sign, currency_blank));
|
||||
$('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price_without_tax - jsonSummary.summary.convenience_fee), currency_format, currency_sign, currency_blank));
|
||||
// $('#total_service_products').html(formatCurrency(parseFloat(jsonSummary.summary.total_service_products), currency_format, currency_sign, currency_blank));
|
||||
$('#total_taxes').html(formatCurrency(parseFloat(summaryData.summary.total_tax), currency_format, currency_sign, currency_blank));
|
||||
$('#total_with_taxes').html(formatCurrency(parseFloat(summaryData.summary.total_price), currency_format, currency_sign, currency_blank));
|
||||
}
|
||||
@@ -889,24 +925,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
// commented by webkul to enable button in case of ordering virtual product
|
||||
function checkVirtualProduct(products, delivery_option_list) {
|
||||
if (delivery_option_list.length == 0 && products.length > 0) {
|
||||
var find = 1;
|
||||
$.each(products, function () {
|
||||
if (find == 1) {
|
||||
this.is_virtual == 1 ? find = 1 : find = 0;
|
||||
}
|
||||
});
|
||||
if (find == 1) {
|
||||
$("button[name=\"submitAddOrder\"]").removeAttr("disabled");
|
||||
}
|
||||
else {
|
||||
$("button[name=\"submitAddOrder\"]").attr("disabled", "disabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function searchProducts()
|
||||
{
|
||||
$('#products_part').show();
|
||||
@@ -1121,7 +1139,6 @@
|
||||
}
|
||||
|
||||
updateDeliveryOptionList(jsonSummary.delivery_option_list);
|
||||
checkVirtualProduct(jsonSummary.summary.products,jsonSummary.delivery_option_list);
|
||||
|
||||
if (jsonSummary.cart.gift == 1) {
|
||||
$('#order_gift').attr('checked', true);
|
||||
@@ -1148,12 +1165,13 @@
|
||||
shipping_price_selected_carrier = jsonSummary.summary.total_shipping;
|
||||
|
||||
$('#total_vouchers').html(formatCurrency(parseFloat(jsonSummary.summary.total_discounts_tax_exc), currency_format, currency_sign, currency_blank));
|
||||
$('#total_shipping').html(formatCurrency(parseFloat(jsonSummary.summary.total_shipping_tax_exc), currency_format, currency_sign, currency_blank));
|
||||
$('#total_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_tax), currency_format, currency_sign, currency_blank));
|
||||
$('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price_without_tax), currency_format, currency_sign, currency_blank));
|
||||
$('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price_without_tax - jsonSummary.summary.convenience_fee), currency_format, currency_sign, currency_blank));
|
||||
$('#total_with_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price), currency_format, currency_sign, currency_blank));
|
||||
$('#total_extra_demands').html(formatCurrency(parseFloat(jsonSummary.summary.total_extra_demands_tax_exc), currency_format, currency_sign, currency_blank));
|
||||
$('#total_products').html(formatCurrency(parseFloat(jsonSummary.summary.total_products), currency_format, currency_sign, currency_blank));
|
||||
$('#total_rooms').html(formatCurrency(parseFloat(jsonSummary.summary.total_rooms + jsonSummary.summary.total_extra_demands + jsonSummary.summary.total_additional_services + jsonSummary.summary.total_additional_services_auto_add), currency_format, currency_sign, currency_blank));
|
||||
$('#total_convenience_fees').html(formatCurrency(parseFloat(jsonSummary.summary.convenience_fee), currency_format, currency_sign, currency_blank));
|
||||
// $('#total_service_products').html(formatCurrency(parseFloat(jsonSummary.summary.total_service_products), currency_format, currency_sign, currency_blank));
|
||||
|
||||
id_currency = jsonSummary.cart.id_currency;
|
||||
$('#id_currency option').removeAttr('selected');
|
||||
$('#id_currency option[value="'+id_currency+'"]').attr('selected', true);
|
||||
@@ -1450,8 +1468,9 @@
|
||||
},
|
||||
success: function(response) {
|
||||
if (response.status) {
|
||||
$('#rooms_type_extra_demands').find('#room_type_demands_desc').html('');
|
||||
$('#rooms_type_extra_demands').find('#room_type_demands_desc').append(response.html_exta_demands);
|
||||
$('#customer_cart_details').after(response.html_exta_demands);
|
||||
// $('#rooms_type_extra_demands').find('#room_type_demands_desc').html('');
|
||||
// $('#rooms_type_extra_demands').find('#room_type_demands_desc').append(response.html_exta_demands);
|
||||
$('#rooms_type_extra_demands').modal('show');
|
||||
}
|
||||
},
|
||||
@@ -1506,38 +1525,91 @@
|
||||
extra_demand_price = formatCurrency(extra_demand_price, currency_format, currency_sign, currency_blank);
|
||||
$(this).closest('.room_demand_block').find('.extra_demand_option_price').text(extra_demand_price);
|
||||
var roomDemands = [];
|
||||
// get the selected extra demands by customer
|
||||
$(this).closest('.room_demand_detail').find('input:checkbox.id_room_type_demand:checked').each(function () {
|
||||
roomDemands.push({
|
||||
'id_global_demand':$(this).val(),
|
||||
'id_option': $(this).closest('.room_demand_block').find('.id_option').val()
|
||||
if ($(this).closest('.room_demand_block').find('input:checkbox.id_room_type_demand').is(':checked')) {
|
||||
// get the selected extra demands by customer
|
||||
$(this).closest('.room_demand_detail').find('input:checkbox.id_room_type_demand:checked').each(function () {
|
||||
roomDemands.push({
|
||||
'id_global_demand':$(this).val(),
|
||||
'id_option': $(this).closest('.room_demand_block').find('.id_option').val()
|
||||
});
|
||||
});
|
||||
});
|
||||
var idBookingCart = $(this).closest('.room_demand_block').find('.id_room_type_demand').attr('id_cart_booking');
|
||||
var idBookingCart = $(this).closest('.room_demand_block').find('.id_room_type_demand').attr('id_cart_booking');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
headers: {
|
||||
"cache-control": "no-cache"
|
||||
},
|
||||
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
|
||||
dataType: 'JSON',
|
||||
cache: false,
|
||||
data: {
|
||||
id_cart_booking: idBookingCart,
|
||||
room_demands: JSON.stringify(roomDemands),
|
||||
action: 'changeRoomDemands',
|
||||
ajax: true
|
||||
},
|
||||
success: function(response) {
|
||||
if (response.status) {
|
||||
showSuccessMessage(txtExtraDemandSucc);
|
||||
} else {
|
||||
showErrorMessage(txtExtraDemandErr);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.change_room_type_service_product', function() {
|
||||
updateServiceProducts(this);
|
||||
});
|
||||
|
||||
$(document).on('focusout', '#rooms_type_extra_demands .qty', function(e) {
|
||||
var qty_wntd = $(this).val();
|
||||
if (qty_wntd == '' || !$.isNumeric(qty_wntd)) {
|
||||
$(this).val(1);
|
||||
}
|
||||
if ($(this).closest('.room_demand_block').find('.change_room_type_service_product').is(':checked')) {
|
||||
updateServiceProducts($(this).closest('.room_demand_block').find('.change_room_type_service_product'));
|
||||
}
|
||||
});
|
||||
|
||||
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();
|
||||
if (typeof(qty) == 'undefined') {
|
||||
qty = 1;
|
||||
}
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
headers: {
|
||||
"cache-control": "no-cache"
|
||||
},
|
||||
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
|
||||
url: "{$link->getAdminLink('AdminOrders')|addslashes}",
|
||||
dataType: 'JSON',
|
||||
cache: false,
|
||||
data: {
|
||||
id_cart_booking: idBookingCart,
|
||||
room_demands: JSON.stringify(roomDemands),
|
||||
action: 'changeRoomDemands',
|
||||
operator: operator,
|
||||
id_product: id_product,
|
||||
id_cart_booking: id_cart_booking,
|
||||
qty: qty,
|
||||
action: 'updateServiceProduct',
|
||||
ajax: true
|
||||
},
|
||||
success: function(response) {
|
||||
if (response.status) {
|
||||
success: function(jsonData) {
|
||||
if (!jsonData.hasError) {
|
||||
showSuccessMessage(txtExtraDemandSucc);
|
||||
} else {
|
||||
showErrorMessage(txtExtraDemandErr);
|
||||
showErrorMessage(jsonData.errors);
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1933,15 +2005,21 @@
|
||||
<div class="col-lg-2">
|
||||
<div class="data-focus">
|
||||
<span>{l s='Total rooms (Tax excl.)'}</span><br/>
|
||||
<span id="total_products" class="size_l text-success"></span>
|
||||
<span id="total_rooms" class="size_l text-success"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
{* <div class="col-lg-2">
|
||||
<div class="data-focus">
|
||||
<span>{l s='Total additinal facilties (Tax excl.)'}</span><br/>
|
||||
<span id="total_extra_demands" class="size_l text-success"></span>
|
||||
<span>{l s='Total extra services (Tax excl.)'}</span><br/>
|
||||
<span id="total_extra_services" class="size_l text-success"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div> *}
|
||||
{* <div class="col-lg-2">
|
||||
<div class="data-focus">
|
||||
<span>{l s='Total Total service products (Tax excl.)'}</span><br/>
|
||||
<span id="total_service_products" class="size_l text-success"></span>
|
||||
</div>
|
||||
</div> *}
|
||||
<div class="col-lg-2">
|
||||
<div class="data-focus">
|
||||
<span>{l s='Total vouchers (Tax excl.)'}</span><br/>
|
||||
@@ -1954,6 +2032,12 @@
|
||||
<span id="total_without_taxes" class="size_l"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<div class="data-focus">
|
||||
<span>{l s='Convenience fees (Tax excl.)'}</span><br/>
|
||||
<span id="total_convenience_fees" class="size_l"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<div class="data-focus">
|
||||
<span>{l s='Total taxes'}</span><br/>
|
||||
|
||||
@@ -65,3 +65,332 @@
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
|
||||
{block name="tableFilter"}{/block}
|
||||
{block name="override_form_extra"}
|
||||
{if !$simple_header && $show_filters}
|
||||
<script>
|
||||
$(function() {
|
||||
if ($("#list_filters_panel .datepicker").length > 0) {
|
||||
$("#list_filters_panel .datepicker").datepicker({
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
altFormat: 'yy-mm-dd'
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="list_action_wrapper">
|
||||
<div class="row">
|
||||
<div class="col-xs-4 col-sm-3 col-md-2">
|
||||
<div class="list_availibility_container">
|
||||
<button type="button" class="btn btn-default btn-left btn-block dropdown-toggle" data-toggle="dropdown">
|
||||
<span>{l s='Available Fields'}
|
||||
<i class="icon-caret-down pull-right"></i>
|
||||
</button>
|
||||
<ul id="optional-list-toggle" class="dropdown-menu">
|
||||
{foreach $fields_optional as $key => $field}
|
||||
<li>
|
||||
<label>
|
||||
<input type="checkbox" name="list_fields_visibility" value="{$key}" {if isset($field['selected']) && $field['selected']}checked="checked"{/if}>
|
||||
{$field['title']}
|
||||
</label>
|
||||
</li>
|
||||
{/foreach}
|
||||
{assign var="fields_optional" value=array()}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-3 col-xs-offset-5 col-sm-2 col-sm-offset-7 col-md-1 col-md-offset-9">
|
||||
<div class="list_filter_container">
|
||||
<button type="button" class="btn btn-default btn-block" data-toggle="collapse" data-target="#list_filters_panel">
|
||||
<i class="icon-sliders"></i>
|
||||
<span>{l s='Filters'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
{if $filters_has_value}
|
||||
<div id="selected_filter_container">
|
||||
{l s='Filters: '}
|
||||
<span class="selected_filters">
|
||||
{foreach $fields_display AS $key => $params}
|
||||
{if (!isset($params.search) || $params.search) && $params.value != ''}
|
||||
{if ($params.type == 'date' || $params.type == 'datetime' || $params.type == 'range') && $params.value|is_array}
|
||||
{assign var="filter_value" value=''}
|
||||
{foreach $params.value as $value}
|
||||
{if ($value|is_string && !empty($value))}
|
||||
{if empty($filter_value)}
|
||||
{assign var="filter_value" value=$value}
|
||||
{else}
|
||||
{assign var="filter_value" value="`$filter_value` - `$value`"}
|
||||
{/if}
|
||||
{/if}
|
||||
{/foreach}
|
||||
{if !empty($filter_value)}
|
||||
<span data-filter_key="{if isset($params.name_date)}{$params.name_date}{else}{$key}{/if}" data-filter_type="{$params.type}">
|
||||
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$filter_value|escape:'html':'UTF-8'}</span>
|
||||
<i class="icon-times"></i>
|
||||
</span>
|
||||
{/if}
|
||||
{else if $params.type == 'select'}
|
||||
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}">
|
||||
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$params['list'][$params['value']]|escape:'html':'UTF-8'}</span>
|
||||
<i class="icon-times"></i>
|
||||
</span>
|
||||
{else}
|
||||
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}">
|
||||
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$params['value']|escape:'html':'UTF-8'}</span>
|
||||
<i class="icon-times"></i>
|
||||
</span>
|
||||
{/if}
|
||||
{/if}
|
||||
{/foreach}
|
||||
</span>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="panel collapse" id="list_filters_panel">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="list_filters">
|
||||
{foreach $fields_display AS $key => $params}
|
||||
{if !isset($params.search) || $params.search}
|
||||
<div class="row">
|
||||
<label class="col-xs-3" for="filter_input_{$key}">{$params['title']|escape:'html':'UTF-8'}</label>
|
||||
<div class="col-xs-9">
|
||||
{if $params.type == 'range'}
|
||||
<div class="input_range">
|
||||
<input type="text" class="filter form-control" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}[0]" placeholder="{l s='From'}" value="{if isset($params.value.0)}{$params.value.0}{/if}">
|
||||
<input type="text" class="filter form-control" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}[1]" placeholder="{l s='To'}" value="{if isset($params.value.1)}{$params.value.1}{/if}">
|
||||
</div>
|
||||
{else if $params.type == 'bool'}
|
||||
<select id="filter_input_{$key}" class="filter fixed-width-sm center" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}">
|
||||
<option value="">-</option>
|
||||
<option value="1" {if $params.value == 1} selected="selected" {/if}>{l s='Yes'}</option>
|
||||
<option value="0" {if $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option>
|
||||
</select>
|
||||
{elseif $params.type == 'date' || $params.type == 'datetime'}
|
||||
<div class="date_range">
|
||||
<div class="input-group center">
|
||||
<input type="text" class="filter datepicker date-input form-control" id="local_{$params.id_date}_0" name="local_{$params.name_date}[0]" placeholder="{l s='From'}" autocomplete="off"/>
|
||||
<input type="hidden" id="{$params.id_date}_0" name="{$params.name_date}[0]" value="{if isset($params.value.0)}{$params.value.0}{/if}">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon-calendar"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="input-group center">
|
||||
<input type="text" class="filter datepicker date-input form-control" id="local_{$params.id_date}_1" name="local_{$params.name_date}[1]" placeholder="{l s='To'}" autocomplete="off"/>
|
||||
<input type="hidden" id="{$params.id_date}_1" name="{$params.name_date}[1]" value="{if isset($params.value.1)}{$params.value.1}{/if}">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon-calendar"></i>
|
||||
</span>
|
||||
</div>
|
||||
<script>
|
||||
$(function() {
|
||||
var dateStart = parseDate($("#{$params.id_date}_0").val());
|
||||
var dateEnd = parseDate($("#{$params.id_date}_1").val());
|
||||
$("#local_{$params.id_date}_0").datepicker("option", "altField", "#{$params.id_date}_0");
|
||||
$("#local_{$params.id_date}_1").datepicker("option", "altField", "#{$params.id_date}_1");
|
||||
if (dateStart !== null){
|
||||
$("#local_{$params.id_date}_0").datepicker("setDate", dateStart);
|
||||
}
|
||||
if (dateEnd !== null){
|
||||
$("#local_{$params.id_date}_1").datepicker("setDate", dateEnd);
|
||||
}
|
||||
|
||||
$('#local_{$params.id_date}_0').datepicker('option', {
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
dateFormat: 'yy-mm-dd',
|
||||
beforeShow: function() {
|
||||
let dateTo = $('#local_{$params.id_date}_1').val().trim();
|
||||
if (typeof dateTo != 'undefined' && dateTo != '') {
|
||||
let objDateToMax = $.datepicker.parseDate('yy-mm-dd', dateTo);
|
||||
objDateToMax.setDate(objDateToMax.getDate() - 1);
|
||||
$('#local_{$params.id_date}_0').datepicker('option', 'maxDate', objDateToMax);
|
||||
}
|
||||
},
|
||||
onClose: function() {
|
||||
let dateFrom = $('#local_{$params.id_date}_0').val().trim();
|
||||
let dateTo = $('#local_{$params.id_date}_1').val().trim();
|
||||
|
||||
if (dateFrom >= dateTo) {
|
||||
let objDateToMin = $.datepicker.parseDate('yy-mm-dd', dateFrom);
|
||||
objDateToMin.setDate(objDateToMin.getDate() + 1);
|
||||
|
||||
$('#local_{$params.id_date}_1').datepicker('option', 'minDate', objDateToMin);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
$('#local_{$params.id_date}_1').datepicker('option', {
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
dateFormat: 'yy-mm-dd',
|
||||
beforeShow: function() {
|
||||
let dateFrom = $('#local_{$params.id_date}_0').val().trim();
|
||||
|
||||
if (typeof dateFrom != 'undefined' && dateFrom != '') {
|
||||
let objDateToMin = $.datepicker.parseDate('yy-mm-dd', dateFrom);
|
||||
objDateToMin.setDate(objDateToMin.getDate() + 1);
|
||||
|
||||
$('#local_{$params.id_date}_1').datepicker('option', 'minDate', objDateToMin);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
{elseif $params.type == 'select'}
|
||||
{if isset($params.filter_key)}
|
||||
<select id="filter_input_{$key}" class="filter{if isset($params.align) && $params.align == 'center'}center{/if}" onchange="$('#submitFilterButton{$list_id}').focus();$('#submitFilterButton{$list_id}').click();" name="{$list_id}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
|
||||
<option value="" {if $params.value == ''} selected="selected" {/if}>-</option>
|
||||
{if isset($params.list) && is_array($params.list)}
|
||||
{foreach $params.list AS $option_value => $option_display}
|
||||
<option value="{$option_value}" {if (string)$option_display === (string)$params.value || (string)$option_value === (string)$params.value} selected="selected"{/if}>{$option_display}</option>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</select>
|
||||
{/if}
|
||||
{else}
|
||||
<input type="text" class="filter" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" value="{$params.value|escape:'html':'UTF-8'}" {if isset($params.width) && $params.width != 'auto'} style="width:{$params.width}px"{/if} />
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{if $has_actions || $show_filters}
|
||||
<div class="actions">
|
||||
<hr>
|
||||
{if $show_filters}
|
||||
<span class="pull-right">
|
||||
<button type="submit" id="submitFilterButton{$list_id}" name="submitFilter" class="btn btn-default" data-list-id="{$list_id}">
|
||||
<i class="icon-search"></i> {l s='Search'}
|
||||
</button>
|
||||
{if $filters_has_value}
|
||||
<button type="submit" name="submitReset{$list_id}" class="btn btn-warning">
|
||||
<i class="icon-eraser"></i> {l s='Reset'}
|
||||
</button>
|
||||
{/if}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('#selected_filter_container .selected_filters span i').on('click', function() {
|
||||
let form = $(this).closest('form');
|
||||
let type = $(this).parent().data('filter_type');
|
||||
$(this).parent().remove();
|
||||
if (type == 'date' || type == 'datetime') {
|
||||
$('#list_filters_panel').find('[name*="'+$(this).parent().data('filter_key')+'"]').val('');
|
||||
} else if (type == 'range') {
|
||||
$('#list_filters_panel').find('[name*="orderFilter_'+$(this).parent().data('filter_key')+'"]').val('');
|
||||
} else if (type == 'select') {
|
||||
$('#list_filters_panel').find('select[name="orderFilter_'+$(this).parent().data('filter_key')+'"] option:selected').prop("selected", false);
|
||||
} else {
|
||||
$('#list_filters_panel').find('input[name="orderFilter_'+$(this).parent().data('filter_key')+'"]').val('');
|
||||
}
|
||||
form.submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.list_action_wrapper {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.list_availibility_container {
|
||||
position: relative;}
|
||||
.list_availibility_container .dropdown-menu {
|
||||
right: 0;
|
||||
padding: 8px 12px;}
|
||||
.list_availibility_container .dropdown-menu label {
|
||||
font-weight: 400;}
|
||||
#selected_filter_container {
|
||||
background-color: #fff;
|
||||
padding: 8px 20px;
|
||||
border: solid 1px #d3d8db;
|
||||
border-radius: 5px 5px 0 0;
|
||||
font-size: 14px;
|
||||
min-height: 52px;
|
||||
margin-top: 15px;}
|
||||
#selected_filter_container .selected_filters > span {
|
||||
font-size: 12px;
|
||||
padding: 6px 10px;
|
||||
display: inline-block;
|
||||
background: #F5F8F9;
|
||||
border: 1px solid #A0D0EB;
|
||||
border-radius: 3px;}
|
||||
#selected_filter_container .selected_filters > span + span {
|
||||
margin-left: 12px;}
|
||||
#selected_filter_container .selected_filters > span .filter_value {
|
||||
font-weight: 700;
|
||||
}
|
||||
#selected_filter_container .selected_filters > span i {
|
||||
cursor: pointer;}
|
||||
|
||||
#content.bootstrap #list_filters_panel{
|
||||
margin-top: 15px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
#content.bootstrap #selected_filter_container + #list_filters_panel {
|
||||
margin-top: 0;
|
||||
}
|
||||
#content.bootstrap #selected_filter_container + div.panel {
|
||||
border-top: transparent;
|
||||
border-radius: 0 0 5px 5px;
|
||||
}
|
||||
|
||||
.list_filters {
|
||||
padding: 0 30px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 8px 40px;}
|
||||
.list_filters > .row {
|
||||
display: flex;
|
||||
align-items: center;}
|
||||
.list_filters .date_range, .list_filters .input_range {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 15px;}
|
||||
.list_filters .date_range .input-group:first-child {
|
||||
margin-bottom: 0;}
|
||||
.list_filters label {
|
||||
text-align: right;
|
||||
font-weight: 400;}
|
||||
.list_filters .actions {
|
||||
grid-column-start: 1;
|
||||
grid-column-end: 4;}
|
||||
@media (max-width: 992px) {
|
||||
.list_filters {
|
||||
grid-template-columns: repeat(2, 1fr);}
|
||||
.list_filters .actions {
|
||||
grid-column-start: 1;
|
||||
grid-column-end: 3;}
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.list_filters {
|
||||
grid-template-columns: repeat(1, 1fr);}
|
||||
.list_filters .actions {
|
||||
grid-column-start: 1;
|
||||
grid-column-end: 2;}
|
||||
.list_filters label {
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
{if $refund_allowed && !$hasCompletelyRefunded}
|
||||
<a id="desc-order-standard_refund" class="btn btn-default" href="#refundForm">
|
||||
<i class="icon-exchange"></i>
|
||||
{if $order->hasBeenPaid()}
|
||||
{if $order->getTotalPaid()|floatval}
|
||||
{l s='Initiate refund'}
|
||||
{else}
|
||||
{l s='Cancel bookings'}
|
||||
@@ -275,8 +275,8 @@
|
||||
<tr>
|
||||
<th>{l s='Room No.'}</th>
|
||||
<th>{l s='Hotel Name'}</th>
|
||||
<th>{l s='Date From'}</th>
|
||||
<th>{l s='Date To'}</th>
|
||||
<th>{l s='Duration'}</th>
|
||||
<th>{l s='Documents'}</th>
|
||||
<th>{l s='Order Status'}</th>
|
||||
</tr>
|
||||
{if isset($htl_booking_order_data) && $htl_booking_order_data}
|
||||
@@ -291,10 +291,13 @@
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{dateFormat date=$data['date_from']}
|
||||
{dateFormat date=$data['date_from']} - {dateFormat date=$data['date_to']}
|
||||
</td>
|
||||
<td>
|
||||
{dateFormat date=$data['date_to']}
|
||||
<a class="btn btn-default" onclick="BookingDocumentsModal.init({$data.id|intval}, this); return false;">
|
||||
<i class="icon icon-file-text"></i>
|
||||
{l s='Documents'} <span class="badge badge-info count-documents">{$data.num_checkin_documents}</span>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<form action="" method="post" class="form-horizontal row room_status_info_form">
|
||||
@@ -517,12 +520,7 @@
|
||||
<td>{$payment_types[$payment['payment_type']]['name']|escape:'html':'UTF-8'}</td>
|
||||
<td>{$payment['transaction_id']|escape:'html':'UTF-8'}</td>
|
||||
<td>{displayPrice price=$payment['real_paid_amount'] currency=$payment['id_currency']}</td>
|
||||
<td>
|
||||
{if $payment['invoice_number']}
|
||||
{$payment['invoice_number']}
|
||||
{else}
|
||||
{/if}
|
||||
</td>
|
||||
<td>{if isset($payment['invoice_number'])}{$payment['invoice_number']}{else}--{/if}</td>
|
||||
<td class="actions">
|
||||
<button class="btn btn-default open_payment_information">
|
||||
<i class="icon-search"></i>
|
||||
@@ -1067,7 +1065,9 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">{l s='Refund ID'}</th>
|
||||
<th class="text-center">{l s='Total Rooms'}</th>
|
||||
<th class="text-left">{l s='Status'}</th>
|
||||
<th class="text-center">{l s='Requested Date'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -1076,6 +1076,9 @@
|
||||
<td class="text-left">
|
||||
<a href="{$link->getAdminLink('AdminOrderRefundRequests')}&vieworder_return&id_order_return={$return_info.id_order_return}" target="_blank">#{$return_info.id_order_return}</a>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{$return_info.total_rooms|escape:'html':'UTF-8'}
|
||||
</td>
|
||||
<td class="text-left">
|
||||
{capture name=refund_status}
|
||||
{if isset($return_info.payment_mode) && $return_info.payment_mode != ''}{l s='Payment Mode: '}{$return_info.payment_mode}<br/>{/if}
|
||||
@@ -1110,12 +1113,39 @@
|
||||
{$return_info.state_name}
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{$return_info.date_add}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-list"></i> {l s='Cancellation Policies'}
|
||||
</div>
|
||||
{if is_array($applicable_refund_policies) && count($applicable_refund_policies)}
|
||||
<ul>
|
||||
{foreach from=$applicable_refund_policies item=$applicable_refund_policy}
|
||||
<li>
|
||||
<p>
|
||||
<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-external-link"></i>
|
||||
</a>
|
||||
</p>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{else}
|
||||
<p>
|
||||
<i class="icon-warning-sign list-empty-icon"></i>
|
||||
{l s='No cancellation policies applicable.'}
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
{hook h="displayAdminOrderRight" id_order=$order->id}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1131,53 +1161,14 @@
|
||||
<div class="panel" id="refundForm">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-shopping-cart"></i>
|
||||
{l s='Rooms In This Order'} <span class="badge">{$order_detail_data|@count}</span>
|
||||
{l s='Order Detail'} <span class="badge">{$order_detail_data|@count}</span>
|
||||
{* by webkul products changes as rooms *}
|
||||
</div>
|
||||
{* by webkul this code is added for showing rooms information on the order detail page *}
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<table class="table" id="customer_cart_details">
|
||||
<thead>
|
||||
<tr>
|
||||
{if $refund_allowed}
|
||||
<th class="standard_refund_fields" style="display:none"></th>
|
||||
{/if}
|
||||
<th class="text-center"><span class="title_box">{l s='Room No.'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Room Image'}</th>
|
||||
<th class="text-center"><span class="title_box">{l s='Room Type'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Hotel Name'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Duration'}</span></th>
|
||||
<th class="text-center fixed-width-lg"><span class="title_box">{l s='Occupancy'}</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='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 fixed-width-xxl"><span class="title_box">{l s='Reallocate Room'}</span></th>
|
||||
{if ($can_edit && !$order->hasBeenDelivered())}
|
||||
<th class="text-center"><span class="title_box">{l s='Edit Order'}</th>
|
||||
{/if}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if $order_detail_data}
|
||||
{foreach from=$order_detail_data item=data}
|
||||
{* Include product line partial *}
|
||||
{include file='controllers/orders/_product_line.tpl'}
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td>{l s='No Data Found.'}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{* Include product line partial *}
|
||||
{include file='controllers/orders/_new_product.tpl'}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{include file='controllers/orders/_rooms_informaion_table.tpl'}
|
||||
<br>
|
||||
{include file='controllers/orders/_service_products_table.tpl'}
|
||||
|
||||
|
||||
{capture "TaxMethod"}
|
||||
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
|
||||
@@ -1192,12 +1183,16 @@
|
||||
<input type="hidden" name="TaxMethod" value="1">
|
||||
{/if}
|
||||
{if $can_edit}
|
||||
<div class="row-margin-bottom row-margin-top order_action standard_refund_fields" style="display: none;">
|
||||
<div class="row-margin-bottom row-margin-top standard_refund_fields" style="display: none;">
|
||||
<textarea class="cancellation_reason" name="cancellation_reason" placeholder="{l s='Enter reason to cancel bookings'}"></textarea>
|
||||
</div>
|
||||
<div class="row-margin-bottom row-margin-top order_action">
|
||||
{if !$order->hasBeenDelivered()}
|
||||
<button type="button" id="add_product" class="btn btn-default">
|
||||
{* <button type="button" id="add_product" class="btn btn-default">
|
||||
<i class="icon-plus-sign"></i>
|
||||
{l s='Add Product In Order'}
|
||||
</button> *}
|
||||
<button type="button" id="add_room" class="btn btn-default">
|
||||
<i class="icon-plus-sign"></i>
|
||||
{l s='Add Rooms In Order'}
|
||||
</button>
|
||||
@@ -1294,38 +1289,59 @@
|
||||
{assign var=order_wrapping_price value=$order->total_wrapping_tax_incl}
|
||||
{assign var=order_shipping_price value=$order->total_shipping_tax_incl}
|
||||
{/if}
|
||||
<tr id="total_products">
|
||||
<td class="text-right"><strong>{l s='Total Rooms Cost (tax excl.)'}</strong></td>
|
||||
<td class="amount text-right nowrap">
|
||||
<strong>{displayPrice price=$totalRoomsCostTE currency=$currency->id}</strong>
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{if isset($totalDemandsPriceTE) && $totalDemandsPriceTE > 0}
|
||||
|
||||
{assign var=room_price_tax_excl value=$order->getTotalProductsWithoutTaxes(false, true)}
|
||||
{assign var=room_price_tax_incl value=$order->getTotalProductsWithTaxes(false, true)}
|
||||
{assign var=service_products_price_tax_excl value=$order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE)}
|
||||
{assign var=service_products_price_tax_incl value=$order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE)}
|
||||
{assign var=additional_service_price_tax_excl value=($order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $totalDemandsPriceTE)}
|
||||
{assign var=additional_service_price_tax_incl value=($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $totalDemandsPriceTI)}
|
||||
{if $room_price_tax_excl}
|
||||
<tr id="total_products">
|
||||
<td class="text-right"><strong>{l s='Additional Facilities Cost (tax excl.)'}</strong></td>
|
||||
<td class="text-right"><strong>{l s='Total Rooms Cost (tax excl.)'}</strong></td>
|
||||
<td class="amount text-right nowrap">
|
||||
<strong>{displayPrice price=$totalDemandsPriceTE currency=$currency->id}</strong>
|
||||
<strong>{displayPrice price=$room_price_tax_excl currency=$currency->id}</strong>
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr id="total_tax_order">
|
||||
<td class="text-right"><strong>{l s='Total Rooms Tax'}</strong></td>
|
||||
<td class="text-right nowrap">
|
||||
<strong>{displayPrice price=$total_room_tax currency=$currency->id}</strong>
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{if isset($totalDemandsPriceTE) && $totalDemandsPriceTE > 0}
|
||||
{if isset($additional_service_price_tax_excl) && $additional_service_price_tax_excl > 0}
|
||||
<tr id="total_products">
|
||||
<td class="text-right"><strong>{l s='Total Extra services (tax excl.)'}</strong></td>
|
||||
<td class="amount text-right nowrap">
|
||||
<strong>{displayPrice price=($additional_service_price_tax_excl - $totalConvenienceFeeTE) currency=$currency->id}</strong>
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{* {if $room_price_tax_excl}
|
||||
<tr id="total_tax_order">
|
||||
<td class="text-right"><strong>{l s='Additional Facilities Tax'}</strong></td>
|
||||
<td class="text-right"><strong>{l s='Total Rooms Tax'}</strong></td>
|
||||
<td class="text-right nowrap">
|
||||
<strong>{displayPrice price=($totalDemandsPriceTI - $totalDemandsPriceTE) currency=$currency->id}</strong>
|
||||
<strong>{displayPrice price=($room_price_tax_incl - $room_price_tax_excl) currency=$currency->id}</strong>
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if isset($additional_service_price_tax_excl) && $additional_service_price_tax_excl > 0}
|
||||
<tr id="total_tax_order">
|
||||
<td class="text-right"><strong>{l s='Extra services Tax'}</strong></td>
|
||||
<td class="text-right nowrap">
|
||||
<strong>{displayPrice price=($additional_service_price_tax_incl - $additional_service_price_tax_excl) currency=$currency->id}</strong>
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if} *}
|
||||
{if $service_products_price_tax_excl}
|
||||
<tr id="total_products">
|
||||
<td class="text-right"><strong>{l s='Total service products cost (tax excl.)'}</strong></td>
|
||||
<td class="amount text-right nowrap">
|
||||
<strong>{displayPrice price=$service_products_price_tax_excl currency=$currency->id}</strong>
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
<tr id="total_discounts" {if $order->total_discounts_tax_incl == 0}style="display: none;"{/if}>
|
||||
<td class="text-right">{l s='Discounts'}</td>
|
||||
<td class="amount text-right nowrap">
|
||||
@@ -1340,13 +1356,22 @@
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
|
||||
{if isset($totalConvenienceFeeTI) && $totalConvenienceFeeTI > 0}
|
||||
<tr id="total_products">
|
||||
<td class="text-right"><strong>{l s='Convenience Fee'}</strong></td>
|
||||
<td class="amount text-right nowrap">
|
||||
<strong>{displayPrice price=$totalConvenienceFeeTE currency=$currency->id}</strong>
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{* {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)} *}
|
||||
<tr id="total_taxes">
|
||||
<td class="text-right"><strong>{l s='Total Taxes'}</strong></td>
|
||||
<td class="amount text-right nowrap" ><strong>{displayPrice price=($order->total_paid_tax_incl - $order->total_paid_tax_excl) currency=$currency->id}</strong></td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{* {/if} *}
|
||||
<tr id="total_order">
|
||||
<td class="text-right"><strong>{l s='Final Booking Total'}</strong></td>
|
||||
<td class="amount text-right nowrap">
|
||||
@@ -1642,7 +1667,7 @@
|
||||
});
|
||||
|
||||
{* open fancybox for extra demands *}
|
||||
$('.open_room_extra_demands').on('click', function(e) {
|
||||
$('.open_room_extra_services').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
var idProduct = $(this).attr('id_product');
|
||||
var idOrder = $(this).attr('id_order');
|
||||
@@ -1651,7 +1676,7 @@
|
||||
var dateTo = $(this).attr('date_to');
|
||||
var idHtlBooking = $(this).attr('id_htl_booking');
|
||||
var orderEdit = 0;
|
||||
if( $(this).closest('.product-line-row').find(".submitProductChange").is(":visible") == true ) {
|
||||
if($(this).closest('.product-line-row').find(".submitRoomChange").is(":visible") == true ) {
|
||||
orderEdit = 1;
|
||||
}
|
||||
|
||||
@@ -1684,25 +1709,129 @@
|
||||
});
|
||||
});
|
||||
|
||||
$('#rooms_type_extra_demands').on('hidden.bs.modal', function (e) {
|
||||
if ($('.product-line-row').find(".submitRoomChange").is(":visible") == true ) {
|
||||
location.reload();
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
{* when choose to add new facilities while additional facilities edit *}
|
||||
$(document).on('click', '#room_extra_demand_content #btn_new_room_facility', function() {
|
||||
$(document).on('click', '#room_extra_demand_content #btn_new_room_demand', function() {
|
||||
$('#rooms_extra_demands .room_demands_container').show();
|
||||
$('#room_extra_demand_content #save_room_facilities').show();
|
||||
$('#room_extra_demand_content #back_to_facilities_btn').show();
|
||||
$('#room_extra_demand_content #save_room_demands').show();
|
||||
$('#room_extra_demand_content #back_to_demands_btn').show();
|
||||
$('#rooms_extra_demands .room_ordered_demands').hide();
|
||||
$('#room_extra_demand_content #btn_new_room_facility').hide();
|
||||
$('#room_extra_demand_content #btn_new_room_demand').hide();
|
||||
});
|
||||
{* click on back button on created facilities while additional facilities edit *}
|
||||
$(document).on('click', '#room_extra_demand_content #back_to_facilities_btn', function() {
|
||||
$(document).on('click', '#room_extra_demand_content #back_to_demands_btn', function() {
|
||||
$('#rooms_extra_demands .room_ordered_demands').show();
|
||||
$('#room_extra_demand_content #btn_new_room_facility').show();
|
||||
$('#room_extra_demand_content #btn_new_room_demand').show();
|
||||
$('#rooms_extra_demands .room_demands_container').hide();
|
||||
$('#room_extra_demand_content #save_room_facilities').hide();
|
||||
$('#room_extra_demand_content #back_to_facilities_btn').hide();
|
||||
$('#room_extra_demand_content #save_room_demands').hide();
|
||||
$('#room_extra_demand_content #back_to_demands_btn').hide();
|
||||
});
|
||||
|
||||
$(document).on('click', '#room_extra_demand_content #btn_new_room_service', function() {
|
||||
$('#rooms_extra_demands .room_services_container').show();
|
||||
$('#room_extra_demand_content #save_service_service').show();
|
||||
$('#room_extra_demand_content #back_to_service_btn').show();
|
||||
$('#rooms_extra_demands .room_ordered_services').hide();
|
||||
$('#room_extra_demand_content #btn_new_room_service').hide();
|
||||
});
|
||||
{* click on back button on created facilities while additional facilities edit *}
|
||||
$(document).on('click', '#room_extra_demand_content #back_to_service_btn', function() {
|
||||
$('#rooms_extra_demands .room_ordered_services').show();
|
||||
$('#room_extra_demand_content #btn_new_room_service').show();
|
||||
$('#rooms_extra_demands .room_services_container').hide();
|
||||
$('#room_extra_demand_content #save_service_service').hide();
|
||||
$('#room_extra_demand_content #back_to_service_btn').hide();
|
||||
});
|
||||
|
||||
$(document).on('focusout', '#rooms_type_extra_demands .room_ordered_services .qty', function(e) {
|
||||
var qty_wntd = $(this).val();
|
||||
if (qty_wntd == '' || !$.isNumeric(qty_wntd) || qty_wntd < 1) {
|
||||
$(this).val(1);
|
||||
}
|
||||
updateAdditionalServices($(this));
|
||||
});
|
||||
|
||||
$(document).on('focusout', '#rooms_type_extra_demands #add_room_services_form .qty', function(e) {
|
||||
var qty_wntd = $(this).val();
|
||||
if (qty_wntd == '' || !$.isNumeric(qty_wntd) || qty_wntd < 1) {
|
||||
$(this).val(1);
|
||||
}
|
||||
});
|
||||
|
||||
function updateAdditionalServices(element)
|
||||
{
|
||||
var id_room_type_service_product_order_detail = $(element).data('id_room_type_service_product_order_detail');
|
||||
var qty = $(element).val();
|
||||
if ($.isNumeric(qty)) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
headers: {
|
||||
"cache-control": "no-cache"
|
||||
},
|
||||
url: "{$link->getAdminLink('AdminOrders')|addslashes}",
|
||||
dataType: 'JSON',
|
||||
cache: false,
|
||||
data: {
|
||||
id_room_type_service_product_order_detail: id_room_type_service_product_order_detail,
|
||||
qty: qty,
|
||||
action: 'updateRoomAdditionalServices',
|
||||
ajax: true
|
||||
},
|
||||
success: function(jsonData) {
|
||||
if (!jsonData.hasError) {
|
||||
if (jsonData.service_panel) {
|
||||
$('#room_type_service_product_desc').replaceWith(jsonData.service_panel);
|
||||
}
|
||||
showSuccessMessage(txtExtraDemandSucc);
|
||||
} else {
|
||||
showErrorMessage(jsonData.errors);
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$(document).on('submit', '#add_room_services_form', function(e) {
|
||||
e.preventDefault();
|
||||
var form_data = new FormData(this);
|
||||
form_data.append('ajax', true);
|
||||
form_data.append('action', 'addRoomAdditionalServices');
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
headers: {
|
||||
"cache-control": "no-cache"
|
||||
},
|
||||
url: "{$link->getAdminLink('AdminOrders')|addslashes}",
|
||||
dataType: 'JSON',
|
||||
cache: false,
|
||||
data: form_data,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(jsonData) {
|
||||
if (!jsonData.hasError) {
|
||||
if (jsonData.service_panel) {
|
||||
$('#room_type_service_product_desc').replaceWith(jsonData.service_panel);
|
||||
}
|
||||
showSuccessMessage(txtExtraDemandSucc);
|
||||
} else {
|
||||
showErrorMessage(jsonData.errors);
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
{* // save room extra demand to the order *}
|
||||
$(document).on('click', '#save_room_facilities', function(e) {
|
||||
$(document).on('click', '#save_room_demands', function(e) {
|
||||
e.preventDefault();
|
||||
var idHtlBooking = $(this).closest('#room_extra_demand_content').find('#id_htl_booking').val();
|
||||
if (idHtlBooking) {
|
||||
@@ -1730,10 +1859,12 @@
|
||||
action: 'EditRoomExtraDemands',
|
||||
ajax: true
|
||||
},
|
||||
success: function(result) {
|
||||
if (result == 1) {
|
||||
success: function(jsonData) {
|
||||
if (jsonData.success) {
|
||||
showSuccessMessage(txtExtraDemandSucc);
|
||||
$('#rooms_type_extra_demands').modal('hide');
|
||||
if (jsonData.facilities_panel) {
|
||||
$('#room_type_demands_desc').replaceWith(jsonData.facilities_panel);
|
||||
}
|
||||
} else {
|
||||
showErrorMessage(txtSomeErr);
|
||||
}
|
||||
@@ -1765,10 +1896,12 @@
|
||||
action: 'DeleteRoomExtraDemand',
|
||||
ajax: true
|
||||
},
|
||||
success: function(result) {
|
||||
if (result == 1) {
|
||||
$currentItem.closest('tr').remove();
|
||||
success: function(jsonData) {
|
||||
if (jsonData.success) {
|
||||
showSuccessMessage(txtDeleteSucc);
|
||||
if (jsonData.facilities_panel) {
|
||||
$('#room_type_demands_desc').replaceWith(jsonData.facilities_panel);
|
||||
}
|
||||
} else {
|
||||
showErrorMessage(txtSomeErr);
|
||||
}
|
||||
@@ -1780,6 +1913,44 @@
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.del_room_additional_service', function(e){
|
||||
e.preventDefault();
|
||||
if (confirm(txt_confirm)) {
|
||||
var idServiceProductOrderDetail = $(this).data('id_room_type_service_product_order_detail');
|
||||
$currentItem = $(this);
|
||||
if (idServiceProductOrderDetail) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
headers: {
|
||||
"cache-control": "no-cache"
|
||||
},
|
||||
url: "{$link->getAdminLink('AdminOrders')|addslashes}",
|
||||
dataType: 'JSON',
|
||||
cache: false,
|
||||
data: {
|
||||
id_room_type_service_product_order_detail: idServiceProductOrderDetail,
|
||||
action: 'DeleteRoomAdditionalService',
|
||||
ajax: true
|
||||
},
|
||||
success: function(jsonData) {
|
||||
if (!jsonData.hasError) {
|
||||
if (jsonData.service_panel) {
|
||||
$('#room_type_service_product_desc').replaceWith(jsonData.service_panel);
|
||||
}
|
||||
showSuccessMessage(txtExtraDemandSucc);
|
||||
} else {
|
||||
showErrorMessage(jsonData.errors);
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
showErrorMessage(txtInvalidDemandVal);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// change advance option of extra demand
|
||||
$(document).on('change', '.demand_adv_option_block .id_option', function(e) {
|
||||
var option_selected = $(this).find('option:selected');
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<i class="icon-user"></i> {l s='Room Type Additional Facilities'}
|
||||
</div>
|
||||
<div class="alert alert-info">
|
||||
{l s='To create new Additiona facilities '} <a target="_blank" href="{$link->getAdminLink('AdminRoomTypeGlobalDemand')}">{l s='click here.'}</a>
|
||||
{l s='To create new Additional facilities'} <a target="_blank" href="{$link->getAdminLink('AdminRoomTypeGlobalDemand')}">{l s='click here.'}</a>
|
||||
</div>
|
||||
{if isset($allDemands) && $allDemands}
|
||||
<div class="panel-group">
|
||||
@@ -112,4 +112,4 @@
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
@@ -1,126 +0,0 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
{if isset($obj->id)}
|
||||
<div id="product-attachements" class="panel product-tab">
|
||||
<input type="hidden" name="submitted_tabs[]" value="Attachments" />
|
||||
<h3>{l s='Attachment'}</h3>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3 required" for="attachment_name_{$id_lang}">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='Maximum 32 characters.'}">
|
||||
{l s='Filename'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
{include file="controllers/products/input_text_lang.tpl"
|
||||
languages=$languages
|
||||
input_value=$attachment_name
|
||||
input_name="attachment_name"
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3" for="attachment_description_{$id_lang}">
|
||||
{l s='Description'}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
{include
|
||||
file="controllers/products/textarea_lang.tpl"
|
||||
languages=$languages
|
||||
input_name="attachment_description"
|
||||
input_value=$attachment_description
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3" for="attachement_filename">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='Upload a file from your computer'} ({Configuration::get('PS_ATTACHMENT_MAXIMUM_SIZE')|string_format:'%.2f'} {l s='MB max.'})">
|
||||
{l s='File'}
|
||||
</span>
|
||||
</label>
|
||||
{$attachment_uploader}
|
||||
<div class="col-lg-3">
|
||||
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<p class="help-block">{l s='Upload a file from your computer'} ({Configuration::get('PS_ATTACHMENT_MAXIMUM_SIZE')|string_format:'%.2f'} {l s='MB max.'})</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-lg-9 col-lg-offset-3">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<p>{l s='Available attachments:'}</p>
|
||||
<select multiple id="selectAttachment2">
|
||||
{foreach $attach2 as $attach}
|
||||
<option value="{$attach.id_attachment}">{$attach.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<a href="#" id="addAttachment" class="btn btn-default btn-block">
|
||||
{l s='Add'}
|
||||
<i class="icon-arrow-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<p>{l s='Attachments for this product:'}</p>
|
||||
<select multiple id="selectAttachment1" name="attachments[]">
|
||||
{foreach $attach1 as $attach}
|
||||
<option value="{$attach.id_attachment}">{$attach.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<a href="#" id="removeAttachment" class="btn btn-default btn-block">
|
||||
<i class="icon-arrow-left"></i>
|
||||
{l s='Remove'}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
<input type="hidden" name="arrayAttachments" id="arrayAttachments" value="{foreach $attach1 as $attach}{$attach.id_attachment},{/foreach}" />
|
||||
|
||||
<script type="text/javascript">
|
||||
var iso = '{$iso_tiny_mce}';
|
||||
var pathCSS = '{$smarty.const._THEME_CSS_DIR_}';
|
||||
var ad = '{$ad}';
|
||||
|
||||
if (tabs_manager.allow_hide_other_languages)
|
||||
hideOtherLanguage({$default_form_language});
|
||||
</script>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -0,0 +1,37 @@
|
||||
{**
|
||||
* 2010-2023 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* 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 CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2023 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*}
|
||||
|
||||
{l s='This room already has bookings for highlighted date range(s):'}
|
||||
|
||||
<table width="70%">
|
||||
<tr>
|
||||
<th class="text-center">{l s='Order ID'}</th>
|
||||
<th class="text-center">{l s='Date From'}</th>
|
||||
<th class="text-center">{l s='Date To'}</th>
|
||||
</tr>
|
||||
{foreach from=$booked_rows_list item=booked_row}
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<a href="{$link->getAdminLink('AdminOrders')}&id_order={$booked_row->id_order}&vieworder" target="_blank"><strong>#{$booked_row->id_order|intval}</strong></a>
|
||||
</td>
|
||||
<td class="text-center">{dateFormat date=$booked_row->date_from}</td>
|
||||
<td class="text-center">{dateFormat date=$booked_row->date_to}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
@@ -1,367 +0,0 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
{if isset($product->id) && !$product->is_virtual}
|
||||
<div id="product-combinations" class="panel product-tab">
|
||||
<script type="text/javascript">
|
||||
var msg_combination_1 = '{l s='Please choose an attribute.'}';
|
||||
var msg_combination_2 = '{l s='Please choose a value.'}';
|
||||
var msg_combination_3 = '{l s='You can only add one combination per attribute type.'}';
|
||||
var msg_new_combination = '{l s='New combination'}';
|
||||
var msg_cancel_combination = '{l s='Cancel combination'}';
|
||||
var attrs = new Array();
|
||||
var modifyattributegroup = "{l s='Modify this attribute combination.' js=1}";
|
||||
attrs[0] = new Array(0, "---");
|
||||
{foreach from=$attributeJs key=idgrp item=group}
|
||||
attrs[{$idgrp}] = new Array(0
|
||||
, '---'
|
||||
{foreach from=$group key=idattr item=attrname}
|
||||
, {$idattr|strval|json_encode}, {$attrname|trim|json_encode}
|
||||
{/foreach}
|
||||
);
|
||||
{/foreach}
|
||||
$(document).ready(function(){
|
||||
populate_attrs();
|
||||
$(".datepicker").datepicker({
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
dateFormat: 'yy-mm-dd'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<input type="hidden" name="submitted_tabs[]" value="Combinations" />
|
||||
<h3>{l s='Add or modify combinations for this product'}</h3>
|
||||
<div class="alert alert-info">
|
||||
{l s='You can also use the [1]Product Combinations Generator[2/][/1] in order to automatically create a set of combinations.' tags=["<a class='btn btn-link bt-icon confirm_leave' href='index.php?tab=AdminAttributeGenerator&id_product={$product->id}&attributegenerator&token={$token_generator}'>", '<i class="icon-external-link-sign">']}
|
||||
</div>
|
||||
{if $combination_exists}
|
||||
<div class="alert alert-info" style="display:block">
|
||||
{l s='Some combinations already exist. If you want to generate a set of new combinations, the quantities for the existing combinations will be lost.'}<br/>
|
||||
{l s='You can add a single combination by clicking the "New combination" button.'}
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($display_multishop_checkboxes) && $display_multishop_checkboxes}
|
||||
<br />
|
||||
{include file="controllers/products/multishop/check_fields.tpl" product_tab="Combinations"}
|
||||
{/if}
|
||||
<div id="add_new_combination" class="panel" style="display: none;">
|
||||
<div class="panel-heading">{l s='Add or modify combinations for this product'}</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3" for="attribute_group">{l s='Attribute'}</label>
|
||||
<div class="col-lg-5">
|
||||
<select name="attribute_group" id="attribute_group" onchange="populate_attrs();">
|
||||
{if isset($attributes_groups)}
|
||||
{foreach from=$attributes_groups key=k item=attribute_group}
|
||||
<option value="{$attribute_group.id_attribute_group}">{$attribute_group.name|escape:'html':'UTF-8'} </option>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="control-label col-lg-3" for="attribute">{l s='Value'}</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="form-group">
|
||||
<div class="col-lg-8">
|
||||
<select name="attribute" id="attribute">
|
||||
<option value="0">-</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<button type="button" class="btn btn-default btn-block" onclick="add_attr();"><i class="icon-plus-sign-alt"></i> {l s='Add'}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-8">
|
||||
<select id="product_att_list" name="attribute_combination_list[]" multiple="multiple" ></select>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<button type="button" class="btn btn-default btn-block" onclick="del_attr()"><i class="icon-minus-sign-alt"></i> {l s='Delete'}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3" for="attribute_reference">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='Special characters allowed:'} .-_#">
|
||||
{l s='Reference code'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-5">
|
||||
<input type="text" id="attribute_reference" name="attribute_reference" value="" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3" for="attribute_ean13">
|
||||
{l s='EAN-13 or JAN barcode'}
|
||||
</label>
|
||||
<div class="col-lg-3">
|
||||
<input maxlength="13" type="text" id="attribute_ean13" name="attribute_ean13" value="" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3" for="attribute_upc">
|
||||
{l s='UPC barcode'}
|
||||
</label>
|
||||
<div class="col-lg-3">
|
||||
<input maxlength="12" type="text" id="attribute_upc" name="attribute_upc" value="" />
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="attribute_wholesale_price" type="default"}</span></div>
|
||||
<label class="control-label col-lg-2" for="attribute_wholesale_price">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Set to zero if the price does not change.'}">
|
||||
{l s='Wholesale price'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="input-group col-lg-2">
|
||||
<span class="input-group-addon">
|
||||
{if $currency->format % 2 != 0}{$currency->sign}{/if}
|
||||
{if $currency->format % 2 == 0}{$currency->sign}{/if}
|
||||
</span>
|
||||
<input type="text" name="attribute_wholesale_price" id="attribute_wholesale_price" value="0" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />
|
||||
</div>
|
||||
<span style="display:none;" id="attribute_wholesale_price_full" class="help-block">{l s='Overrides the wholesale price from the "Prices" tab.'}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="attribute_price_impact" type="attribute_price_impact"}</span></div>
|
||||
<label class="control-label col-lg-2" for="attribute_price_impact">
|
||||
{l s='Impact on price'}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
<select name="attribute_price_impact" id="attribute_price_impact" onchange="check_impact(); calcImpactPriceTI();">
|
||||
<option value="0">{l s='None'}</option>
|
||||
<option value="1">{l s='Increase'}</option>
|
||||
<option value="-1">{l s='Decrease'}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="span_impact" class="col-lg-8">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-1" for="attribute_price">
|
||||
{l s='of'}
|
||||
</label>
|
||||
<div class="input-group col-lg-5">
|
||||
<div class="input-group-addon">
|
||||
{if $currency->format % 2 != 0}{$currency->sign}{/if}
|
||||
{if $currency->format % 2 == 0} {$currency->sign}{/if}
|
||||
{if $country_display_tax_label}
|
||||
{l s='(tax excl.)'}
|
||||
{/if}
|
||||
</div>
|
||||
<input type="hidden" id="attribute_priceTEReal" name="attribute_price" value="0.00" />
|
||||
|
||||
<input type="text" id="attribute_price" value="0.00" onkeyup="$('#attribute_priceTEReal').val(this.value.replace(/,/g, '.')); if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.'); calcImpactPriceTI();"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-1" for="attribute_priceTI">
|
||||
{l s='or'}
|
||||
</label>
|
||||
<div class="input-group col-lg-5">
|
||||
<div class="input-group-addon" {if $tax_exclude_option}style="display:none"{/if}>
|
||||
{if $currency->format % 2 != 0}{$currency->sign}{/if}
|
||||
{if $currency->format % 2 == 0} {$currency->sign}{/if}
|
||||
{l s='(tax incl.)'}
|
||||
</div>
|
||||
<input type="text" name="attribute_priceTI" id="attribute_priceTI" value="0.00" onkeyup="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.'); calcImpactPriceTE();"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="alert">
|
||||
{l s='The final product price will be set to'}
|
||||
{if $currency->format % 2 != 0}{$currency->sign}{/if}
|
||||
<span id="attribute_new_total_price">0.00</span>
|
||||
{if $currency->format % 2 == 0}{$currency->sign}{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="attribute_weight_impact" type="attribute_weight_impact"}</span></div>
|
||||
<label class="control-label col-lg-2" for="attribute_weight_impact">
|
||||
{l s='Impact on weight'}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
<select name="attribute_weight_impact" id="attribute_weight_impact" onchange="check_weight_impact();">
|
||||
<option value="0">{l s='None'}</option>
|
||||
<option value="1">{l s='Increase'}</option>
|
||||
<option value="-1">{l s='Reduction'}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="span_weight_impact" class="col-lg-8">
|
||||
<div class="row">
|
||||
<label class="control-label col-lg-1" for="attribute_weight">
|
||||
{l s='of'}
|
||||
</label>
|
||||
<div class="input-group col-lg-5">
|
||||
<div class="input-group-addon">
|
||||
{$ps_weight_unit}
|
||||
</div>
|
||||
<input type="text" name="attribute_weight" id="attribute_weight" value="0.00" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tr_unit_impact" class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="attribute_unit_impact" type="attribute_unit_impact"}</span></div>
|
||||
<label class="control-label col-lg-2" for="attribute_unit_impact">
|
||||
{l s='Impact on unit price'}
|
||||
</label>
|
||||
<div class="col-lg-3">
|
||||
<select name="attribute_unit_impact" id="attribute_unit_impact" onchange="check_unit_impact();">
|
||||
<option value="0">{l s='None'}</option>
|
||||
<option value="1">{l s='Increase'}</option>
|
||||
<option value="-1">{l s='Reduction'}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="row">
|
||||
<label class="control-label col-lg-1" for="attribute_unity">
|
||||
{l s='of'}
|
||||
</label>
|
||||
<div class="input-group col-lg-5">
|
||||
<div class="input-group-addon">
|
||||
{if $currency->format % 2 != 0}{$currency->sign}{/if}
|
||||
{if $currency->format % 2 == 0}{$currency->sign}{/if}
|
||||
/ <span id="unity_third">{$field_value_unity}</span>
|
||||
</div>
|
||||
<input type="text" name="attribute_unity" id="attribute_unity" value="0.00" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{if $ps_use_ecotax}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="attribute_ecotax" type="default"}</span></div>
|
||||
<label class="control-label col-lg-2" for="attribute_ecotax">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Overrides the ecotax from the "Prices" tab.'}">
|
||||
{l s='Ecotax (tax excl.)'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="input-group col-lg-2">
|
||||
<div class="input-group-addon">
|
||||
{if $currency->format % 2 != 0}{$currency->sign}{/if}
|
||||
{if $currency->format % 2 == 0} {$currency->sign}{/if}
|
||||
</div>
|
||||
<input type="text" name="attribute_ecotax" id="attribute_ecotax" value="0.00" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="attribute_minimal_quantity" type="default"}</span></div>
|
||||
<label class="control-label col-lg-2" for="attribute_minimal_quantity">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='The minimum quantity to buy this product (set to 1 to disable this feature).'}">
|
||||
{l s='Minimum quantity'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="input-group col-lg-2">
|
||||
<div class="input-group-addon">×</div>
|
||||
<input maxlength="6" name="attribute_minimal_quantity" id="attribute_minimal_quantity" type="text" value="{$minimal_quantity}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="available_date_attribute" type="default"}</span></div>
|
||||
<label class="control-label col-lg-2" for="available_date_attribute">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='If this product is out of stock, you can indicate when the product will be available again.'}">
|
||||
{l s='Availability date'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="input-group col-lg-3">
|
||||
<input class="datepicker" id="available_date_attribute" name="available_date_attribute" value="{$available_date}" type="text" />
|
||||
<div class="input-group-addon">
|
||||
<i class="icon-calendar-empty"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Image'}</label>
|
||||
<div class="col-lg-9">
|
||||
{if $images|count}
|
||||
<ul id="id_image_attr" class="list-inline">
|
||||
{foreach from=$images key=k item=image}
|
||||
<li>
|
||||
<input type="checkbox" name="id_image_attr[]" value="{$image.id_image}" id="id_image_attr_{$image.id_image}" />
|
||||
<label for="id_image_attr_{$image.id_image}">
|
||||
<img class="img-thumbnail" src="{$smarty.const._THEME_PROD_DIR_}{$image.obj->getExistingImgPath()}-{$imageType}.jpg" alt="{$image.legend|escape:'html':'UTF-8'}" title="{$image.legend|escape:'html':'UTF-8'}" />
|
||||
</label>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{else}
|
||||
<div class="alert alert-warning">{l s='You must upload an image before you can select one for your combination.'}</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="attribute_default" type="attribute_default"}</span></div>
|
||||
<label class="control-label col-lg-2" for="attribute_default">
|
||||
{l s='Default'}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<p class="checkbox">
|
||||
<label for="attribute_default">
|
||||
<input type="checkbox" name="attribute_default" id="attribute_default" value="1" />
|
||||
{l s='Make this combination the default combination for this product.'}
|
||||
</label>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<span id="ResetSpan">
|
||||
<button type="reset" name="ResetBtn" id="ResetBtn" onclick="$('#desc-product-newCombination').click();" class="btn btn-default">
|
||||
<i class="icon-undo"></i> {l s='Cancel modification'}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{$list}
|
||||
<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>
|
||||
<a href="#" id="desc-product-newCombination" class="btn btn-default pull-right"><i class="process-icon-new"></i> <span>{l s="New combination"}</span></a>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -95,7 +95,7 @@
|
||||
<input type="text" class="form-control room_comment" value="{$room_info['comment']}" name="{$var_name_room_info|cat:'[comment]'}">
|
||||
</td>
|
||||
<td class="col-sm-2 center">
|
||||
<a class="btn btn-default deactiveDatesModal {if $room_info['id_status'] != $rm_status['STATUS_TEMPORARY_INACTIVE']['id'] }disabled{/if}" data-toggle="modal" data-target="#deactiveDatesModal">{if $room_info['id_status'] != $rm_status['STATUS_TEMPORARY_INACTIVE']['id'] }{l s='Add Dates'}{else}{l s='View Dates'}{/if}
|
||||
<a class="btn btn-default deactiveDatesModal {if $room_info['id_status'] != $rm_status['STATUS_TEMPORARY_INACTIVE']['id'] }disabled{/if}" data-toggle="modal" data-target="#deactiveDatesModal" data-id-room="{$room_info['id']}">{if $room_info['id_status'] != $rm_status['STATUS_TEMPORARY_INACTIVE']['id'] }{l s='Add Dates'}{else}{l s='View Dates'}{/if}
|
||||
</a>
|
||||
<input type="hidden" class="form-control disable_dates_json" name="{$var_name_room_info|cat:'[disable_dates_json]'}" {if $room_info['id_status'] == $rm_status['STATUS_TEMPORARY_INACTIVE']['id']}value="{$room_info['disable_dates_json']|escape:'html':'UTF-8'}"{/if}>
|
||||
</td>
|
||||
@@ -184,6 +184,7 @@
|
||||
<h4 class="modal-title"><i class="icon-calendar"></i> {l s='Disable Dates'}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="text-left errors-wrap" style="display: none;"></div>
|
||||
<div class="alert alert-info">
|
||||
<p>{l s='Please note that the date chosen for field \'Date To\' is not considered as a blocking date.'}</p>
|
||||
</div>
|
||||
@@ -239,13 +240,13 @@
|
||||
var prod_link = "{$link->getAdminLink('AdminProducts')}";
|
||||
var rm_status = {$rm_status|@json_encode};
|
||||
var currentRoomRow = 0;
|
||||
var datesMissing = "{$datesMissing}";
|
||||
var datesOverlapping = "{$datesOverlapping}";
|
||||
|
||||
$(document).ready(function() {
|
||||
const DisableDatesModal = {
|
||||
init: function() {
|
||||
this.addNewRow();
|
||||
DisableDatesModal.addNewRow();
|
||||
DisableDatesModal.hideErrors();
|
||||
DisableDatesModal.removeAllInvalidRowDataMarkers();
|
||||
},
|
||||
addNewRow: function() {
|
||||
$('#deactiveDatesModal tbody').append(this.disableDatesRowHtml);
|
||||
@@ -260,33 +261,58 @@
|
||||
$(dateRangeRow).find('.room_disable_reason').val(dateRange.reason);
|
||||
});
|
||||
},
|
||||
getValidationErrors: function() {
|
||||
let $return = false;
|
||||
validateDisableDates: function(cb) {
|
||||
DisableDatesModal.hideErrors();
|
||||
DisableDatesModal.removeAllInvalidRowDataMarkers();
|
||||
DisableDatesModal.disableRowDeleteActionButtons();
|
||||
|
||||
let idRoom = parseInt($('#deactiveDatesModal .room-disable-dates').attr('data-id-room'));
|
||||
idRoom = idRoom == isNaN(idRoom) ? 0 : idRoom;
|
||||
const disableDates = Array();
|
||||
$('#deactiveDatesModal .room-disable-dates tbody tr').each(function(i, tr) {
|
||||
const dateFrom = $(tr).find('.disabled_date_from').val().trim();
|
||||
const dateTo = $(tr).find('.disabled_date_to').val().trim();
|
||||
|
||||
if (!dateFrom.length || !dateTo.length) {
|
||||
$return = datesMissing;
|
||||
}
|
||||
|
||||
disableDates.push({ dateFrom, dateTo });
|
||||
const date_from = $(tr).find('.disabled_date_from').val().trim();
|
||||
const date_to = $(tr).find('.disabled_date_to').val().trim();
|
||||
disableDates.push({ date_from, date_to });
|
||||
});
|
||||
|
||||
$.each(disableDates, function(keyOuter, dateRangeOuter) {
|
||||
$.each(disableDates, function(keyInner, dateRangeInner) {
|
||||
if (keyInner != keyOuter) {
|
||||
if ((dateRangeOuter.dateFrom <= dateRangeInner.dateTo)
|
||||
&& (dateRangeInner.dateFrom <= dateRangeOuter.dateTo)
|
||||
) {
|
||||
$return = datesOverlapping;
|
||||
$.ajax({
|
||||
url: prod_link,
|
||||
type: 'POST',
|
||||
data: {
|
||||
ajax: true,
|
||||
action: 'validateDisableDates',
|
||||
id_room: idRoom,
|
||||
disable_dates: disableDates,
|
||||
},
|
||||
dataType: 'JSON',
|
||||
success: function(response) {
|
||||
if (response.status) {
|
||||
if (typeof cb === 'function') {
|
||||
cb();
|
||||
}
|
||||
} else {
|
||||
DisableDatesModal.showErrors(response.errors);
|
||||
DisableDatesModal.addInvalidRowDataMarkers(response.rows_to_highlight);
|
||||
}
|
||||
});
|
||||
},
|
||||
complete: function () {
|
||||
DisableDatesModal.enableRowDeleteActionButtons();
|
||||
}
|
||||
});
|
||||
},
|
||||
showErrors: function(errors) {
|
||||
$('#deactiveDatesModal .errors-wrap').html(errors);
|
||||
$('#deactiveDatesModal .errors-wrap').show();
|
||||
},
|
||||
hideErrors: function() {
|
||||
$('#deactiveDatesModal .errors-wrap').hide();
|
||||
$('#deactiveDatesModal .errors-wrap').html('');
|
||||
},
|
||||
addInvalidRowDataMarkers: function(rowsToHighlight) {
|
||||
rowsToHighlight.map(function (rowIndex) {
|
||||
const tr = $('#deactiveDatesModal .room-disable-dates tbody tr').eq(rowIndex);
|
||||
DisableDatesModal.markRowDataInvalid(tr);
|
||||
});
|
||||
|
||||
return $return;
|
||||
},
|
||||
getDisableDatesInfo: function() {
|
||||
const disableDates = Array();
|
||||
@@ -300,6 +326,24 @@
|
||||
|
||||
return disableDates;
|
||||
},
|
||||
disableRowDeleteActionButtons: function() {
|
||||
const disableDates = Array();
|
||||
$('#deactiveDatesModal .room-disable-dates .remove-disable-dates-button').addClass('disabled');
|
||||
},
|
||||
enableRowDeleteActionButtons: function() {
|
||||
const disableDates = Array();
|
||||
$('#deactiveDatesModal .room-disable-dates .remove-disable-dates-button').removeClass('disabled');
|
||||
},
|
||||
markRowDataInvalid: function(tr) {
|
||||
$(tr).css({ 'outline': '1px solid #D27C82', 'border-radius': '2px' });
|
||||
},
|
||||
removeAllInvalidRowDataMarkers: function(tr) {
|
||||
$('#deactiveDatesModal .room-disable-dates tr').css('outline', '');
|
||||
$(tr).css('outline', '');
|
||||
},
|
||||
removeRowDataMark: function(tr) {
|
||||
$(tr).css('outline', '');
|
||||
},
|
||||
disableDatesRowHtml: `
|
||||
<tr class="disabledDatesTr">
|
||||
<td class="col-sm-2 center">
|
||||
@@ -322,8 +366,10 @@
|
||||
$('#deactiveDatesModal').on('show.bs.modal', function(e) {
|
||||
const triggerRoomRow = $(e.relatedTarget);
|
||||
const roomRowIndex = parseInt($(triggerRoomRow).closest('tr').attr('data-row-index'));
|
||||
const idRoom = parseInt($(triggerRoomRow).attr('data-id-room'));
|
||||
$('#deactiveDatesModal table.room-disable-dates tbody').html('');
|
||||
$('#deactiveDatesModal table.room-disable-dates').attr('data-room-row-index', roomRowIndex);
|
||||
$('#deactiveDatesModal table.room-disable-dates').attr('data-id-room', idRoom);
|
||||
let disableDates = $(triggerRoomRow).closest('tr').find('.disable_dates_json').val();
|
||||
if (!disableDates) {
|
||||
DisableDatesModal.init();
|
||||
@@ -331,22 +377,27 @@
|
||||
}
|
||||
|
||||
disableDates = JSON.parse(disableDates);
|
||||
DisableDatesModal.hideErrors();
|
||||
DisableDatesModal.populateWithDatesInfo(disableDates);
|
||||
});
|
||||
|
||||
// copy json formatted dates to room
|
||||
$(document).on('click', '.deactiveDatesModalSubmit', function() {
|
||||
const error = DisableDatesModal.getValidationErrors();
|
||||
if (error) {
|
||||
alert(error);
|
||||
return;
|
||||
}
|
||||
|
||||
// Disable dates data filling when model open
|
||||
$('#deactiveDatesModal').on('hide.bs.modal', function(e) {
|
||||
const disableDates = DisableDatesModal.getDisableDatesInfo();
|
||||
const roomRowIndex = parseInt($('#deactiveDatesModal table.room-disable-dates').attr('data-room-row-index'));
|
||||
const roomRow = $('#product-configuration .hotel-room tr.room_data_values[data-row-index='+roomRowIndex+']');
|
||||
$(roomRow).find('.disable_dates_json').val(JSON.stringify(disableDates));
|
||||
$('#deactiveDatesModal').modal('hide');
|
||||
});
|
||||
|
||||
// copy json formatted dates to room
|
||||
$(document).on('click', '.deactiveDatesModalSubmit', function() {
|
||||
DisableDatesModal.validateDisableDates(function () {
|
||||
const disableDates = DisableDatesModal.getDisableDatesInfo();
|
||||
const roomRowIndex = parseInt($('#deactiveDatesModal table.room-disable-dates').attr('data-room-row-index'));
|
||||
const roomRow = $('#product-configuration .hotel-room tr.room_data_values[data-row-index='+roomRowIndex+']');
|
||||
$(roomRow).find('.disable_dates_json').val(JSON.stringify(disableDates));
|
||||
$('#deactiveDatesModal').modal('hide');
|
||||
});
|
||||
});
|
||||
|
||||
// Add new room detail
|
||||
@@ -456,7 +507,7 @@
|
||||
onClose: function(selectedDate) {
|
||||
var dateTo = $(this).closest('tr').find('.disabled_date_to').val();
|
||||
if (!dateTo || (dateTo && selectedDate >= dateTo)) {
|
||||
$('.disabled_date_to').datepicker('show');
|
||||
$(this).closest('tr').find('.disabled_date_to').datepicker('show');
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
{if isset($obj->id)}
|
||||
<div id="product-customization" class="panel product-tab">
|
||||
<input type="hidden" name="submitted_tabs[]" value="Customization" />
|
||||
<h3>{l s='Add or modify customizable properties'}</h3>
|
||||
|
||||
{if isset($display_common_field) && $display_common_field}
|
||||
<div class="alert alert-info">{l s='Warning, if you change the value of fields with an orange bullet %s, the value will be changed for all other shops for this product' sprintf=$bullet_common_field}</div>
|
||||
{/if}
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="uploadable_files" type="uploadable_files"}</span></div>
|
||||
<label class="control-label col-lg-3" for="uploadable_files">
|
||||
{$bullet_common_field}
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='Number of upload file fields to be displayed to the user.'}">
|
||||
{l s='File fields'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-1">
|
||||
<input type="text" name="uploadable_files" id="uploadable_files" value="{$uploadable_files|htmlentities}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="text_fields" type="text_fields"}</span></div>
|
||||
<label class="control-label col-lg-3" for="text_fields">
|
||||
{$bullet_common_field}
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='Number of text fields to be displayed to the user.'}">
|
||||
{l s='Text fields'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-1">
|
||||
<input type="text" name="text_fields" id="text_fields" value="{$text_fields|htmlentities}" />
|
||||
</div>
|
||||
</div>
|
||||
{if $has_file_labels}
|
||||
<hr/>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
{l s='Define the label of the file fields'}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
{$display_file_labels}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if $has_text_labels}
|
||||
<hr/>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
{l s='Define the label of the text fields'}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
{$display_text_labels}
|
||||
</div>
|
||||
</div>
|
||||
{/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>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -107,24 +107,35 @@
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
if (product_type == product_type_pack)
|
||||
{* if (product_type == product_type_pack)
|
||||
{
|
||||
$('a[id*="VirtualProduct"]').hide();
|
||||
$('a[id*="Combinations"]').hide();
|
||||
}
|
||||
else if (product_type == product_type_virtual)
|
||||
{
|
||||
$('a[id*="Quantities"]').hide();
|
||||
$('a[id*="Configuration"]').show();
|
||||
$('a[id*="Booking"]').show();
|
||||
$('a[id*="Occupancy"]').show();
|
||||
$('a[id*="ModuleHotelreservationsystem"]').show();
|
||||
$('a[id*="Pack"]').hide();
|
||||
$('a[id*="Shipping"]').hide();
|
||||
$('a[id*="Combinations"]').hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('a[id*="Quantities"]').show();
|
||||
$('a[id*="Configuration"]').hide();
|
||||
$('a[id*="Occupancy"]').hide();
|
||||
$('a[id*="Booking"]').hide();
|
||||
$('a[id*="ModuleHotelreservationsystem"]').hide();
|
||||
$('a[id*="Pack"]').hide();
|
||||
$('a[id*="VirtualProduct"]').hide();
|
||||
}
|
||||
} *}
|
||||
{* updateTextInfo(product_type); *}
|
||||
|
||||
$('#desc-product-newCombination').hide();
|
||||
{* $('#desc-product-newCombination').hide(); *}
|
||||
|
||||
{* submenu binding *}
|
||||
$(".productTabs a").click(function(e){
|
||||
@@ -140,12 +151,12 @@
|
||||
var split_position = id.indexOf('-') + 1;
|
||||
var btn_name = id.substr(split_position);
|
||||
|
||||
if ((btn_name == 'VirtualProduct' || btn_name == 'Pack') && $('#name_' + id_lang_default).val() == '')
|
||||
{* if ((btn_name == 'VirtualProduct' || btn_name == 'Pack') && $('#name_' + id_lang_default).val() == '')
|
||||
{
|
||||
alert(missing_product_name);
|
||||
$('#name_' + id_lang_default).focus();
|
||||
return false;
|
||||
}
|
||||
} *}
|
||||
|
||||
$('#key_tab').val(btn_name);
|
||||
|
||||
@@ -166,7 +177,7 @@
|
||||
});
|
||||
|
||||
var languages = new Array();
|
||||
if (btn_name == "Combinations")
|
||||
{* if (btn_name == "Combinations")
|
||||
{
|
||||
$('#desc-product-new').hide();
|
||||
$('#desc-product-newCombination').show();
|
||||
@@ -177,12 +188,12 @@
|
||||
handleSaveButtons();
|
||||
}
|
||||
else
|
||||
{
|
||||
{ *}
|
||||
$('#desc-product-newCombination').hide();
|
||||
// if pack is enabled, save button are visible only if pack is valid
|
||||
if ($("input[name='id_product']").val() != 0 || btn_name != 'Informations')
|
||||
handleSaveButtons();
|
||||
}
|
||||
{* } *}
|
||||
|
||||
$('.label-tooltip').tooltip();
|
||||
});
|
||||
@@ -227,28 +238,28 @@
|
||||
$('.productTabs').show();
|
||||
$('#product-tab-content-wait').hide();
|
||||
|
||||
function checkIfProductTypeIsPack() {
|
||||
{* function checkIfProductTypeIsPack() {
|
||||
var typeIsPack = $('#pack_product').is(':checked');
|
||||
if (typeIsPack && $('#inputPackItems').val()=='' ) {
|
||||
$('.pack-empty-warning').removeClass('alert-warning').addClass('alert-danger');
|
||||
$('#curPackItemName').select2('open');
|
||||
}
|
||||
return typeIsPack;
|
||||
}
|
||||
} *}
|
||||
$("#product_form").validate({
|
||||
ignore: '.updateCurrentText',
|
||||
rules: {
|
||||
{* rules: {
|
||||
inputPackItems: {
|
||||
required: {
|
||||
depends: checkIfProductTypeIsPack
|
||||
},
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
}, *}
|
||||
{* messages: {
|
||||
inputPackItems: {
|
||||
required: ""
|
||||
}
|
||||
},
|
||||
}, *}
|
||||
// override jquery validate plugin defaults for bootstrap 3
|
||||
highlight: function(element) {
|
||||
$(element).closest('.form-group').addClass('has-error');
|
||||
@@ -287,11 +298,10 @@
|
||||
|
||||
<form id="product_form" class="form-horizontal col-lg-10 col-md-9" action="{$form_action|escape:'html':'UTF-8'}" method="post" enctype="multipart/form-data" name="product" novalidate>
|
||||
<input type="hidden" name="id_product" value="{$id_product}" />
|
||||
<!-- <input type="hidden" id="is_virtual" name="is_virtual" value="{$product->is_virtual|escape:'html':'UTF-8'}" /> -->
|
||||
{* <input type="hidden" id="is_virtual" name="is_virtual" value="{$product->is_virtual|escape:'html':'UTF-8'}" /> *}
|
||||
<!-- changed input field to make product virtual by default -->
|
||||
<input type="hidden" id="is_virtual" name="is_virtual" value="1"/>
|
||||
|
||||
|
||||
{if isset($smarty.request.page) && $smarty.request.page > 1}
|
||||
<input type="hidden" id="page" name="page" value="{$smarty.request.page|intval}" />
|
||||
{/if}
|
||||
|
||||
@@ -100,38 +100,9 @@
|
||||
|
||||
{include file="controllers/products/multishop/check_fields.tpl" product_tab="Informations"}
|
||||
|
||||
<div class="form-group hidden">
|
||||
<label class="control-label col-lg-3" for="simple_product">
|
||||
{$bullet_common_field} {l s='Type'}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="radio">
|
||||
<label for="simple_product">
|
||||
<input type="radio" name="type_product" id="simple_product" value="{Product::PTYPE_SIMPLE}" {if $product_type == Product::PTYPE_SIMPLE}checked="checked"{/if}>
|
||||
{l s='Standard product'}</label>
|
||||
</div>
|
||||
<div class="radio">
|
||||
<label for="pack_product">
|
||||
<input type="radio" name="type_product" {if $is_in_pack}disabled="disabled"{/if} id="pack_product" value="{Product::PTYPE_PACK}" {if $product_type == Product::PTYPE_PACK}checked="checked"{/if}> {l s='Pack of existing products'}</label>
|
||||
</div>
|
||||
<div class="radio">
|
||||
<label for="virtual_product">
|
||||
<input type="radio" name="type_product" id="virtual_product" {if $is_in_pack}disabled="disabled"{/if} value="{Product::PTYPE_VIRTUAL}" {if $product_type == Product::PTYPE_VIRTUAL}checked="checked"{/if}>
|
||||
{l s='Virtual product (services, booking, downloadable products, etc.)'}</label>
|
||||
</div>
|
||||
<div class="row row-padding-top">
|
||||
<div id="warn_virtual_combinations" class="alert alert-warning" style="display:none">{l s='You cannot use combinations with a virtual product.'}</div>
|
||||
<div id="warn_pack_combinations" class="alert alert-warning" style="display:none">{l s='You cannot use combinations with a pack.'}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="product-pack-container" {if $product_type != Product::PTYPE_PACK}style="display:none"{/if}></div>
|
||||
|
||||
{*<hr />*}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="name" type="default" multilang="true"}</span></div>
|
||||
<label class="control-label col-lg-2 required" for="name_{$id_lang}">
|
||||
<label class="control-label col-lg-2 required" id="name" for="name_{$id_lang}">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Write the name of the Room Type for ex. Delux, Executive etc.'} {l s='Invalid characters:'} <>;=#{}">
|
||||
{l s='Room Type'}
|
||||
</span>
|
||||
@@ -151,9 +122,9 @@
|
||||
<input type="hidden" value="{$htl_room_type['id']}" name="wk_id_room_type">
|
||||
{/if}
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-group" id="hotel_selection">
|
||||
{if isset($htl_room_type)}
|
||||
<label class="control-label col-sm-3 required" for="hotel_place">
|
||||
<label class="control-label col-sm-3 required">
|
||||
{l s='Hotel'}
|
||||
</label>
|
||||
<div class="col-sm-5">
|
||||
@@ -335,7 +306,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{* <div class="form-group">
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="condition" type="default"}</span></div>
|
||||
<label class="control-label col-lg-2" for="condition">
|
||||
{l s='Condition'}
|
||||
@@ -347,7 +318,7 @@
|
||||
<option value="refurbished" {if $product->condition == 'refurbished'}selected="selected"{/if}>{l s='Refurbished'}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div> *}
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
@@ -54,7 +54,9 @@
|
||||
<hr>
|
||||
|
||||
<div class="alert alert-info">
|
||||
{l s='Below, enter the maximum of adults or children which can be accommodated in a room of this room type. Also, enter maximum number of guests for this room type.'}
|
||||
{l s='Below, enter the maximum number of adults and children which can be accommodated in a room of this room type.'}
|
||||
<br>
|
||||
{l s='For maximum room occupancy, the total number of guests which can be accommodated in a room of this room type.'}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<input type="hidden" name="submitted_tabs[]" value="Pack" />
|
||||
<hr />
|
||||
<div class="form-group listOfPack">
|
||||
<label class="control-label col-lg-3 product_description">
|
||||
{l s='List of products of this pack'}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<p class="alert alert-warning pack-empty-warning" {if $pack_items|@count != 0}style="display:none"{/if}>{l s='This pack is empty. You must add at least one product item.'}</p>
|
||||
<ul id="divPackItems" class="list-unstyled">
|
||||
{foreach $pack_items as $pack_item}
|
||||
<li class="product-pack-item media-product-pack" data-product-name="{$curPackItemName}" data-product-qty="{$pack_item.pack_quantity}" data-product-id="{$pack_item.id}" data-product-id-attribute="{$pack_item.id_product_attribute}">
|
||||
<img class="media-product-pack-img" src="{$pack_item.image}"/>
|
||||
<span class="media-product-pack-title">{$pack_item.name}</span>
|
||||
<span class="media-product-pack-ref">REF: {$pack_item.reference}</span>
|
||||
<span class="media-product-pack-quantity"><span class="text-muted">x</span>{$pack_item.pack_quantity}</span>
|
||||
<button type="button" class="btn btn-default delPackItem media-product-pack-action" data-delete="{$pack_item.id}" data-delete-attr="{$pack_item.id_product_attribute}"><i class="icon-trash"></i></button>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group addProductToPack">
|
||||
<label class="control-label col-lg-3" for="curPackItemName">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Start by typing the first letters of the product name, then select the product from the drop-down list.'}">
|
||||
{l s='Add product in your pack'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<input type="text" id="curPackItemName" name="curPackItemName" class="form-control" />
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">×</span>
|
||||
<input type="number" name="curPackItemQty" id="curPackItemQty" class="form-control" min="1" value="1"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<button type="button" id="add_pack_item" class="btn btn-default">
|
||||
<i class="icon-plus-sign-alt"></i> {l s='Add this product'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="inputPackItems" id="inputPackItems" value="{$input_pack_items}" placeholder="inputs"/>
|
||||
<input type="hidden" name="namePackItems" id="namePackItems" value="{$input_namepack_items}" placeholder="name"/>
|
||||
@@ -1,301 +0,0 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
{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}
|
||||
@@ -0,0 +1,85 @@
|
||||
{if isset($product->id)}
|
||||
<div id="product-configuration" class="panel product-tab">
|
||||
<input type="hidden" name="submitted_tabs[]" value="ServiceProduct" />
|
||||
<h3 class="tab"> <i class="icon-AdminAdmin"></i> {l s='Service Products'}</h3>
|
||||
|
||||
<div class="from-group table-responsive-row clearfix">
|
||||
<table class="table tableDnD hotel-roomtype-link-table">
|
||||
<thead>
|
||||
<tr class="nodrag nodrop">
|
||||
<th class="col-sm-1">
|
||||
<span>{l s='Id Service'}</span>
|
||||
</th>
|
||||
<th class="col-sm-3">
|
||||
<span>{l s='Name'}</span>
|
||||
</th>
|
||||
<th>
|
||||
<span>{l s='Auto add to cart'}</span>
|
||||
</th>
|
||||
<th>
|
||||
<span>{l s='Position'}</span>
|
||||
</th>
|
||||
<th>
|
||||
<span>{l s='Price'}</span>
|
||||
</th>
|
||||
<th>
|
||||
<span>{l s='Tax'}</span>
|
||||
</th>
|
||||
<th class="text-right">
|
||||
<span>{l s='Action'}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if isset($service_products) && $service_products}
|
||||
{foreach from=$service_products key=key item=service_product}
|
||||
<tr id='room_type_service_product_{$service_product.id_room_type_service_product|escape:'html':'UTF-8'}' position='{$service_product.position|escape:'html':'UTF-8'}' id_product='{$service_product.id_product|escape:'html':'UTF-8'}' id_element="{$product->id}" data-roomtype_url="{$link->getAdminLink('AdminProducts', true)|addslashes}">
|
||||
<td class="col-sm-1">{$service_product.id_product|escape:'html':'UTF-8'} <a target="blank" href="{$link->getAdminLink('AdminNormalProducts')|escape:'html':'UTF-8'}&id_product={$service_product.id_product|escape:'html':'UTF-8'}&updateproduct"><i class="icon-external-link-sign"></i></a></td>
|
||||
<td>{$service_product.name}</td>
|
||||
<td><span {if $service_product.auto_add_to_cart}class="badge badge-success"{/if}>{if $service_product.auto_add_to_cart}{l s='Yes'}{else}{l s='No'}{/if}</span></td>
|
||||
<td class="pointer dragHandle center positionImage">
|
||||
<div class="dragGroup">
|
||||
<div class="positions">
|
||||
{$service_product.position + 1}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span class="field-view service-product-price-text">{if isset($service_product.custom_price) && $service_product.custom_price}{displayPrice price=$service_product.custom_price currency=$id_currency}{else}{displayPrice price=$service_product.default_price currency=$id_currency}{/if}</span>
|
||||
<div class="field-edit" style="display:none">
|
||||
<div class="input-group">
|
||||
<input type="text" value="{if isset($service_product.custom_price) && $service_product.custom_price}{$service_product.custom_price|escape:'html':'UTF-8'}{else}{$service_product.default_price|escape:'html':'UTF-8'}{/if}" class="service-product-price" data-id_product="{$service_product.id_product|escape:'html':'UTF-8'}">
|
||||
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="help-block">{l s='Default price: %s' sprintf={displayPrice price=$service_product.default_price currency=$id_currency}}
|
||||
</td>
|
||||
<td>
|
||||
<span class="field-view service_product_tax_text">{if isset($service_product.tax_rules_group_name) && $service_product.tax_rules_group_name}{$service_product.tax_rules_group_name}{else}{$service_product.default_tax_rules_group_name}{/if}</span>
|
||||
<div class="field-edit" style="display:none">
|
||||
<select class="service_product_id_tax_rules_group"{if $tax_exclude_taxe_option}disabled="disabled"{/if}>
|
||||
<option value="0">{l s='No Tax'}</option>
|
||||
{foreach from=$tax_rules_groups item=tax_rules_group}
|
||||
<option value="{$tax_rules_group.id_tax_rules_group}" {if $service_product.id_tax_rules_group == $tax_rules_group.id_tax_rules_group}selected="selected"{/if} >
|
||||
{$tax_rules_group['name']|htmlentitiesUTF8}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<div class="help-block">{l s='Default tax rule: %s' sprintf=$service_product.default_tax_rules_group_name}
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<a href="#" class="btn btn-default button-edit-price field-view"><i class="icon-pencil"></i></a>
|
||||
<span class="field-edit" style="display:none">
|
||||
<a href="#" class="btn btn-default btn-save" data-roomtype_url="{$link->getAdminLink('AdminProducts', true)|addslashes}" data-id_product="{$service_product.id_product|escape:'html':'UTF-8'}" data-id_room_type_service_product_price="{$service_product.id_room_type_service_product_price|escape:'html':'UTF-8'}"><i class="icon-save"></i> {l s='save'}</a>
|
||||
<a href="#" class="btn btn-default btn-cancel"><i class="icon-times"></i></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -1,118 +0,0 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<div id="product-shipping" class="panel product-tab">
|
||||
<input type="hidden" name="submitted_tabs[]" value="Shipping" />
|
||||
<h3>{l s='Shipping'}</h3>
|
||||
|
||||
{if isset($display_common_field) && $display_common_field}
|
||||
<div class="alert alert-info">{l s='Warning, if you change the value of fields with an orange bullet %s, the value will be changed for all other shops for this product' sprintf=$bullet_common_field}</div>
|
||||
{/if}
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3" for="width">{$bullet_common_field} {l s='Package width'}</label>
|
||||
<div class="input-group col-lg-2">
|
||||
<span class="input-group-addon">{$ps_dimension_unit}</span>
|
||||
<input maxlength="14" id="width" name="width" type="text" value="{$product->width}" onkeyup="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3" for="height">{$bullet_common_field} {l s='Package height'}</label>
|
||||
<div class="input-group col-lg-2">
|
||||
<span class="input-group-addon">{$ps_dimension_unit}</span>
|
||||
<input maxlength="14" id="height" name="height" type="text" value="{$product->height}" onkeyup="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3" for="depth">{$bullet_common_field} {l s='Package depth'}</label>
|
||||
<div class="input-group col-lg-2">
|
||||
<span class="input-group-addon">{$ps_dimension_unit}</span>
|
||||
<input maxlength="14" id="depth" name="depth" type="text" value="{$product->depth}" onkeyup="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3" for="weight">{$bullet_common_field} {l s='Package weight'}</label>
|
||||
<div class="input-group col-lg-2">
|
||||
<span class="input-group-addon">{$ps_weight_unit}</span>
|
||||
<input maxlength="14" id="weight" name="weight" type="text" value="{$product->weight}" onkeyup="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3" for="additional_shipping_cost">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='If a carrier has a tax, it will be added to the shipping fees.'}">
|
||||
{l s='Additional shipping fees (for a single item)'}
|
||||
</span>
|
||||
|
||||
</label>
|
||||
<div class="input-group col-lg-2">
|
||||
<span class="input-group-addon">{$currency->prefix}{$currency->suffix} {if $country_display_tax_label}({l s='tax excl.'}){/if}</span>
|
||||
<input type="text" id="additional_shipping_cost" name="additional_shipping_cost" onchange="this.value = this.value.replace(/,/g, '.');" value="{$product->additional_shipping_cost|htmlentities}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3" for="availableCarriers">{l s='Carriers'}</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="form-control-static row">
|
||||
<div class="col-xs-6">
|
||||
<p>{l s='Available carriers'}</p>
|
||||
<select id="availableCarriers" name="availableCarriers" multiple="multiple">
|
||||
{foreach $carrier_list as $carrier}
|
||||
{if !isset($carrier.selected) || !$carrier.selected}
|
||||
<option value="{$carrier.id_reference}">{$carrier.name}</option>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</select>
|
||||
<a href="#" id="addCarrier" class="btn btn-default btn-block">{l s='Add'} <i class="icon-arrow-right"></i></a>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<p>{l s='Selected carriers'}</p>
|
||||
<select id="selectedCarriers" name="selectedCarriers[]" multiple="multiple">
|
||||
{foreach $carrier_list as $carrier}
|
||||
{if isset($carrier.selected) && $carrier.selected}
|
||||
<option value="{$carrier.id_reference}">{$carrier.name}</option>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</select>
|
||||
<a href="#" id="removeCarrier" class="btn btn-default btn-block"><i class="icon-arrow-left"></i> {l s='Remove'}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="no-selected-carries-alert">
|
||||
<div class="col-lg-offset-3">
|
||||
<div class="alert alert-warning">{l s='If no carrier is selected then all the carriers will be available for customers orders.'}</div>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
@@ -1,138 +0,0 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<input type="hidden" name="supplier_loaded" value="1">
|
||||
{if isset($product->id)}
|
||||
<div id="product-suppliers" class="panel product-tab">
|
||||
<input type="hidden" name="submitted_tabs[]" value="Suppliers" />
|
||||
<h3>{l s='Suppliers of the current product'}</h3>
|
||||
<div class="alert alert-info">
|
||||
{l s='This interface allows you to specify the suppliers of the current product and eventually its combinations.'}<br />
|
||||
{l s='It is also possible to specify supplier references according to previously associated suppliers.'}<br />
|
||||
<br />
|
||||
{l s='When using the advanced stock management tool (see Preferences/Products), the values you define (prices, references) will be used in supply orders.'}
|
||||
</div>
|
||||
<label>{l s='Please choose the suppliers associated with this product. Please select a default supplier, as well.'}</label>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="fixed-width-xs"><span class="title_box">{l s='Selected'}</span></th>
|
||||
<th><span class="title_box">{l s='Supplier Name'}</span></th>
|
||||
<th class="fixed-width-xs"><span class="title_box">{l s='Default'}</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$suppliers item=supplier}
|
||||
<tr>
|
||||
<td><input type="checkbox" class="supplierCheckBox" name="check_supplier_{$supplier['id_supplier']}" {if $supplier['is_selected'] == true}checked="checked"{/if} value="{$supplier['id_supplier']}" /></td>
|
||||
<td>{$supplier['name']}</td>
|
||||
<td><input type="radio" id="default_supplier_{$supplier['id_supplier']}" name="default_supplier" value="{$supplier['id_supplier']}" {if $supplier['is_selected'] == false}disabled="disabled"{/if} {if $supplier['is_default'] == true}checked="checked"{/if} /></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
<a class="btn btn-link bt-icon confirm_leave" href="{$link->getAdminLink('AdminSuppliers')|escape:'html':'UTF-8'}&addsupplier">
|
||||
<i class="icon-plus"></i> {l s='Create a new supplier'} <i class="icon-external-link-sign"></i>
|
||||
</a>
|
||||
<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>
|
||||
</div>
|
||||
<div class="panel">
|
||||
<h3>{l s='Supplier reference(s)'}</h3>
|
||||
<div class="alert alert-info">
|
||||
{if $associated_suppliers|@count == 0}
|
||||
{l s='You must specify the suppliers associated with this product. You must also select the default product supplier before setting references.'}
|
||||
{else}
|
||||
{l s='You can specify product reference(s) for each associated supplier.'}
|
||||
{/if}
|
||||
{l s='Click "Save and Stay" after changing selected suppliers to display the associated product references.'}
|
||||
</div>
|
||||
<div class="panel-group" id="accordion-supplier">
|
||||
{foreach from=$associated_suppliers item=supplier name=data}
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion-supplier" href="#supplier-{$supplier->id}">{if isset($supplier->name)}{$supplier->name}{/if}</a>
|
||||
</div>
|
||||
<div id="supplier-{$supplier->id}">
|
||||
<div class="panel-body">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><span class="title_box">{l s='Product name'}</span></th>
|
||||
<th><span class="title_box">{l s='Supplier reference'}</span></th>
|
||||
<th><span class="title_box">{l s='Unit price tax excluded'}</span></th>
|
||||
<th><span class="title_box">{l s='Unit price currency'}</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $attributes AS $index => $attribute}
|
||||
{assign var=reference value=''}
|
||||
{assign var=price_te value=''}
|
||||
{assign var=id_currency value=$id_default_currency}
|
||||
{foreach from=$associated_suppliers_collection item=asc}
|
||||
{if $asc->id_product == $attribute['id_product'] && $asc->id_product_attribute == $attribute['id_product_attribute'] && $asc->id_supplier == $supplier->id_supplier}
|
||||
{assign var=reference value=$asc->product_supplier_reference}
|
||||
{assign var=price_te value=Tools::ps_round($asc->product_supplier_price_te, 2)}
|
||||
{if $asc->id_currency}
|
||||
{assign var=id_currency value=$asc->id_currency}
|
||||
{/if}
|
||||
{/if}
|
||||
{/foreach}
|
||||
<tr {if $index is odd}class="alt_row"{/if}>
|
||||
<td>{$product_designation[$attribute['id_product_attribute']]}</td>
|
||||
<td>
|
||||
<input type="text" value="{$reference|escape:'html':'UTF-8'}" name="supplier_reference_{$attribute['id_product']}_{$attribute['id_product_attribute']}_{$supplier->id_supplier}" />
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" value="{$price_te|htmlentities}" name="product_price_{$attribute['id_product']}_{$attribute['id_product_attribute']}_{$supplier->id_supplier}" />
|
||||
</td>
|
||||
<td>
|
||||
<select name="product_price_currency_{$attribute['id_product']}_{$attribute['id_product_attribute']}_{$supplier->id_supplier}">
|
||||
{foreach $currencies AS $currency}
|
||||
<option value="{$currency['id_currency']}"
|
||||
{if $currency['id_currency'] == $id_currency}selected="selected"{/if}
|
||||
>{$currency['name']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -1,155 +0,0 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<script type="text/javascript">
|
||||
var newLabel = '{l s='New label'}';
|
||||
var choose_language = '{l s='Choose language:'}';
|
||||
var required = '{l s='Required'}';
|
||||
var customizationUploadableFileNumber = '{$product->uploadable_files}';
|
||||
var customizationTextFieldNumber = '{$product->text_fields}';
|
||||
var uploadableFileLabel = 0;
|
||||
var textFieldLabel = 0;
|
||||
</script>
|
||||
<div id="product-virtualproduct" class="panel product-tab">
|
||||
<input type="hidden" name="submitted_tabs[]" value="VirtualProduct" />
|
||||
<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="{$product->productDownload->filename}" />
|
||||
<h3>{l s='Virtual Product (services, booking or downloadable products)'}</h3>
|
||||
<div class="is_virtual_good" class="form-group">
|
||||
<input type="checkbox" id="is_virtual_good" name="is_virtual_good" value="true" {if $product->is_virtual && $product->productDownload->active}checked="checked"{/if} />
|
||||
<label for="is_virtual_good" class="t bold">{l s='Is this a virtual product?'}</label>
|
||||
</div>
|
||||
<div id="virtual_good" {if !$product->productDownload->id || $product->productDownload->active}style="display:none"{/if} class="form-group">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Does this product have an associated file?'}</label>
|
||||
<div class="col-lg-2">
|
||||
<span class="switch prestashop-switch">
|
||||
<input type="radio" name="is_virtual_file" id="is_virtual_file_on" value="1" {if $product_downloaded} checked="checked"{/if} />
|
||||
<label for="is_virtual_file_on">{l s='Yes'}</label>
|
||||
<input type="radio" name="is_virtual_file" id="is_virtual_file_off" value="0" {if !$product_downloaded} checked="checked"{/if} />
|
||||
<label for="is_virtual_file_off">{l s='No'}</label>
|
||||
<a class="slide-button btn"></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="is_virtual_file_product" style="display:none;">
|
||||
{if $download_product_file_missing}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-push-3 col-lg-9">
|
||||
<div class="alert alert-danger" id="file_missing">
|
||||
{$download_product_file_missing} :<br/>
|
||||
<strong>{l s='Server file name : %s'|sprintf:$product->productDownload->filename}</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if !$download_dir_writable}
|
||||
<div class="form-group">
|
||||
<div class="col-lg-push-3 col-lg-9">
|
||||
<div class="alert alert-danger">
|
||||
{l s='Your download repository is not writable.'}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{* Don't display file form if the product has combinations *}
|
||||
{if empty($product->cache_default_attribute)}
|
||||
{if $product->productDownload->id}
|
||||
<input type="hidden" id="virtual_product_id" name="virtual_product_id" value="{$product->productDownload->id}" />
|
||||
{/if}
|
||||
<div class="form-group"{if $is_file} style="display:none"{/if}>
|
||||
<label id="virtual_product_file_label" for="virtual_product_file" class="control-label col-lg-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='Upload a file from your computer'} ({Configuration::get('PS_ATTACHMENT_MAXIMUM_SIZE')|string_format:'%.2f'} {l s='MB max.'})">
|
||||
{l s='File'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-5">
|
||||
{$virtual_product_file_uploader}
|
||||
<p class="help-block">{l s='Upload a file from your computer'} ({Configuration::get('PS_ATTACHMENT_MAXIMUM_SIZE')|string_format:'%.2f'} {l s='MB max.'})</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3 required">{l s='Filename'}</label>
|
||||
<div class="col-lg-5">
|
||||
<input type="text" id="virtual_product_name" name="virtual_product_name" value="{$product->productDownload->display_filename|escape:'html':'UTF-8'}" />
|
||||
<p class="help-block">{l s='The full filename with its extension (e.g. Book.pdf)'}</p>
|
||||
</div>
|
||||
</div>
|
||||
{if $is_file}
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Link to the file:'}</label>
|
||||
<div class="col-lg-5">
|
||||
<a href="{$product->productDownload->getTextLink(true)}" class="btn btn-default"><i class="icon-download"></i> {l s='Download file'}</a>
|
||||
<a href="{$currentIndex|escape:'html':'UTF-8'}&deleteVirtualProduct=true&updateproduct&token={$token|escape:'html':'UTF-8'}&id_product={$product->id}" class="btn btn-default" onclick="return confirm('{l s='Do you really want to delete this file?' js=1}');"><i class="icon-trash"></i> {l s='Delete this file'}</a>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Number of allowed downloads'}</label>
|
||||
<div class="col-lg-3">
|
||||
<input type="text" id="virtual_product_nb_downloable" name="virtual_product_nb_downloable" value="{$product->productDownload->nb_downloadable|htmlentities}" class="" size="6" />
|
||||
<p class="help-block">{l s='Number of downloads allowed per customer. Set to 0 for unlimited downloads.'}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Format: YYYY-MM-DD.'}">
|
||||
{l s='Expiration date'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-5">
|
||||
<input class="datepicker" type="text" id="virtual_product_expiration_date" name="virtual_product_expiration_date" value="{$product->productDownload->date_expiration}" size="11" maxlength="10" autocomplete="off" />
|
||||
<p class="help-block">{l s='If set, the file will not be downloadable after this date. Leave blank if you do not wish to attach an expiration date.'}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3 required">{l s='Number of days'}</label>
|
||||
<div class="col-lg-3">
|
||||
<input type="text" id="virtual_product_nb_days" name="virtual_product_nb_days" value="{if !$product->productDownload->nb_days_accessible}0{else}{$product->productDownload->nb_days_accessible|htmlentities}{/if}" class="" size="4" />
|
||||
<p class="help-block">{l s='Number of days this file can be accessed by customers. Set to zero for unlimited access.'}</p>
|
||||
</div>
|
||||
</div>
|
||||
{* Feature not implemented *}
|
||||
{*<div class="form-group">*}
|
||||
{*<label for="virtual_product_is_shareable" class="control-label col-lg-3">{l s='is shareable'}</label>*}
|
||||
{*<div class="col-lg-9">*}
|
||||
{*<input type="checkbox" id="virtual_product_is_shareable" name="virtual_product_is_shareable" value="1" {if $product->productDownload->is_shareable}checked="checked"{/if} />*}
|
||||
{*<span class="alert alert-info" name="help_box" style="display:none">{l s='Please specify if the file can be shared.'}</span>*}
|
||||
{*</div>*}
|
||||
{*</div>*}
|
||||
{else}
|
||||
<div class="alert alert-info">
|
||||
{l s='You cannot edit your file here because you used combinations. Please edit this file in the Combinations tab.'}
|
||||
</div>
|
||||
{if isset($error_product_download)}{$error_product_download}{/if}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
@@ -1,100 +0,0 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<input type="hidden" name="warehouse_loaded" value="1">
|
||||
{if isset($product->id)}
|
||||
<div id="product-warehouses" class="panel product-tab">
|
||||
<input type="hidden" name="submitted_tabs[]" value="Warehouses" />
|
||||
<h3>{l s='Product location in warehouses'}</h3>
|
||||
<div class="row">
|
||||
<div class="alert alert-info" style="display:block; position:'auto';">
|
||||
<p>{l s='This interface allows you to specify the warehouse in which the product is stocked.'}</p>
|
||||
<p>{l s='You can also specify product/product combinations as it relates to warehouse location. '}</p>
|
||||
</div>
|
||||
<p>{l s='Please choose the warehouses associated with this product.'}</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<a class="btn btn-link confirm_leave" href="{$link->getAdminLink('AdminWarehouses')|escape:'html':'UTF-8'}&addwarehouse">{l s='Create a new warehouse'} <i class="icon-external-link-sign"></i></a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="panel-group" id="warehouse-accordion">
|
||||
{foreach from=$warehouses item=warehouse name=data}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<a class="accordion-toggle" data-toggle="collapse" data-parent="#warehouse-accordion" href="#warehouse-{$warehouse['id_warehouse']}">{$warehouse['name']}</a>
|
||||
</div>
|
||||
<div id="warehouse-{$warehouse['id_warehouse']}">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="fixed-width-xs" align="center"><span class="title_box">{l s='Stored'}</span></th>
|
||||
<th><span class="title_box">{l s='Product'}</span></th>
|
||||
<th><span class="title_box">{l s='Location (optional)'}</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $attributes AS $index => $attribute}
|
||||
{assign var=location value=''}
|
||||
{assign var=selected value=''}
|
||||
{foreach from=$associated_warehouses item=aw}
|
||||
{if $aw->id_product == $attribute['id_product'] && $aw->id_product_attribute == $attribute['id_product_attribute'] && $aw->id_warehouse == $warehouse['id_warehouse']}
|
||||
{assign var=location value=$aw->location}
|
||||
{assign var=selected value=true}
|
||||
{/if}
|
||||
{/foreach}
|
||||
<tr {if $index is odd}class="alt_row"{/if}>
|
||||
<td class="fixed-width-xs" align="center"><input type="checkbox"
|
||||
name="check_warehouse_{$warehouse['id_warehouse']}_{$attribute['id_product']}_{$attribute['id_product_attribute']}"
|
||||
{if $selected == true}checked="checked"{/if}
|
||||
value="1" />
|
||||
</td>
|
||||
<td>{$product_designation[$attribute['id_product_attribute']]}</td>
|
||||
<td><input type="text"
|
||||
name="location_warehouse_{$warehouse['id_warehouse']}_{$attribute['id_product']}_{$attribute['id_product_attribute']}"
|
||||
value="{$location|escape:'html':'UTF-8'}"
|
||||
size="20" />
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
{if $attributes|@count gt 1}
|
||||
<button type="button" class="btn btn-default check_all_warehouse" value="check_warehouse_{$warehouse['id_warehouse']}"><i class="icon-check-sign"></i> {l s='Mark / Unmark all product combinations as stored in this warehouse'}</button>
|
||||
<!--<tr>
|
||||
<td><input type="checkbox" class="check_all_warehouse" value="check_warehouse_{$warehouse['id_warehouse']}" /></td>
|
||||
<td colspan="2"><i></i></td>
|
||||
</tr>-->
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -108,39 +108,39 @@ $(function() {
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if isset($products) && $products}
|
||||
{if isset($num_products) && $num_products}
|
||||
<div class="panel">
|
||||
<h3>
|
||||
{if $products|@count == 1}
|
||||
{if $num_products == 1}
|
||||
{l s='1 product'}
|
||||
{else}
|
||||
{l s='%d products' sprintf=$products|@count}
|
||||
{l s='%d products' sprintf=$num_products}
|
||||
{/if}
|
||||
</h3>
|
||||
{$products}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if isset($customers) && $customers}
|
||||
{if isset($num_customers) && $num_customers}
|
||||
<div class="panel">
|
||||
<h3>
|
||||
{if $customers|@count == 1}
|
||||
{if $num_customers == 1}
|
||||
{l s='1 customer'}
|
||||
{else}
|
||||
{l s='%d customers' sprintf=$customers|@count}
|
||||
{l s='%d customers' sprintf=$num_customers}
|
||||
{/if}
|
||||
</h3>
|
||||
{$customers}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if isset($orders) && $orders}
|
||||
{if isset($num_orders) && $num_orders}
|
||||
<div class="panel">
|
||||
<h3>
|
||||
{if $orders|@count == 1}
|
||||
{if $num_orders == 1}
|
||||
{l s='1 order'}
|
||||
{else}
|
||||
{l s='%d orders' sprintf=$orders|@count}
|
||||
{l s='%d orders' sprintf=$num_orders}
|
||||
{/if}
|
||||
</h3>
|
||||
{$orders}
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{* <div class="form-group">
|
||||
<label for="id_manufacturer" class="control-label col-lg-3">{l s='Manufacturer'}</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="col-lg-8">
|
||||
@@ -68,8 +68,8 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
</div> *}
|
||||
{* <div class="form-group">
|
||||
<label for="id_supplier" class="control-label col-lg-3">{l s='Supplier'}</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="col-lg-8">
|
||||
@@ -85,8 +85,8 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
</div> *}
|
||||
{* <div class="form-group">
|
||||
<label for="id_attribute_group" class="control-label col-lg-3">{l s='Attributes'}</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="col-lg-4">
|
||||
@@ -111,7 +111,7 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> *}
|
||||
<div class="form-group">
|
||||
<label for="id_feature" class="control-label col-lg-3">{l s='Features'}</label>
|
||||
<div class="col-lg-9">
|
||||
|
||||
@@ -763,6 +763,7 @@
|
||||
id="{if isset($input.id)}{$input.id}{else}{$input.name}{/if}"
|
||||
type="text"
|
||||
data-hex="true"
|
||||
{if isset($input.autocomplete) && !$input.autocomplete} autocomplete="off"{/if}
|
||||
{if isset($input.class)} class="{$input.class}"
|
||||
{else}class="datepicker"{/if}
|
||||
name="{$input.name}"
|
||||
@@ -779,6 +780,7 @@
|
||||
id="{if isset($input.id)}{$input.id}{else}{$input.name}{/if}"
|
||||
type="text"
|
||||
data-hex="true"
|
||||
{if isset($input.autocomplete) && !$input.autocomplete} autocomplete="off"{/if}
|
||||
{if isset($input.class)} class="{$input.class}"
|
||||
{else} class="datetimepicker"{/if}
|
||||
name="{$input.name}"
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
</td>
|
||||
{/if}
|
||||
{foreach $fields_display AS $key => $params}
|
||||
{if isset($params.displayed) && $params.displayed === false}{continue}{/if}
|
||||
{block name="open_td"}
|
||||
<td
|
||||
{if isset($params.position)}
|
||||
@@ -47,12 +48,14 @@
|
||||
class="{strip}{if !$no_link}pointer{/if}
|
||||
{if isset($params.position) && $order_by == 'position' && $order_way != 'DESC'} dragHandle{/if}
|
||||
{if isset($params.class)} {$params.class}{/if}
|
||||
{if isset($params.align)} {$params.align}{/if}{/strip}"
|
||||
{if isset($params.align)} {$params.align}{/if}
|
||||
{if isset($params.optional) && $params.optional} field_optional{/if}{/strip}"
|
||||
{if (!isset($params.position) && !$no_link && !isset($params.remove_onclick))}
|
||||
onclick="document.location = '{$current_index|escape:'html':'UTF-8'}&{$identifier|escape:'html':'UTF-8'}={$tr.$identifier|escape:'html':'UTF-8'}{if $view}&view{else}&update{/if}{$table|escape:'html':'UTF-8'}{if $page > 1}&page={$page|intval}{/if}&token={$token|escape:'html':'UTF-8'}'">
|
||||
onclick="document.location = '{$current_index|escape:'html':'UTF-8'}&{$identifier|escape:'html':'UTF-8'}={$tr.$identifier|escape:'html':'UTF-8'}{if $view}&view{else}&update{/if}{$table|escape:'html':'UTF-8'}{if $page > 1}&page={$page|intval}{/if}&token={$token|escape:'html':'UTF-8'}'"
|
||||
{else}
|
||||
>
|
||||
{/if}
|
||||
{/if}
|
||||
data-key="{$key}"
|
||||
>
|
||||
{/block}
|
||||
{block name="td_content"}
|
||||
{if isset($params.prefix)}{$params.prefix}{/if}
|
||||
|
||||
@@ -121,45 +121,105 @@
|
||||
<input type="hidden" name="page" value="{$page|intval}"/>
|
||||
<input type="hidden" name="selected_pagination" value="{$selected_pagination|intval}"/>
|
||||
{block name="override_form_extra"}{/block}
|
||||
<div class="panel col-lg-12">
|
||||
<div class="panel-heading">
|
||||
{if isset($icon)}<i class="{$icon}"></i> {/if}{if is_array($title)}{$title|end}{else}{$title}{/if}
|
||||
{if isset($toolbar_btn) && count($toolbar_btn) >0}
|
||||
<span class="badge">{$list_total}</span>
|
||||
<span class="panel-heading-action">
|
||||
{foreach from=$toolbar_btn item=btn key=k}
|
||||
{if $k != 'modules-list' && $k != 'back'}
|
||||
<a id="desc-{$table}-{if isset($btn.imgclass)}{$btn.imgclass}{else}{$k}{/if}" class="list-toolbar-btn{if isset($btn.target) && $btn.target} _blank{/if}"{if isset($btn.href)} href="{$btn.href|escape:'html':'UTF-8'}"{/if}{if isset($btn.js) && $btn.js} onclick="{$btn.js}"{/if}>
|
||||
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="{l s=$btn.desc}" data-html="true" data-placement="top">
|
||||
<i class="process-icon-{if isset($btn.imgclass)}{$btn.imgclass}{else}{$k}{/if}{if isset($btn.class)} {$btn.class}{/if}"></i>
|
||||
</span>
|
||||
</a>
|
||||
{/if}
|
||||
{/foreach}
|
||||
<a class="list-toolbar-btn" href="javascript:location.reload();">
|
||||
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="{l s='Refresh list'}" data-html="true" data-placement="top">
|
||||
<i class="process-icon-refresh"></i>
|
||||
</span>
|
||||
</a>
|
||||
{if isset($sql) && $sql}
|
||||
{assign var=sql_manager value=Profile::getProfileAccess(Context::getContext()->employee->id_profile, Tab::getIdFromClassName('AdminRequestSql'))}
|
||||
<div class="panel col-lg-12">
|
||||
{block name="panel_heading"}
|
||||
<div class="panel-heading">
|
||||
{if isset($icon)}<i class="{$icon}"></i> {/if}{if is_array($title)}{$title|end}{else}{$title}{/if}
|
||||
{if isset($toolbar_btn) && count($toolbar_btn) >0}
|
||||
<span class="badge">{$list_total}</span>
|
||||
{block name="panel_heading_action"}
|
||||
<span class="panel-heading-action">
|
||||
{foreach from=$toolbar_btn item=btn key=k}
|
||||
{if $k != 'modules-list' && $k != 'back'}
|
||||
<a id="desc-{$table}-{if isset($btn.imgclass)}{$btn.imgclass}{else}{$k}{/if}" class="list-toolbar-btn{if isset($btn.target) && $btn.target} _blank{/if}"{if isset($btn.href)} href="{$btn.href|escape:'html':'UTF-8'}"{/if}{if isset($btn.js) && $btn.js} onclick="{$btn.js}"{/if}>
|
||||
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="{l s=$btn.desc}" data-html="true" data-placement="top">
|
||||
<i class="process-icon-{if isset($btn.imgclass)}{$btn.imgclass}{else}{$k}{/if}{if isset($btn.class)} {$btn.class}{/if}"></i>
|
||||
</span>
|
||||
</a>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{if $fields_optional|count}
|
||||
<a class="list-toolbar-btn dropdown-toggle" data-toggle="dropdown" data-target="#dropdown-option-toggle">
|
||||
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="{l s='Toggle list'}" data-html="true" data-placement="top">
|
||||
<i class="process-icon-cogs"></i>
|
||||
</a>
|
||||
<ul id="optional-list-toggle" class="dropdown-menu">
|
||||
{foreach $fields_optional as $key => $field}
|
||||
<li>
|
||||
<label>
|
||||
<input type="checkbox" name="list_fields_visibility" value="{$key}" {if isset($field['selected']) && $field['selected']}checked="checked"{/if}>
|
||||
{$field['title']}
|
||||
</label>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{/if}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
updateListVisibility();
|
||||
$('#optional-list-toggle').on('click', function(e) {
|
||||
e.stopPropagation();
|
||||
})
|
||||
$('input[name="list_fields_visibility"]').on('change', function(){
|
||||
updateListVisibility();
|
||||
})
|
||||
});
|
||||
function updateListVisibility() {
|
||||
var list_fields_visibility = [];
|
||||
$('input[name="list_fields_visibility"]:checked').each(function(i, field){
|
||||
list_fields_visibility.push($(field).val());
|
||||
});
|
||||
const table = $('table.table.{$table}');
|
||||
$(table).find('.field_optional').hide();
|
||||
$(table).find('.field_optional').each(function(i, val) {
|
||||
if (list_fields_visibility.includes($(this).data('key'))) {
|
||||
$(this).show();
|
||||
}
|
||||
});
|
||||
|
||||
{if $sql_manager.view == 1}
|
||||
<a class="list-toolbar-btn" href="javascript:void(0);" onclick="$('.leadin').first().append('<div class=\'alert alert-info\'>' + $('#sql_query_{$list_id|escape:'html':'UTF-8'}').val() + '</div>'); $(this).attr('onclick', '');">
|
||||
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Show SQL query'}" data-html="true" data-placement="top" >
|
||||
<i class="process-icon-terminal"></i>
|
||||
</span>
|
||||
</a>
|
||||
<a class="list-toolbar-btn" href="javascript:void(0);" onclick="$('#sql_name_{$list_id|escape:'html':'UTF-8'}').val(createSqlQueryName()); $('#sql_query_{$list_id|escape:'html':'UTF-8'}').val($('#sql_query_{$list_id|escape:'html':'UTF-8'}').val().replace(/\s+limit\s+[0-9,\s]+$/ig, '').trim()); $('#sql_form_{$list_id|escape:'html':'UTF-8'}').submit();">
|
||||
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Export to SQL Manager'}" data-html="true" data-placement="top" >
|
||||
<i class="process-icon-database"></i>
|
||||
</span>
|
||||
</a>
|
||||
{/if}
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
headers: { "cache-control": "no-cache" },
|
||||
url: '{$action}',
|
||||
data: {
|
||||
ajax: 1,
|
||||
action: 'updateListVisivility',
|
||||
list_fields_visibility: list_fields_visibility
|
||||
},
|
||||
cache: false,
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<a class="list-toolbar-btn" href="javascript:location.reload();">
|
||||
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="{l s='Refresh list'}" data-html="true" data-placement="top">
|
||||
<i class="process-icon-refresh"></i>
|
||||
</span>
|
||||
</a>
|
||||
{if isset($sql) && $sql}
|
||||
{assign var=sql_manager value=Profile::getProfileAccess(Context::getContext()->employee->id_profile, Tab::getIdFromClassName('AdminRequestSql'))}
|
||||
|
||||
{if $sql_manager.view == 1}
|
||||
<a class="list-toolbar-btn" href="javascript:void(0);" onclick="$('.leadin').first().append('<div class=\'alert alert-info\'>' + $('#sql_query_{$list_id|escape:'html':'UTF-8'}').val() + '</div>'); $(this).attr('onclick', '');">
|
||||
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Show SQL query'}" data-html="true" data-placement="top" >
|
||||
<i class="process-icon-terminal"></i>
|
||||
</span>
|
||||
</a>
|
||||
<a class="list-toolbar-btn" href="javascript:void(0);" onclick="$('#sql_name_{$list_id|escape:'html':'UTF-8'}').val(createSqlQueryName()); $('#sql_query_{$list_id|escape:'html':'UTF-8'}').val($('#sql_query_{$list_id|escape:'html':'UTF-8'}').val().replace(/\s+limit\s+[0-9,\s]+$/ig, '').trim()); $('#sql_form_{$list_id|escape:'html':'UTF-8'}').submit();">
|
||||
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Export to SQL Manager'}" data-html="true" data-placement="top" >
|
||||
<i class="process-icon-database"></i>
|
||||
</span>
|
||||
</a>
|
||||
{/if}
|
||||
{/if}
|
||||
</span>
|
||||
{/block}
|
||||
{/if}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{if $show_toolbar}
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
@@ -235,6 +295,7 @@
|
||||
<style>
|
||||
@media (max-width: 992px) {
|
||||
{foreach from=$fields_display item=param name=params}
|
||||
{if isset($params.displayed) && $params.displayed === false}{continue}{/if}
|
||||
.table-responsive-row td:nth-of-type({math equation="x+y" x=$smarty.foreach.params.index y=$y}):before {
|
||||
content: "{$param.title}";
|
||||
}
|
||||
@@ -246,12 +307,14 @@
|
||||
<div class="table-responsive-row clearfix{if isset($use_overflow) && $use_overflow} overflow-y{/if}">
|
||||
<table{if $table_id} id="table-{$table_id}"{/if} class="table{if $table_dnd} tableDnD{/if} {$table}" >
|
||||
<thead>
|
||||
{block name="tableHeadings"}
|
||||
<tr class="nodrag nodrop">
|
||||
{if $bulk_actions && $has_bulk_actions}
|
||||
<th class="center fixed-width-xs"></th>
|
||||
{/if}
|
||||
{foreach $fields_display AS $key => $params}
|
||||
<th class="{if isset($params.class)}{$params.class}{/if}{if isset($params.align)} {$params.align}{/if}">
|
||||
{if isset($params.displayed) && $params.displayed === false}{continue}{/if}
|
||||
<th class="{if isset($params.optional) && $params.optional}field_optional{/if}{if isset($params.class)} {$params.class}{/if}{if isset($params.align)} {$params.align}{/if}" data-key="{$key}">
|
||||
<span class="title_box{if isset($order_by) && ($key == $order_by)} active{/if}">
|
||||
{if isset($params.hint)}
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
@@ -299,94 +362,144 @@
|
||||
<th>{if !$simple_header}{/if}</th>
|
||||
{/if}
|
||||
</tr>
|
||||
{if !$simple_header && $show_filters}
|
||||
<tr class="nodrag nodrop filter {if $row_hover}row_hover{/if}">
|
||||
{if $has_bulk_actions}
|
||||
<th class="text-center">
|
||||
--
|
||||
</th>
|
||||
{/if}
|
||||
{* Filters (input, select, date or bool) *}
|
||||
{foreach $fields_display AS $key => $params}
|
||||
<th {if isset($params.align)} class="{$params.align}" {/if}>
|
||||
{if isset($params.search) && !$params.search}
|
||||
{/block}
|
||||
{block name="tableFilter"}
|
||||
{if !$simple_header && $show_filters}
|
||||
<tr class="nodrag nodrop filter {if $row_hover}row_hover{/if}">
|
||||
{if $has_bulk_actions}
|
||||
<th class="text-center">
|
||||
--
|
||||
{else}
|
||||
{if $params.type == 'bool'}
|
||||
<select class="filter fixed-width-sm center" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}">
|
||||
<option value="">-</option>
|
||||
<option value="1" {if $params.value == 1} selected="selected" {/if}>{l s='Yes'}</option>
|
||||
<option value="0" {if $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option>
|
||||
</select>
|
||||
{elseif $params.type == 'date' || $params.type == 'datetime'}
|
||||
<div class="date_range row">
|
||||
<div class="input-group fixed-width-md center">
|
||||
<input type="text" class="filter datepicker date-input form-control" id="local_{$params.id_date}_0" name="local_{$params.name_date}[0]" placeholder="{l s='From'}" />
|
||||
<input type="hidden" id="{$params.id_date}_0" name="{$params.name_date}[0]" value="{if isset($params.value.0)}{$params.value.0}{/if}">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon-calendar"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="input-group fixed-width-md center">
|
||||
<input type="text" class="filter datepicker date-input form-control" id="local_{$params.id_date}_1" name="local_{$params.name_date}[1]" placeholder="{l s='To'}" />
|
||||
<input type="hidden" id="{$params.id_date}_1" name="{$params.name_date}[1]" value="{if isset($params.value.1)}{$params.value.1}{/if}">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon-calendar"></i>
|
||||
</span>
|
||||
</div>
|
||||
<script>
|
||||
$(function() {
|
||||
var dateStart = parseDate($("#{$params.id_date}_0").val());
|
||||
var dateEnd = parseDate($("#{$params.id_date}_1").val());
|
||||
$("#local_{$params.id_date}_0").datepicker("option", "altField", "#{$params.id_date}_0");
|
||||
$("#local_{$params.id_date}_1").datepicker("option", "altField", "#{$params.id_date}_1");
|
||||
if (dateStart !== null){
|
||||
$("#local_{$params.id_date}_0").datepicker("setDate", dateStart);
|
||||
}
|
||||
if (dateEnd !== null){
|
||||
$("#local_{$params.id_date}_1").datepicker("setDate", dateEnd);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
{elseif $params.type == 'select'}
|
||||
{if isset($params.filter_key)}
|
||||
<select class="filter{if isset($params.align) && $params.align == 'center'}center{/if}" onchange="$('#submitFilterButton{$list_id}').focus();$('#submitFilterButton{$list_id}').click();" name="{$list_id}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
|
||||
<option value="" {if $params.value == ''} selected="selected" {/if}>-</option>
|
||||
{if isset($params.list) && is_array($params.list)}
|
||||
{foreach $params.list AS $option_value => $option_display}
|
||||
<option value="{$option_value}" {if (string)$option_display === (string)$params.value || (string)$option_value === (string)$params.value} selected="selected"{/if}>{$option_display}</option>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</select>
|
||||
{/if}
|
||||
</th>
|
||||
{/if}
|
||||
{* Filters (input, select, date or bool) *}
|
||||
{foreach $fields_display AS $key => $params}
|
||||
{if isset($params.displayed) && $params.displayed === false}{continue}{/if}
|
||||
<th class="{if isset($params.optional) && $params.optional}field_optional{/if}{if isset($params.align)} {$params.align}{/if}" data-key="{$key}">
|
||||
{if isset($params.search) && !$params.search}
|
||||
--
|
||||
{else}
|
||||
<input type="text" class="filter" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" value="{$params.value|escape:'html':'UTF-8'}" {if isset($params.width) && $params.width != 'auto'} style="width:{$params.width}px"{/if} />
|
||||
{/if}
|
||||
{/if}
|
||||
</th>
|
||||
{/foreach}
|
||||
{if $params.type == 'range'}
|
||||
<div class="input_range">
|
||||
<input type="text" class="filter form-control" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}[0]" placeholder="{l s='From'}" value="{if isset($params.value.0)}{$params.value.0}{/if}">
|
||||
<input type="text" class="filter form-control" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}[1]" placeholder="{l s='To'}" value="{if isset($params.value.1)}{$params.value.1}{/if}">
|
||||
</div>
|
||||
{else if $params.type == 'bool'}
|
||||
<select class="filter fixed-width-sm center" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}">
|
||||
<option value="">-</option>
|
||||
<option value="1" {if $params.value == 1} selected="selected" {/if}>{l s='Yes'}</option>
|
||||
<option value="0" {if $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option>
|
||||
</select>
|
||||
{elseif $params.type == 'date' || $params.type == 'datetime'}
|
||||
<div class="date_range row">
|
||||
<div class="input-group fixed-width-md center">
|
||||
<input type="text" class="filter datepicker date-input form-control" id="local_{$params.id_date}_0" name="local_{$params.name_date}[0]" placeholder="{l s='From'}" />
|
||||
<input type="hidden" id="{$params.id_date}_0" name="{$params.name_date}[0]" value="{if isset($params.value.0)}{$params.value.0}{/if}">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon-calendar"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="input-group fixed-width-md center">
|
||||
<input type="text" class="filter datepicker date-input form-control" id="local_{$params.id_date}_1" name="local_{$params.name_date}[1]" placeholder="{l s='To'}" />
|
||||
<input type="hidden" id="{$params.id_date}_1" name="{$params.name_date}[1]" value="{if isset($params.value.1)}{$params.value.1}{/if}">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon-calendar"></i>
|
||||
</span>
|
||||
</div>
|
||||
<script>
|
||||
$(function() {
|
||||
var dateStart = parseDate($("#{$params.id_date}_0").val());
|
||||
var dateEnd = parseDate($("#{$params.id_date}_1").val());
|
||||
$("#local_{$params.id_date}_0").datepicker("option", "altField", "#{$params.id_date}_0");
|
||||
$("#local_{$params.id_date}_1").datepicker("option", "altField", "#{$params.id_date}_1");
|
||||
if (dateStart !== null){
|
||||
$("#local_{$params.id_date}_0").datepicker("setDate", dateStart);
|
||||
}
|
||||
if (dateEnd !== null){
|
||||
$("#local_{$params.id_date}_1").datepicker("setDate", dateEnd);
|
||||
}
|
||||
|
||||
{if $shop_link_type}
|
||||
<th>--</th>
|
||||
{/if}
|
||||
{if $has_actions || $show_filters}
|
||||
<th class="actions">
|
||||
{if $show_filters}
|
||||
<span class="pull-right">
|
||||
{*Search must be before reset for default form submit*}
|
||||
<button type="submit" id="submitFilterButton{$list_id}" name="submitFilter" class="btn btn-default" data-list-id="{$list_id}">
|
||||
<i class="icon-search"></i> {l s='Search'}
|
||||
</button>
|
||||
{if $filters_has_value}
|
||||
<button type="submit" name="submitReset{$list_id}" class="btn btn-warning">
|
||||
<i class="icon-eraser"></i> {l s='Reset'}
|
||||
</button>
|
||||
$('#local_{$params.id_date}_0').datepicker('option', {
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
dateFormat: 'yy-mm-dd',
|
||||
beforeShow: function() {
|
||||
let dateTo = $('#local_{$params.id_date}_1').val().trim();
|
||||
if (typeof dateTo != 'undefined' && dateTo != '') {
|
||||
let objDateToMax = $.datepicker.parseDate('yy-mm-dd', dateTo);
|
||||
objDateToMax.setDate(objDateToMax.getDate() - 1);
|
||||
$('#local_{$params.id_date}_0').datepicker('option', 'maxDate', objDateToMax);
|
||||
}
|
||||
},
|
||||
onClose: function() {
|
||||
let dateFrom = $('#local_{$params.id_date}_0').val().trim();
|
||||
let dateTo = $('#local_{$params.id_date}_1').val().trim();
|
||||
|
||||
if (dateFrom >= dateTo) {
|
||||
let objDateToMin = $.datepicker.parseDate('yy-mm-dd', dateFrom);
|
||||
objDateToMin.setDate(objDateToMin.getDate() + 1);
|
||||
|
||||
$('#local_{$params.id_date}_1').datepicker('option', 'minDate', objDateToMin);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
$('#local_{$params.id_date}_1').datepicker('option', {
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
dateFormat: 'yy-mm-dd',
|
||||
beforeShow: function() {
|
||||
let dateFrom = $('#local_{$params.id_date}_0').val().trim();
|
||||
|
||||
if (typeof dateFrom != 'undefined' && dateFrom != '') {
|
||||
let objDateToMin = $.datepicker.parseDate('yy-mm-dd', dateFrom);
|
||||
objDateToMin.setDate(objDateToMin.getDate() + 1);
|
||||
|
||||
$('#local_{$params.id_date}_1').datepicker('option', 'minDate', objDateToMin);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
{elseif $params.type == 'select'}
|
||||
{if isset($params.filter_key)}
|
||||
<select class="filter{if isset($params.align) && $params.align == 'center'}center{/if}" onchange="$('#submitFilterButton{$list_id}').focus();$('#submitFilterButton{$list_id}').click();" name="{$list_id}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
|
||||
<option value="" {if $params.value == ''} selected="selected" {/if}>-</option>
|
||||
{if isset($params.list) && is_array($params.list)}
|
||||
{foreach $params.list AS $option_value => $option_display}
|
||||
<option value="{$option_value}" {if (string)$option_display === (string)$params.value || (string)$option_value === (string)$params.value} selected="selected"{/if}>{$option_display}</option>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</select>
|
||||
{/if}
|
||||
{else}
|
||||
<input type="text" class="filter" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" value="{$params.value|escape:'html':'UTF-8'}" {if isset($params.width) && $params.width != 'auto'} style="width:{$params.width}px"{/if} />
|
||||
{/if}
|
||||
{/if}
|
||||
</span>
|
||||
{/if}
|
||||
</th>
|
||||
{/if}
|
||||
</tr>
|
||||
{/if}
|
||||
</th>
|
||||
{/foreach}
|
||||
|
||||
{if $shop_link_type}
|
||||
<th>--</th>
|
||||
{/if}
|
||||
{if $has_actions || $show_filters}
|
||||
<th class="actions">
|
||||
{if $show_filters}
|
||||
<span class="pull-right">
|
||||
{*Search must be before reset for default form submit*}
|
||||
<button type="submit" id="submitFilterButton{$list_id}" name="submitFilter" class="btn btn-default" data-list-id="{$list_id}">
|
||||
<i class="icon-search"></i> {l s='Search'}
|
||||
</button>
|
||||
{if $filters_has_value}
|
||||
<button type="submit" name="submitReset{$list_id}" class="btn btn-warning">
|
||||
<i class="icon-eraser"></i> {l s='Reset'}
|
||||
</button>
|
||||
{/if}
|
||||
</span>
|
||||
{/if}
|
||||
</th>
|
||||
{/if}
|
||||
</tr>
|
||||
{/if}
|
||||
{/block}
|
||||
</thead>
|
||||
|
||||
102
admin/themes/default/template/helpers/tree/tree_hotels.tpl
Normal file
102
admin/themes/default/template/helpers/tree/tree_hotels.tpl
Normal file
@@ -0,0 +1,102 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<div class="panel">
|
||||
{if isset($header)}{$header}{/if}
|
||||
{if isset($nodes)}
|
||||
<ul id="{$id|escape:'html':'UTF-8'}" class="cattree tree">
|
||||
{$nodes}
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var currentToken="{$token|@addslashes}";
|
||||
{if isset($use_checkbox) && $use_checkbox == true}
|
||||
function checkAllAssociatedCategories($tree)
|
||||
{
|
||||
$tree.find(":input[type=checkbox]").each(
|
||||
function()
|
||||
{
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function uncheckAllAssociatedCategories($tree)
|
||||
{
|
||||
$tree.find(":input[type=checkbox]").each(
|
||||
function()
|
||||
{
|
||||
$(this).prop("checked", false);
|
||||
$(this).parent().removeClass("tree-selected");
|
||||
}
|
||||
);
|
||||
}
|
||||
{/if}
|
||||
{if isset($use_search) && $use_search == true}
|
||||
$("#{$id|escape:'html':'UTF-8'}-categories-search").bind("typeahead:selected", function(obj, datum) {
|
||||
$("#{$id|escape:'html':'UTF-8'}").find(":input").each(
|
||||
function()
|
||||
{
|
||||
if ($(this).val() == datum.id_category)
|
||||
{
|
||||
{if (!(isset($use_checkbox) && $use_checkbox == true))}
|
||||
$("#{$id|escape:'html':'UTF-8'} label").removeClass("tree-selected");
|
||||
{/if}
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents('ul.tree').each(function(){
|
||||
$(this).show();
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
{/if}
|
||||
$(document).ready(function () {
|
||||
$("#{$id|escape:'html':'UTF-8'}").tree("collapseAll");
|
||||
|
||||
{if isset($selected_categories)}
|
||||
{assign var=imploded_selected_categories value='","'|implode:$selected_categories}
|
||||
var selected_categories = new Array("{$imploded_selected_categories}");
|
||||
|
||||
$("#{$id|escape:'html':'UTF-8'}").find(":input").each(
|
||||
function()
|
||||
{
|
||||
if ($.inArray($(this).val(), selected_categories) != -1)
|
||||
{
|
||||
$(this).prop("checked", true);
|
||||
$(this).parent().addClass("tree-selected");
|
||||
$(this).parents('ul.tree').each(function(){
|
||||
$(this).show();
|
||||
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
{/if}
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,37 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<li class="tree-folder">
|
||||
<span class="tree-folder-name{if isset($node['disabled']) && $node['disabled'] == true} tree-folder-name-disable{/if}">
|
||||
{if isset($node['id_hotel'])}
|
||||
<input type="checkbox" class="select_hotel" name="{$input_name}[]" value="{$node['id_hotel']}"{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} />
|
||||
{* {if isset($node['id_category']) && $node['id_category'] != $root_category} *}
|
||||
{/if}
|
||||
<i class="icon-folder-close"></i>
|
||||
<label class="tree-toggler">{if isset($node['name'])}{$node['name']|escape:'html':'UTF-8'}{/if}{if isset($node['selected_childs']) && (int)$node['selected_childs'] > 0} {l s='(%s selected)' sprintf=$node['selected_childs']}{/if}</label>
|
||||
</span>
|
||||
<ul class="tree">
|
||||
{$children|escape:'UTF-8'}
|
||||
</ul>
|
||||
</li>
|
||||
@@ -0,0 +1,31 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<li class="tree-item{if isset($node['disabled']) && $node['disabled'] == true} tree-item-disable{/if}">
|
||||
<span class="tree-item-name{if isset($node['disabled']) && $node['disabled'] == true} tree-item-name-disable{/if}">
|
||||
<input type="checkbox" class="select_room_type" name="{$input_name}[]" value="{$node['id_product']}"{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} />
|
||||
<i class="tree-dot"></i>
|
||||
<label class="tree-toggler">{$node['room_type']}</label>
|
||||
</span>
|
||||
</li>
|
||||
@@ -23,68 +23,6 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
{$header}
|
||||
{if isset($conf)}
|
||||
<div class="bootstrap">
|
||||
<div class="alert alert-success">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
{$conf}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if count($errors) && current($errors) != '' && (!isset($disableDefaultErrorOutPut) || $disableDefaultErrorOutPut == false)}
|
||||
|
||||
<div class="bootstrap">
|
||||
<div class="alert alert-danger">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
{if count($errors) == 1}
|
||||
{reset($errors)}
|
||||
{else }
|
||||
{l s='%d errors' sprintf=$errors|count}
|
||||
<br/>
|
||||
<ol>
|
||||
{foreach $errors as $error}
|
||||
<li>{$error}</li>
|
||||
{/foreach}
|
||||
</ol>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($informations) && count($informations) && $informations}
|
||||
<div class="bootstrap">
|
||||
<div class="alert alert-info">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<ul id="infos_block" class="list-unstyled">
|
||||
{foreach $informations as $info}
|
||||
<li>{$info}</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($confirmations) && count($confirmations) && $confirmations}
|
||||
<div class="bootstrap">
|
||||
<div class="alert alert-success" style="display:block;">
|
||||
{foreach $confirmations as $conf}
|
||||
{$conf}
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if count($warnings)}
|
||||
<div class="bootstrap">
|
||||
<div class="alert alert-warning">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
{if count($warnings) > 1}
|
||||
<h4>{l s='There are %d warnings:' sprintf=count($warnings)}</h4>
|
||||
{/if}
|
||||
<ul class="list-unstyled">
|
||||
{foreach $warnings as $warning}
|
||||
<li>{$warning}</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{include file='./alerts.tpl'}
|
||||
{$page}
|
||||
{$footer}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div id="recommendation-wrapper-skeleton">
|
||||
<div id="recommendation-wrapper-skeleton" style="display:none">
|
||||
<script>
|
||||
loadRecommendation();
|
||||
</script>
|
||||
|
||||
@@ -1174,7 +1174,7 @@ abstract class AdminTabCore
|
||||
{
|
||||
/* Classical fields */
|
||||
foreach ($_POST as $key => $value) {
|
||||
if (array_key_exists($key, $object) && $key != 'id_'.$table) {
|
||||
if (property_exists($object, $key) && $key != 'id_'.$table) {
|
||||
/* Do not take care of password field if empty */
|
||||
if ($key == 'passwd' && Tools::getValue('id_'.$table) && empty($value)) {
|
||||
continue;
|
||||
|
||||
533
classes/Cart.php
533
classes/Cart.php
@@ -177,6 +177,14 @@ class CartCore extends ObjectModel
|
||||
const ONLY_PHYSICAL_PRODUCTS_WITHOUT_SHIPPING = 8;
|
||||
const ADVANCE_PAYMENT = 9;
|
||||
const ADVANCE_PAYMENT_ONLY_PRODUCTS = 10;
|
||||
const ONLY_ROOMS = 11;
|
||||
const ONLY_ROOM_SERVICES = 12;
|
||||
const ONLY_SERVICE_PRODUCTS = 13;
|
||||
|
||||
const ONLY_ROOM_SERVICES_WITHOUT_CONVENIENCE_FEE = 14;
|
||||
const ONLY_ROOM_SERVICES_WITHOUT_AUTO_ADD = 16;
|
||||
const ONLY_ROOM_SERVICES_WITH_AUTO_ADD_WITHOUT_CONVENIENCE_FEE = 17;
|
||||
const ONLY_CONVENIENCE_FEE = 18;
|
||||
|
||||
public function __construct($id = null, $id_lang = null)
|
||||
{
|
||||
@@ -334,7 +342,6 @@ class CartCore extends ObjectModel
|
||||
|
||||
foreach ($products as $product) {
|
||||
// products refer to the cart details
|
||||
|
||||
$address_id = Cart::getIdAddressForTaxCalculation($product['id_product']);
|
||||
if (!Address::addressExists($address_id)) {
|
||||
$address_id = null;
|
||||
@@ -525,7 +532,7 @@ class CartCore extends ObjectModel
|
||||
$sql = new DbQuery();
|
||||
|
||||
// Build SELECT
|
||||
$sql->select('cp.`id_product_attribute`, cp.`id_product`, cp.`quantity` AS cart_quantity, cp.id_shop, pl.`name`, p.`is_virtual`,
|
||||
$sql->select('cp.`id_product_attribute`, cp.`id_product`, cp.`quantity` AS cart_quantity, cp.id_shop, pl.`name`, p.`is_virtual`, p.`booking_product`, p.`service_product_type`, p.`auto_add_to_cart`, p.`price_addition_type`, product_shop.`allow_multiple_quantity`,
|
||||
pl.`description_short`, pl.`available_now`, pl.`available_later`, product_shop.`id_category_default`, p.`id_supplier`,
|
||||
p.`id_manufacturer`, product_shop.`on_sale`, product_shop.`ecotax`, product_shop.`additional_shipping_cost`,
|
||||
product_shop.`available_for_order`, product_shop.`price`, product_shop.`active`, product_shop.`unity`, product_shop.`unit_price_ratio`,
|
||||
@@ -735,18 +742,19 @@ class CartCore extends ObjectModel
|
||||
//
|
||||
/*By Webkul */
|
||||
|
||||
if (Module::isInstalled('hotelreservationsystem') && Module::isEnabled('hotelreservationsystem')) {
|
||||
require_once _PS_MODULE_DIR_.'hotelreservationsystem/define.php';
|
||||
// by webkul to calculate rates of the product from hotelreservation syatem tables with feature prices....
|
||||
$objCartBookingData = new HotelCartBookingData();
|
||||
$roomTypesByIdProduct = $objCartBookingData->getCartInfoIdCartIdProduct($this->id, (int)$row['id_product']);
|
||||
if ($row['booking_product']) {
|
||||
if (Module::isInstalled('hotelreservationsystem') && Module::isEnabled('hotelreservationsystem')) {
|
||||
require_once _PS_MODULE_DIR_.'hotelreservationsystem/define.php';
|
||||
// by webkul to calculate rates of the product from hotelreservation syatem tables with feature prices....
|
||||
$objCartBookingData = new HotelCartBookingData();
|
||||
$roomTypesByIdProduct = $objCartBookingData->getCartInfoIdCartIdProduct($this->id, (int)$row['id_product']);
|
||||
|
||||
// by webkul to calculate rates of the product from hotelreservation syatem tables with feature prices....
|
||||
$totalPriceByProductTaxIncl = 0;
|
||||
$totalPriceByProductTaxExcl = 0;
|
||||
$priceDisplay = Group::getPriceDisplayMethod(Group::getCurrent()->id);
|
||||
foreach ($roomTypesByIdProduct as $key => $cartRoomInfo) {
|
||||
$roomTotalPrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
|
||||
// by webkul to calculate rates of the product from hotelreservation syatem tables with feature prices....
|
||||
$totalPriceByProductTaxIncl = 0;
|
||||
$totalPriceByProductTaxExcl = 0;
|
||||
$priceDisplay = Group::getPriceDisplayMethod(Group::getCurrent()->id);
|
||||
foreach ($roomTypesByIdProduct as $key => $cartRoomInfo) {
|
||||
$roomTotalPrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
|
||||
$cartRoomInfo['id_product'],
|
||||
$cartRoomInfo['date_from'],
|
||||
$cartRoomInfo['date_to'],
|
||||
@@ -754,11 +762,35 @@ class CartCore extends ObjectModel
|
||||
Group::getCurrent()->id,
|
||||
$cartRoomInfo['id_cart'],
|
||||
$cartRoomInfo['id_guest'],
|
||||
$cartRoomInfo['id_room']
|
||||
$cartRoomInfo['id_room'],
|
||||
0
|
||||
);
|
||||
$totalPriceByProductTaxIncl += $roomTotalPrice['total_price_tax_incl'];
|
||||
$totalPriceByProductTaxExcl += $roomTotalPrice['total_price_tax_excl'];
|
||||
$totalPriceByProductTaxIncl += $roomTotalPrice['total_price_tax_incl'];
|
||||
$totalPriceByProductTaxExcl += $roomTotalPrice['total_price_tax_excl'];
|
||||
}
|
||||
|
||||
switch (Configuration::get('PS_ROUND_TYPE')) {
|
||||
case Order::ROUND_TOTAL:
|
||||
$row['total'] = $totalPriceByProductTaxExcl;
|
||||
$row['total_wt'] = $totalPriceByProductTaxIncl;
|
||||
break;
|
||||
case Order::ROUND_LINE:
|
||||
$row['total'] = Tools::ps_round($totalPriceByProductTaxExcl, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$row['total_wt'] = Tools::ps_round($totalPriceByProductTaxIncl, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
break;
|
||||
|
||||
case Order::ROUND_ITEM:
|
||||
default:
|
||||
$row['total'] = Tools::ps_round($totalPriceByProductTaxExcl, _PS_PRICE_COMPUTE_PRECISION_) * (int)$row['cart_quantity'];
|
||||
$row['total_wt'] = Tools::ps_round($totalPriceByProductTaxIncl, _PS_PRICE_COMPUTE_PRECISION_) * (int)$row['cart_quantity'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (Product::SERVICE_PRODUCT_WITH_ROOMTYPE == $row['service_product_type']) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
$totalPriceByProductTaxIncl = $objRoomTypeServiceProductCartDetail->getServiceProductsTotalInCart($this->id, (int)$row['id_product'], 0, 0, 0, 0, 0, true, null);
|
||||
$totalPriceByProductTaxExcl = $objRoomTypeServiceProductCartDetail->getServiceProductsTotalInCart($this->id, (int)$row['id_product'], 0, 0, 0, 0, 0, false, null);
|
||||
|
||||
|
||||
switch (Configuration::get('PS_ROUND_TYPE')) {
|
||||
case Order::ROUND_TOTAL:
|
||||
@@ -776,6 +808,29 @@ class CartCore extends ObjectModel
|
||||
$row['total_wt'] = Tools::ps_round($totalPriceByProductTaxIncl, _PS_PRICE_COMPUTE_PRECISION_) * (int)$row['cart_quantity'];
|
||||
break;
|
||||
}
|
||||
} 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);
|
||||
|
||||
switch (Configuration::get('PS_ROUND_TYPE'))
|
||||
{
|
||||
case Order::ROUND_TOTAL:
|
||||
$row['total'] = $unitPriceByProductTaxExcl * (int)$row['cart_quantity'];
|
||||
$row['total_wt'] = $unitPriceByProductTaxIncl * (int)$row['cart_quantity'];
|
||||
break;
|
||||
case Order::ROUND_LINE:
|
||||
$row['total'] = Tools::ps_round($unitPriceByProductTaxExcl * (int)$row['cart_quantity'], _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$row['total_wt'] = Tools::ps_round($unitPriceByProductTaxIncl * (int)$row['cart_quantity'], _PS_PRICE_COMPUTE_PRECISION_);
|
||||
break;
|
||||
|
||||
case Order::ROUND_ITEM:
|
||||
default:
|
||||
$row['total'] = Tools::ps_round($unitPriceByProductTaxExcl, _PS_PRICE_COMPUTE_PRECISION_) * (int)$row['cart_quantity'];
|
||||
$row['total_wt'] = Tools::ps_round($unitPriceByProductTaxIncl, _PS_PRICE_COMPUTE_PRECISION_) * (int)$row['cart_quantity'];
|
||||
break;
|
||||
}
|
||||
$row['price_wt'] = $row['price_with_reduction'];
|
||||
}
|
||||
|
||||
/*END*/
|
||||
@@ -808,6 +863,45 @@ class CartCore extends ObjectModel
|
||||
return $this->_products;
|
||||
}
|
||||
|
||||
public function getServiceProducts($productList = false)
|
||||
{
|
||||
if (!is_array($productList)) {
|
||||
$productList = $this->getProducts();
|
||||
}
|
||||
$serviceProducts = array();
|
||||
$context = Context::getContext();
|
||||
foreach ($productList as $key => $product) {
|
||||
if (!$product['booking_product'] && (Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE == $product['service_product_type'])) {
|
||||
if (Validate::isLoadedObject(
|
||||
$objProduct = new Product($product['id_product'], false, $this->id_lang)
|
||||
)) {
|
||||
// $address = Address::initialize($product['id_address_delivery']);
|
||||
// $product['id_hotel'] = $address->id_hotel;
|
||||
// $objHotelBranch = new HotelBranchInformation();
|
||||
// $product['hotel'] = $objHotelBranch->hotelBranchInfoById($product['id_hotel']);
|
||||
$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,
|
||||
$context->language->iso_code.'-default',
|
||||
'small_default'
|
||||
);
|
||||
}
|
||||
$product['cover_img'] = $coverImg;
|
||||
$serviceProducts[] = $product;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $serviceProducts;
|
||||
}
|
||||
|
||||
public static function cacheSomeAttributesLists($ipa_list, $id_lang)
|
||||
{
|
||||
if (!Combination::isFeatureActive()) {
|
||||
@@ -1036,7 +1130,7 @@ class CartCore extends ObjectModel
|
||||
|
||||
if ((int)$quantity <= 0) {
|
||||
return $this->deleteProduct($id_product, $id_product_attribute, (int)$id_customization, 0, $auto_add_cart_rule);
|
||||
} elseif (!$product->available_for_order || (Configuration::get('PS_CATALOG_MODE') && !defined('_PS_ADMIN_DIR_'))) {
|
||||
} elseif (Configuration::get('PS_CATALOG_MODE') && !defined('_PS_ADMIN_DIR_')) {
|
||||
return false;
|
||||
} else {
|
||||
/* Check if the product is already in the cart */
|
||||
@@ -1081,12 +1175,12 @@ class CartCore extends ObjectModel
|
||||
return -1;
|
||||
} else {
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'cart_product`
|
||||
SET `quantity` = `quantity` '.$qty.', `date_add` = NOW()
|
||||
WHERE `id_product` = '.(int)$id_product.
|
||||
UPDATE `'._DB_PREFIX_.'cart_product`
|
||||
SET `quantity` = `quantity` '.$qty.', `date_add` = NOW()
|
||||
WHERE `id_product` = '.(int)$id_product.
|
||||
(!empty($id_product_attribute) ? ' AND `id_product_attribute` = '.(int)$id_product_attribute : '').'
|
||||
AND `id_cart` = '.(int)$this->id.(Configuration::get('PS_ALLOW_MULTISHIPPING') && $this->isMultiAddressDelivery() ? ' AND `id_address_delivery` = '.(int)$id_address_delivery : '').'
|
||||
LIMIT 1'
|
||||
AND `id_cart` = '.(int)$this->id.(Configuration::get('PS_ALLOW_MULTISHIPPING') && $this->isMultiAddressDelivery() ? ' AND `id_address_delivery` = '.(int)$id_address_delivery : '').'
|
||||
LIMIT 1'
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1132,7 +1226,7 @@ class CartCore extends ObjectModel
|
||||
|
||||
// refresh cache of self::_products
|
||||
$this->_products = $this->getProducts(true);
|
||||
$this->update();
|
||||
$this->update(false);
|
||||
$context = Context::getContext()->cloneContext();
|
||||
$context->cart = $this;
|
||||
Cache::clean('getContextualValue_*');
|
||||
@@ -1504,6 +1598,13 @@ class CartCore extends ObjectModel
|
||||
$type = (int)$type;
|
||||
$array_type = array(
|
||||
Cart::ONLY_PRODUCTS,
|
||||
Cart::ONLY_ROOMS,
|
||||
Cart::ONLY_ROOM_SERVICES,
|
||||
Cart::ONLY_ROOM_SERVICES_WITHOUT_CONVENIENCE_FEE,
|
||||
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_DISCOUNTS,
|
||||
Cart::BOTH,
|
||||
Cart::BOTH_WITHOUT_SHIPPING,
|
||||
@@ -1561,7 +1662,7 @@ class CartCore extends ObjectModel
|
||||
$param_product = true;
|
||||
if (is_null($products)) {
|
||||
$param_product = false;
|
||||
$products = $this->getProducts();
|
||||
$products = $this->getProducts(false, false, null, false);
|
||||
}
|
||||
|
||||
if ($type == Cart::ONLY_PHYSICAL_PRODUCTS_WITHOUT_SHIPPING) {
|
||||
@@ -1583,8 +1684,57 @@ class CartCore extends ObjectModel
|
||||
$totalDemandsPrice = 0;
|
||||
$objCartBookingData = new HotelCartBookingData();
|
||||
foreach ($products as $product) {
|
||||
// products refer to the cart details
|
||||
// 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_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;
|
||||
}
|
||||
} else {
|
||||
if ($type == Cart::ONLY_ROOMS) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Product::SERVICE_PRODUCT_WITH_ROOMTYPE == $product['service_product_type']) {
|
||||
if ($type == Cart::ONLY_SERVICE_PRODUCTS) {
|
||||
continue;
|
||||
}
|
||||
if ($product['auto_add_to_cart']) {
|
||||
if ($type == Cart::ONLY_ROOM_SERVICES_WITHOUT_AUTO_ADD) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Product::PRICE_ADDITION_TYPE_WITH_ROOM == $product['price_addition_type']) {
|
||||
if ($type == Cart::ONLY_CONVENIENCE_FEE) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if ($type == Cart::ONLY_ROOM_SERVICES_WITHOUT_CONVENIENCE_FEE
|
||||
|| $type == Cart::ONLY_ROOM_SERVICES_WITH_AUTO_ADD_WITHOUT_CONVENIENCE_FEE
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if ($type == Cart::ONLY_CONVENIENCE_FEE
|
||||
|| $type == Cart::ONLY_ROOM_SERVICES_WITH_AUTO_ADD_WITHOUT_CONVENIENCE_FEE
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($type == Cart::ONLY_ROOM_SERVICES) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
// products refer to the cart details
|
||||
if ($virtual_context->shop->id != $product['id_shop']) {
|
||||
$virtual_context->shop = new Shop((int)$product['id_shop']);
|
||||
}
|
||||
@@ -1615,7 +1765,8 @@ class CartCore extends ObjectModel
|
||||
$null,
|
||||
$ps_use_ecotax,
|
||||
true,
|
||||
$virtual_context
|
||||
$virtual_context,
|
||||
false
|
||||
);
|
||||
|
||||
$address = $address_factory->findOrCreate($id_address, true);
|
||||
@@ -1635,62 +1786,92 @@ class CartCore extends ObjectModel
|
||||
$products_total[$id_tax_rules_group.'_'.$id_address] = 0;
|
||||
}
|
||||
|
||||
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_WITH_ROOMTYPE == $product['service_product_type']) {
|
||||
|
||||
// by webkul to calculate rates of the product from hotelreservation syatem tables with feature prices....
|
||||
$roomTypesByIdProduct = $objCartBookingData->getCartInfoIdCartIdProduct($this->id, $product['id_product']);
|
||||
|
||||
$totalPriceByProduct = 0;
|
||||
$priceDisplay = Group::getPriceDisplayMethod(Group::getCurrent()->id);
|
||||
foreach ($roomTypesByIdProduct as $key => $cartRoomInfo) {
|
||||
// get the real price of the room type
|
||||
$roomTotalPrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
|
||||
$cartRoomInfo['id_product'],
|
||||
$cartRoomInfo['date_from'],
|
||||
$cartRoomInfo['date_to'],
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
$totalPriceByProduct = $objRoomTypeServiceProductCartDetail->getServiceProductsTotalInCart(
|
||||
$this->id,
|
||||
(int)$product['id_product'],
|
||||
isset($product['id_hotel']) ? $product['id_hotel'] : 0,
|
||||
0,
|
||||
Group::getCurrent()->id,
|
||||
$cartRoomInfo['id_cart'],
|
||||
$cartRoomInfo['id_guest'],
|
||||
$cartRoomInfo['id_room']
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
$with_taxes,
|
||||
null
|
||||
);
|
||||
if ($with_taxes) {
|
||||
$totalPriceByProduct += $roomTotalPrice['total_price_tax_incl'];
|
||||
} else {
|
||||
$totalPriceByProduct += $roomTotalPrice['total_price_tax_excl'];
|
||||
}
|
||||
|
||||
// If customer has selected advance payment of the cart
|
||||
if ($type == Cart::ADVANCE_PAYMENT || $type == Cart::ADVANCE_PAYMENT_ONLY_PRODUCTS) {
|
||||
$objAdvPayment = new HotelAdvancedPayment();
|
||||
$advProductPrice = $objAdvPayment->getProductMinAdvPaymentAmountByIdCart(
|
||||
$this->id,
|
||||
} else if ($roomTypesByIdProduct = $objCartBookingData->getCartInfoIdCartIdProduct($this->id, $product['id_product'])) {
|
||||
// by webkul to calculate rates of the product from hotelreservation syatem tables with feature prices....
|
||||
$totalPriceByProduct = 0;
|
||||
$priceDisplay = Group::getPriceDisplayMethod(Group::getCurrent()->id);
|
||||
foreach ($roomTypesByIdProduct as $key => $cartRoomInfo) {
|
||||
// get the real price of the room type
|
||||
$roomTotalPrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
|
||||
$cartRoomInfo['id_product'],
|
||||
$cartRoomInfo['date_from'],
|
||||
$cartRoomInfo['date_to'],
|
||||
0,
|
||||
0,
|
||||
$with_taxes
|
||||
Group::getCurrent()->id,
|
||||
$cartRoomInfo['id_cart'],
|
||||
$cartRoomInfo['id_guest'],
|
||||
$cartRoomInfo['id_room'],
|
||||
0
|
||||
);
|
||||
if ($with_taxes) {
|
||||
$totalPriceByProduct += $roomTotalPrice['total_price_tax_incl'];
|
||||
} else {
|
||||
$totalPriceByProduct += $roomTotalPrice['total_price_tax_excl'];
|
||||
}
|
||||
|
||||
// set advance payment price only if it is greater than real price
|
||||
if ($advProductPrice < $totalPriceByProduct) {
|
||||
$totalPriceByProduct = $advProductPrice;
|
||||
// If customer has selected advance payment of the cart
|
||||
if ($type == Cart::ADVANCE_PAYMENT || $type == Cart::ADVANCE_PAYMENT_ONLY_PRODUCTS) {
|
||||
$objAdvPayment = new HotelAdvancedPayment();
|
||||
$advProductPrice = $objAdvPayment->getProductMinAdvPaymentAmountByIdCart(
|
||||
$this->id,
|
||||
$cartRoomInfo['id_product'],
|
||||
0,
|
||||
0,
|
||||
$with_taxes
|
||||
);
|
||||
|
||||
// set advance payment price only if it is greater than real price
|
||||
if ($advProductPrice < $totalPriceByProduct) {
|
||||
$totalPriceByProduct = $advProductPrice;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch ($ps_round_type) {
|
||||
case Order::ROUND_TOTAL:
|
||||
$products_total[$id_tax_rules_group.'_'.$id_address] += $totalPriceByProduct;
|
||||
if ($product['booking_product'] || (Product::SERVICE_PRODUCT_WITH_ROOMTYPE == $product['service_product_type'])) {
|
||||
$products_total[$id_tax_rules_group.'_'.$id_address] += $totalPriceByProduct;
|
||||
} else {
|
||||
$products_total[$id_tax_rules_group.'_'.$id_address] += $price * (int)$product['cart_quantity'];
|
||||
}
|
||||
break;
|
||||
|
||||
case Order::ROUND_LINE:
|
||||
$product_price = $totalPriceByProduct;
|
||||
if ($product['booking_product'] || (Product::SERVICE_PRODUCT_WITH_ROOMTYPE == $product['service_product_type'])) {
|
||||
$product_price = $totalPriceByProduct;
|
||||
} else {
|
||||
$product_price = $price * $product['cart_quantity'];
|
||||
}
|
||||
$products_total[$id_tax_rules_group] += Tools::ps_round($product_price, $compute_precision);
|
||||
break;
|
||||
|
||||
case Order::ROUND_ITEM:
|
||||
default:
|
||||
$product_price = $totalPriceByProduct;
|
||||
$products_total[$id_tax_rules_group] += Tools::ps_round($product_price, $compute_precision);
|
||||
if ($product['booking_product'] || (Product::SERVICE_PRODUCT_WITH_ROOMTYPE == $product['service_product_type'])) {
|
||||
$product_price = $totalPriceByProduct;
|
||||
$products_total[$id_tax_rules_group] += Tools::ps_round($product_price, $compute_precision);
|
||||
} else {
|
||||
$product_price = /*$with_taxes ? $tax_calculator->addTaxes($price) : */$price;
|
||||
$products_total[$id_tax_rules_group] += Tools::ps_round($product_price, $compute_precision) * (int)$product['cart_quantity'];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1732,7 +1913,19 @@ class CartCore extends ObjectModel
|
||||
$order_total_discount = 0;
|
||||
$order_shipping_discount = 0;
|
||||
$advance_payment_products_discount = 0;
|
||||
if (!in_array($type, array(Cart::ONLY_SHIPPING, Cart::ONLY_PRODUCTS, Cart::ADVANCE_PAYMENT_ONLY_PRODUCTS)) && CartRule::isFeatureActive()) {
|
||||
if (!in_array($type, array(
|
||||
Cart::ONLY_SHIPPING,
|
||||
Cart::ONLY_PRODUCTS,
|
||||
Cart::ONLY_ROOMS,
|
||||
Cart::ADVANCE_PAYMENT_ONLY_PRODUCTS,
|
||||
Cart::ONLY_ROOM_SERVICES,
|
||||
Cart::ONLY_SERVICE_PRODUCTS,
|
||||
Cart::ONLY_CONVENIENCE_FEE,
|
||||
Cart::ONLY_ROOM_SERVICES_WITHOUT_AUTO_ADD,
|
||||
Cart::ONLY_ROOM_SERVICES_WITHOUT_CONVENIENCE_FEE,
|
||||
Cart::ONLY_ROOM_SERVICES_WITH_AUTO_ADD_WITHOUT_CONVENIENCE_FEE)
|
||||
) && CartRule::isFeatureActive()
|
||||
) {
|
||||
// First, retrieve the cart rules associated to this "getOrderTotal"
|
||||
if ($with_shipping || $type == Cart::ONLY_DISCOUNTS) {
|
||||
$cart_rules = $this->getCartRules(CartRule::FILTER_ACTION_ALL);
|
||||
@@ -1794,7 +1987,9 @@ class CartCore extends ObjectModel
|
||||
}
|
||||
}
|
||||
}
|
||||
$order_total_discount = min(Tools::ps_round($order_total_discount, 2), (float)$order_total_products) + (float)$order_shipping_discount;
|
||||
if ($type != Cart::ADVANCE_PAYMENT) {
|
||||
$order_total_discount = min(Tools::ps_round($order_total_discount, 2), (float)$order_total_products) + (float)$order_shipping_discount;
|
||||
}
|
||||
if ($type == Cart::ADVANCE_PAYMENT) {
|
||||
// get order total without discount
|
||||
$total_without_discount = $this->getOrderTotal() + $order_total_discount;
|
||||
@@ -1916,7 +2111,7 @@ class CartCore extends ObjectModel
|
||||
return $cache[$cache_key];
|
||||
}
|
||||
|
||||
$product_list = $this->getProducts($flush);
|
||||
$product_list = $this->getProducts($flush, false, null, true);
|
||||
// Step 1 : Get product informations (warehouse_list and carrier_list), count warehouse
|
||||
// Determine the best warehouse to determine the packages
|
||||
// For that we count the number of time we can use a warehouse for a specific delivery address
|
||||
@@ -2146,42 +2341,163 @@ class CartCore extends ObjectModel
|
||||
|
||||
// Step 6 : Break $package_list hotel wise
|
||||
$orderPackage = array();
|
||||
$serviceProducts = 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) {
|
||||
$productInfo = $objRoomType->getRoomTypeInfoByIdProduct($product['id_product']);
|
||||
$idHotel = $productInfo['id_hotel'] ? $productInfo['id_hotel'] : 0;
|
||||
if ($product['booking_product']) {
|
||||
$productInfo = $objRoomType->getRoomTypeInfoByIdProduct($product['id_product']);
|
||||
$idHotel = $productInfo['id_hotel'] ? $productInfo['id_hotel'] : 0;
|
||||
|
||||
$orderPackage[$id_address][$idHotel]['product_list'][] = $product;
|
||||
if (!isset($orderPackage[$id_address][$idHotel]['carrier_list'])) {
|
||||
$orderPackage[$id_address][$idHotel]['carrier_list'] = $product['carrier_list'];
|
||||
$orderPackage[$id_address][$idHotel]['product_list'][] = $product;
|
||||
$orderPackage[$id_address][$idHotel]['id_hotel'] = $idHotel;
|
||||
if (!isset($orderPackage[$id_address][$idHotel]['id_hotel'])) {
|
||||
$orderPackage[$id_address][$idHotel]['id_hotel'] = $productInfo['id_hotel'];
|
||||
}
|
||||
if (!isset($orderPackage[$id_address][$idHotel]['carrier_list'])) {
|
||||
$orderPackage[$id_address][$idHotel]['carrier_list'] = $product['carrier_list'];
|
||||
} else {
|
||||
$orderPackage[$id_address][$idHotel]['carrier_list'] = array_intersect($orderPackage[$id_address][$idHotel]['carrier_list'], $product['carrier_list']);
|
||||
}
|
||||
if (!isset($orderPackage[$id_address][$idHotel]['warehouse_list'])) {
|
||||
$orderPackage[$id_address][$idHotel]['warehouse_list'] = $package['warehouse_list'];
|
||||
}
|
||||
if (!isset($orderPackage[$id_address][$idHotel]['id_warehouse'])) {
|
||||
$orderPackage[$id_address][$idHotel]['id_warehouse'] = $package['id_warehouse'];
|
||||
}
|
||||
if (isset($package['id_carrier'])) {
|
||||
if (!isset($orderPackage[$id_address][$idHotel]['id_carrier'])) {
|
||||
$orderPackage[$id_address][$idHotel]['id_carrier'] = $package['id_carrier'];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$orderPackage[$id_address][$idHotel]['carrier_list'] = array_intersect($orderPackage[$id_address][$idHotel]['carrier_list'], $product['carrier_list']);
|
||||
}
|
||||
if (!isset($orderPackage[$id_address][$idHotel]['warehouse_list'])) {
|
||||
$orderPackage[$id_address][$idHotel]['warehouse_list'] = $package['warehouse_list'];
|
||||
}
|
||||
if (!isset($orderPackage[$id_address][$idHotel]['id_warehouse'])) {
|
||||
$orderPackage[$id_address][$idHotel]['id_warehouse'] = $package['id_warehouse'];
|
||||
}
|
||||
if (isset($package['id_carrier'])) {
|
||||
if (!isset($orderPackage[$id_address][$idHotel]['id_carrier'])) {
|
||||
$orderPackage[$id_address][$idHotel]['id_carrier'] = $package['id_carrier'];
|
||||
if (Product::SERVICE_PRODUCT_WITH_ROOMTYPE == $product['service_product_type']) {
|
||||
if ($selectedServiceProducts = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart($this->id, $product['id_product'], 0, 0, 0, 0, 0, 0, null, null)) {
|
||||
$array = array();
|
||||
foreach($selectedServiceProducts as $selectedProduct) {
|
||||
if (isset($array[$selectedProduct['id_hotel']])) {
|
||||
$array[$selectedProduct['id_hotel']]['quantity'] += $selectedProduct['quantity'];
|
||||
} else {
|
||||
$array[$selectedProduct['id_hotel']] = array(
|
||||
'quantity' => $selectedProduct['quantity'],
|
||||
'id_hotel' => $selectedProduct['id_hotel']
|
||||
);
|
||||
}
|
||||
}
|
||||
foreach($array as $selectedProduct) {
|
||||
$product['cart_quantity'] = $selectedProduct['quantity'];
|
||||
$product['id_hotel'] = $selectedProduct['id_hotel'];
|
||||
$orderPackage[$id_address][$selectedProduct['id_hotel']]['product_list'][] = $product;
|
||||
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['id_hotel'])) {
|
||||
$orderPackage[$id_address][$selectedProduct['id_hotel']]['id_hotel'] = $selectedProduct['id_hotel'];
|
||||
}
|
||||
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['carrier_list'])) {
|
||||
$orderPackage[$id_address][$selectedProduct['id_hotel']]['carrier_list'] = $product['carrier_list'];
|
||||
} else {
|
||||
$orderPackage[$id_address][$selectedProduct['id_hotel']]['carrier_list'] = array_intersect($orderPackage[$id_address][$selectedProduct['id_hotel']]['carrier_list'], $product['carrier_list']);
|
||||
}
|
||||
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['warehouse_list'])) {
|
||||
$orderPackage[$id_address][$selectedProduct['id_hotel']]['warehouse_list'] = $package['warehouse_list'];
|
||||
}
|
||||
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['id_warehouse'])) {
|
||||
$orderPackage[$id_address][$selectedProduct['id_hotel']]['id_warehouse'] = $package['id_warehouse'];
|
||||
}
|
||||
if (isset($package['id_carrier'])) {
|
||||
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['id_carrier'])) {
|
||||
$orderPackage[$id_address][$selectedProduct['id_hotel']]['id_carrier'] = $package['id_carrier'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($selectedServiceProducts = $objHotelServiceProductCartDetail->getHotelProducts($this->id, $product
|
||||
['id_product'])) {
|
||||
foreach($selectedServiceProducts 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_wt'] = $unitPriceWt;
|
||||
// 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
|
||||
);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$hotelWisePackageList = array();
|
||||
$numHotels = 0;
|
||||
|
||||
|
||||
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) {
|
||||
$hotelWisePackageList[$id_address][] = $package;
|
||||
}
|
||||
}
|
||||
// add sevice products as new package if there are multiple hotels in cart
|
||||
// if ($numHotels > 1 || count($serviceProducts) > 1) {
|
||||
// foreach ($serviceProducts as $productsByAddress) {
|
||||
// if (isset($orderPackage[$id_address])) {
|
||||
// $hotelWisePackageList[$id_address][] = array(
|
||||
// 'product_list' => $productsByAddress['products'],
|
||||
// 'carrier_list' => $productsByAddress['carrier_list'],
|
||||
// 'warehouse_list' => $productsByAddress['warehouse_list'],
|
||||
// 'id_warehouse' => $productsByAddress['id_warehouse'],
|
||||
// 'id_carrier' => $productsByAddress['id_carrier']
|
||||
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// } else if (!empty($serviceProducts)) {
|
||||
// $serviceProductsIdAddress = array_keys($serviceProducts)[0];
|
||||
// $productsByAddress = array_shift($serviceProducts);
|
||||
// if (isset($hotelWisePackageList[$serviceProductsIdAddress])) {
|
||||
// $hotelWisePackageList[$serviceProductsIdAddress][0]['product_list'] = array_merge(
|
||||
// $hotelWisePackageList[$serviceProductsIdAddress][0]['product_list'],
|
||||
// $productsByAddress['products']
|
||||
// );
|
||||
// } else {
|
||||
// $hotelWisePackageList[$id_address][] = array(
|
||||
// 'product_list' => $productsByAddress['products'],
|
||||
// 'carrier_list' => $productsByAddress['carrier_list'],
|
||||
// 'warehouse_list' => $productsByAddress['warehouse_list'],
|
||||
// 'id_warehouse' => $productsByAddress['id_warehouse'],
|
||||
// 'id_carrier' => $productsByAddress['id_carrier']
|
||||
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
$final_package_list = $hotelWisePackageList;
|
||||
// END $package_list hotel wise
|
||||
|
||||
$cache[$cache_key] = $final_package_list;
|
||||
return $final_package_list;
|
||||
}
|
||||
@@ -2339,9 +2655,9 @@ class CartCore extends ObjectModel
|
||||
$best_price_carrier[$id_carrier]['product_list'] = array_merge($best_price_carrier[$id_carrier]['product_list'], $packages[$id_package]['product_list']);
|
||||
$best_price_carrier[$id_carrier]['instance'] = $carriers_instance[$id_carrier];
|
||||
$real_best_price = !isset($real_best_price) || $real_best_price > $carriers_price[$id_address][$id_package][$id_carrier]['with_tax'] ?
|
||||
$carriers_price[$id_address][$id_package][$id_carrier]['with_tax'] : $real_best_price;
|
||||
$carriers_price[$id_address][$id_package][$id_carrier]['with_tax'] : $real_best_price;
|
||||
$real_best_price_wt = !isset($real_best_price_wt) || $real_best_price_wt > $carriers_price[$id_address][$id_package][$id_carrier]['without_tax'] ?
|
||||
$carriers_price[$id_address][$id_package][$id_carrier]['without_tax'] : $real_best_price_wt;
|
||||
$carriers_price[$id_address][$id_package][$id_carrier]['without_tax'] : $real_best_price_wt;
|
||||
}
|
||||
|
||||
// Add the delivery option with best price as best price
|
||||
@@ -2711,9 +3027,15 @@ class CartCore extends ObjectModel
|
||||
return $collection;
|
||||
}
|
||||
|
||||
public static function getIdAddressForTaxCalculation($id_product)
|
||||
public static function getIdAddressForTaxCalculation($id_product, $id_hotel = false)
|
||||
{
|
||||
return HotelRoomType::getHotelIdAddressByIdProduct($id_product);
|
||||
if (Product::isBookingProduct($id_product)) {
|
||||
return HotelRoomType::getHotelIdAddressByIdProduct($id_product);
|
||||
} else if ($id_hotel) {
|
||||
$addressInfo = HotelBranchInformation::getAddress($id_hotel);
|
||||
return $addressInfo['id_address'];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3199,7 +3521,7 @@ class CartCore extends ObjectModel
|
||||
$module = Module::getInstanceByName($module_name);
|
||||
|
||||
if (Validate::isLoadedObject($module)) {
|
||||
if (array_key_exists('id_carrier', $module)) {
|
||||
if (property_exists($module, 'id_carrier')) {
|
||||
$module->id_carrier = $carrier->id;
|
||||
}
|
||||
if ($carrier->need_range) {
|
||||
@@ -3357,10 +3679,21 @@ class CartCore extends ObjectModel
|
||||
$total_shipping_tax_exc = $this->getTotalShippingCost(null, false);
|
||||
$total_products_wt = $this->getOrderTotal(true, Cart::ONLY_PRODUCTS);
|
||||
$total_products = $this->getOrderTotal(false, Cart::ONLY_PRODUCTS);
|
||||
$total_rooms_wt = $this->getOrderTotal(true, Cart::ONLY_ROOMS);
|
||||
$total_rooms = $this->getOrderTotal(false, Cart::ONLY_ROOMS);
|
||||
$total_additional_services_wt = $this->getOrderTotal(true, Cart::ONLY_ROOM_SERVICES_WITHOUT_AUTO_ADD);
|
||||
$total_additional_services = $this->getOrderTotal(false, Cart::ONLY_ROOM_SERVICES_WITHOUT_AUTO_ADD);
|
||||
$total_additional_services_auto_add_wt = $this->getOrderTotal(true, Cart::ONLY_ROOM_SERVICES_WITH_AUTO_ADD_WITHOUT_CONVENIENCE_FEE);
|
||||
$total_additional_services_auto_add = $this->getOrderTotal(false, Cart::ONLY_ROOM_SERVICES_WITH_AUTO_ADD_WITHOUT_CONVENIENCE_FEE);
|
||||
$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_discounts = $this->getOrderTotal(true, Cart::ONLY_DISCOUNTS);
|
||||
$total_discounts_tax_exc = $this->getOrderTotal(false, Cart::ONLY_DISCOUNTS);
|
||||
$objCartBookingData = new HotelCartBookingData();
|
||||
$totalDemandsWT = $objCartBookingData->getCartExtraDemands(
|
||||
$total_demands_wt = $objCartBookingData->getCartExtraDemands(
|
||||
$this->id,
|
||||
0,
|
||||
0,
|
||||
@@ -3370,7 +3703,7 @@ class CartCore extends ObjectModel
|
||||
0,
|
||||
1
|
||||
);
|
||||
$totalDemandsTaxExcl = $objCartBookingData->getCartExtraDemands(
|
||||
$total_demands = $objCartBookingData->getCartExtraDemands(
|
||||
$this->id,
|
||||
0,
|
||||
0,
|
||||
@@ -3408,6 +3741,15 @@ class CartCore extends ObjectModel
|
||||
$total_products_wt = Tools::ps_round($total_products_wt - $product['price_wt'], (int)$context->currency->decimals * _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$total_products = Tools::ps_round($total_products - $product['price'], (int)$context->currency->decimals * _PS_PRICE_COMPUTE_PRECISION_);
|
||||
|
||||
if ($product['is_virtual']) {
|
||||
$total_rooms_wt = Tools::ps_round($total_rooms_wt - $product['price_wt'], (int)$context->currency->decimals * _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$total_rooms = Tools::ps_round($total_rooms - $product['price'], (int)$context->currency->decimals * _PS_PRICE_COMPUTE_PRECISION_);
|
||||
} else {
|
||||
$total_normal_products_wt = Tools::ps_round($total_normal_products_wt - $product['price_wt'], (int)$context->currency->decimals * _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$total_normal_products = Tools::ps_round($total_normal_products - $product['price'], (int)$context->currency->decimals * _PS_PRICE_COMPUTE_PRECISION_);
|
||||
|
||||
}
|
||||
|
||||
// Update total discounts
|
||||
$total_discounts = Tools::ps_round($total_discounts - $product['price_wt'], (int)$context->currency->decimals * _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$total_discounts_tax_exc = Tools::ps_round($total_discounts_tax_exc - $product['price'], (int)$context->currency->decimals * _PS_PRICE_COMPUTE_PRECISION_);
|
||||
@@ -3465,8 +3807,19 @@ class CartCore extends ObjectModel
|
||||
'total_shipping_tax_exc' => $total_shipping_tax_exc,
|
||||
'total_products_wt' => $total_products_wt,
|
||||
'total_products' => $total_products,
|
||||
'total_extra_demands_wt' => $totalDemandsWT,
|
||||
'total_extra_demands_tax_exc' => $totalDemandsTaxExcl,
|
||||
'total_rooms_wt' => $total_rooms_wt,
|
||||
'total_rooms' => $total_rooms,
|
||||
'total_additional_services_wt' => $total_additional_services_wt,
|
||||
'total_additional_services' => $total_additional_services,
|
||||
'total_additional_services_auto_add_wt' => $total_additional_services_auto_add_wt,
|
||||
'total_additional_services_auto_add' => $total_additional_services_auto_add,
|
||||
'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_extra_demands_wt' => $total_demands_wt,
|
||||
'total_extra_demands' => $total_demands,
|
||||
'total_price' => $base_total_tax_inc,
|
||||
'total_tax' => $total_tax,
|
||||
'total_price_without_tax' => $base_total_tax_exc,
|
||||
|
||||
@@ -592,9 +592,9 @@ class CategoryCore extends ObjectModel
|
||||
SELECT c.*, cl.*
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
'.($use_shop_restriction ? Shop::addSqlAssociation('category', 'c') : '').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.`id_category` = cl.`id_category`'.Shop::addSqlRestrictionOnLang('cl').'
|
||||
'.(isset($groups) && Group::isFeatureActive() ? 'LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON c.`id_category` = cg.`id_category`' : '').'
|
||||
'.(isset($root_category) ? 'RIGHT JOIN `'._DB_PREFIX_.'category` c2 ON c2.`id_category` = '.(int)$root_category.' AND c.`nleft` >= c2.`nleft` AND c.`nright` <= c2.`nright`' : '').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.`id_category` = cl.`id_category`'.Shop::addSqlRestrictionOnLang('cl').''.(isset($groups) && Group::isFeatureActive() ? '
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON c.`id_category` = cg.`id_category`' : '').''.(isset($root_category) ? '
|
||||
RIGHT JOIN `'._DB_PREFIX_.'category` c2 ON c2.`id_category` = '.(int)$root_category.' AND c.`nleft` >= c2.`nleft` AND c.`nright` <= c2.`nright`' : '').'
|
||||
WHERE 1 '.$sql_filter.' '.($id_lang ? 'AND `id_lang` = '.(int)$id_lang : '').'
|
||||
'.($active ? ' AND c.`active` = 1' : '').'
|
||||
'.(isset($groups) && Group::isFeatureActive() ? ' AND cg.`id_group` IN ('.implode(',', $groups).')' : '').'
|
||||
@@ -723,10 +723,9 @@ class CategoryCore extends ObjectModel
|
||||
'.Shop::addSqlAssociation('product', 'p').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON p.`id_product` = cp.`id_product`
|
||||
WHERE cp.`id_category` = '.(int)$this->id.
|
||||
($front ? ' AND product_shop.`visibility` IN ("both", "catalog")' : '').
|
||||
($front ? ' AND product_shop.`show_at_front` = 1' : '').
|
||||
($active ? ' AND product_shop.`active` = 1' : '').
|
||||
($id_supplier ? 'AND p.id_supplier = '.(int)$id_supplier : '');
|
||||
|
||||
return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
|
||||
}
|
||||
|
||||
@@ -788,7 +787,7 @@ class CategoryCore extends ObjectModel
|
||||
WHERE product_shop.`id_shop` = '.(int)$context->shop->id.'
|
||||
AND cp.`id_category` = '.(int)$this->id
|
||||
.($active ? ' AND product_shop.`active` = 1' : '')
|
||||
.($front ? ' AND product_shop.`visibility` IN ("both", "catalog")' : '')
|
||||
.($front ? ' AND product_shop.`show_at_front` = 1' : '')
|
||||
.($id_supplier ? ' AND p.id_supplier = '.(int)$id_supplier : '');
|
||||
|
||||
if ($random === true) {
|
||||
@@ -911,6 +910,22 @@ class CategoryCore extends ObjectModel
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* check if current category is nested in $id_parent category
|
||||
*/
|
||||
public function hasParent($id_parent)
|
||||
{
|
||||
$id_category = $this->id;
|
||||
|
||||
$sql = 'SELECT c.`id_category`
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
'.Shop::addSqlAssociation('category', 'c').'
|
||||
WHERE c.`nleft` < ' .(int)$this->nleft. ' AND c.`nright` > ' .(int)$this->nright. '
|
||||
AND c.`id_category` = '.(int)$id_parent;
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of all children of the current category
|
||||
*
|
||||
|
||||
@@ -585,7 +585,7 @@ class CustomerCore extends ObjectModel
|
||||
WHERE c.`id_customer` = '.(int)$this->id);
|
||||
|
||||
$result['last_visit'] = $result2['last_visit'];
|
||||
$result['age'] = ($result3['age'] != date('Y') ? $result3['age'] : '--');
|
||||
$result['age'] = (isset($result3['age']) && $result3['age'] != date('Y') ? $result3['age'] : '--');
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ class PageCore extends ObjectModel
|
||||
FROM `'._DB_PREFIX_.'page`
|
||||
WHERE `id_page_type` = '.(int)$page_type_id.$where;
|
||||
$result = Db::getInstance()->getRow($sql);
|
||||
if ($result['id_page']) {
|
||||
if (isset($result['id_page']) && $result['id_page']) {
|
||||
return $result['id_page'];
|
||||
}
|
||||
|
||||
|
||||
@@ -268,7 +268,6 @@ abstract class PaymentModuleCore extends Module
|
||||
}
|
||||
|
||||
Hook::exec('actionPackageListGenerateOrder', array('package_list' => &$package_list));
|
||||
|
||||
foreach ($package_list as $id_address => $packageByAddress) {
|
||||
foreach ($packageByAddress as $id_package => $package) {
|
||||
/** @var Order $order */
|
||||
@@ -296,7 +295,9 @@ 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;
|
||||
$order->id_address_tax = (int)Cart::getIdAddressForTaxCalculation($order->product_list[0]['id_product']);
|
||||
$addressInfo = HotelBranchInformation::getAddress($package['id_hotel']);
|
||||
|
||||
$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;
|
||||
@@ -338,6 +339,7 @@ abstract class PaymentModuleCore extends Module
|
||||
|
||||
$order->total_paid_tax_excl = (float)Tools::ps_round((float)$this->context->cart->getOrderTotal(false, Cart::BOTH, $order->product_list, $id_carrier), _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$order->total_paid_tax_incl = (float)Tools::ps_round((float)$this->context->cart->getOrderTotal(true, Cart::BOTH, $order->product_list, $id_carrier), _PS_PRICE_COMPUTE_PRECISION_);
|
||||
|
||||
$order->total_paid = $order->total_paid_tax_incl;
|
||||
$order->round_mode = Configuration::get('PS_PRICE_ROUND_MODE');
|
||||
$order->round_type = Configuration::get('PS_ROUND_TYPE');
|
||||
@@ -360,11 +362,11 @@ abstract class PaymentModuleCore extends Module
|
||||
$order->with_occupancy = 0;
|
||||
} else {
|
||||
if (defined('_PS_ADMIN_DIR_')) {
|
||||
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
$order->with_occupancy = 1;
|
||||
}
|
||||
} else {
|
||||
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
$order->with_occupancy = 1;
|
||||
}
|
||||
}
|
||||
@@ -377,19 +379,23 @@ abstract class PaymentModuleCore extends Module
|
||||
(float)$this->context->cart->getOrderTotal(true, Cart::ADVANCE_PAYMENT, $order->product_list, $id_carrier),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$order->amount_paid = (float)Tools::ps_round(
|
||||
(($order->advance_paid_amount * $amount_paid) / $this->context->cart->getOrderTotal(true, Cart::ADVANCE_PAYMENT, null, $id_carrier)),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
if ($totalOrder = $this->context->cart->getOrderTotal(true, Cart::ADVANCE_PAYMENT, null, $id_carrier)) {
|
||||
$order->amount_paid = (float)Tools::ps_round(
|
||||
(($order->advance_paid_amount * $amount_paid) / $totalOrder),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$order->advance_paid_amount = (float)Tools::ps_round(
|
||||
(float)$this->context->cart->getOrderTotal(true, Cart::BOTH, $order->product_list, $id_carrier),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
$order->amount_paid = (float)Tools::ps_round(
|
||||
(($order->advance_paid_amount * $amount_paid) / $this->context->cart->getOrderTotal(true, Cart::BOTH, null, $id_carrier)),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
if ($orderTotal = $this->context->cart->getOrderTotal(true, Cart::BOTH, null, $id_carrier)) {
|
||||
$order->amount_paid = (float)Tools::ps_round(
|
||||
(($order->advance_paid_amount * $amount_paid) / $orderTotal),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Creating order
|
||||
@@ -537,8 +543,11 @@ abstract class PaymentModuleCore extends Module
|
||||
$virtual_product = true;
|
||||
|
||||
$product_var_tpl_list = array();
|
||||
$orderServiceProducts = array();
|
||||
$objProduct = new Product();
|
||||
|
||||
foreach ($order->product_list as $product) {
|
||||
$price = Product::getPriceStatic((int)$product['id_product'], false, ($product['id_product_attribute'] ? (int)$product['id_product_attribute'] : null), 6, null, false, true, $product['cart_quantity'], false, (int)$order->id_customer, (int)$order->id_cart);
|
||||
$price = Product::getPriceStatic((int)$product['id_product'], false, ($product['id_product_attribute'] ? (int)$product['id_product_attribute'] : null), 6, null, false, true, $product['cart_quantity'], false, (int)$order->id_customer, (int)$order->id_cart);
|
||||
$price_wt = Product::getPriceStatic((int)$product['id_product'], true, ($product['id_product_attribute'] ? (int)$product['id_product_attribute'] : null), 2, null, false, true, $product['cart_quantity'], false, (int)$order->id_customer, (int)$order->id_cart);
|
||||
|
||||
|
||||
@@ -589,6 +598,17 @@ abstract class PaymentModuleCore extends Module
|
||||
$idHotel = $roomDetail['id_hotel'];
|
||||
}
|
||||
}
|
||||
if (!$product['booking_product'] && $product['service_product_type'] == Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE) {
|
||||
$cover_image_arr = $objProduct->getCover($product['id_product']);
|
||||
|
||||
if (!empty($cover_image_arr)) {
|
||||
$cover_img = $this->context->link->getImageLink($product['link_rewrite'], $product['id_product'].'-'.$cover_image_arr['id_image'], 'small_default');
|
||||
} else {
|
||||
$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;
|
||||
}
|
||||
} // end foreach ($products)
|
||||
|
||||
$product_list_txt = '';
|
||||
@@ -758,7 +778,7 @@ abstract class PaymentModuleCore extends Module
|
||||
$vatAddress = new Address((int)$order->id_address_tax);
|
||||
|
||||
$idLang = (int)$this->context->cart->id_lang;
|
||||
|
||||
$normalProducts = array();
|
||||
foreach ($order->product_list as $product) {
|
||||
$objCartBookingData = new HotelCartBookingData();
|
||||
$idProduct = $product['id_product'];
|
||||
@@ -795,7 +815,8 @@ abstract class PaymentModuleCore extends Module
|
||||
Group::getCurrent()->id,
|
||||
$objCartBookingData->id_cart,
|
||||
$objCartBookingData->id_guest,
|
||||
$objCartBookingData->id_room
|
||||
$objCartBookingData->id_room,
|
||||
0
|
||||
);
|
||||
$objBookingDetail->date_from = $objCartBookingData->date_from;
|
||||
$objBookingDetail->date_to = $objCartBookingData->date_to;
|
||||
@@ -818,7 +839,7 @@ abstract class PaymentModuleCore extends Module
|
||||
$objBookingDetail->email = $objHotelBranch->email;
|
||||
$objBookingDetail->check_in_time = $objHotelBranch->check_in;
|
||||
$objBookingDetail->check_out_time = $objHotelBranch->check_out;
|
||||
if ($hotelAddress = $objHotelBranch->getAddress($objCartBookingData->id_hotel)) {
|
||||
if ($hotelAddress = HotelBranchInformation::getAddress($objCartBookingData->id_hotel)) {
|
||||
$objBookingDetail->city = $hotelAddress['city'];
|
||||
$objBookingDetail->state = $hotelAddress['state'];
|
||||
$objBookingDetail->country = $hotelAddress['country'];
|
||||
@@ -903,6 +924,51 @@ abstract class PaymentModuleCore extends Module
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$normalProducts[] = $product;
|
||||
}
|
||||
}
|
||||
if (!empty($normalProducts)) {
|
||||
$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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -970,11 +1036,64 @@ 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);
|
||||
|
||||
// total room price
|
||||
$room_price_tax_excl = $order->getTotalProductsWithoutTaxes(false, true);
|
||||
$room_price_tax_incl = $order->getTotalProductsWithTaxes(false, true);
|
||||
$room_tax = ($order->getTotalProductsWithTaxes(false, true) - $order->getTotalProductsWithoutTaxes(false, true));
|
||||
|
||||
// extra services
|
||||
$additional_service_price_tax_excl = ($order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $cart_booking_data['total_extra_demands_te']);
|
||||
$additional_service_price_tax_incl = ($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $cart_booking_data['total_extra_demands_ti']);
|
||||
$additional_service_tax = (($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $cart_booking_data['total_extra_demands_ti']) - ($order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $cart_booking_data['total_extra_demands_te']));
|
||||
|
||||
// convenience fee price
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
$total_convenience_fee_ti = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
Product::PRICE_ADDITION_TYPE_INDEPENDENT
|
||||
);
|
||||
$total_convenience_fee_te = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
Product::PRICE_ADDITION_TYPE_INDEPENDENT
|
||||
);
|
||||
$additional_service_price_tax_excl = $additional_service_price_tax_excl - $total_convenience_fee_te;
|
||||
$additional_service_price_tax_incl = $additional_service_price_tax_incl - $total_convenience_fee_ti;
|
||||
$room_price_tax_excl = $room_price_tax_excl + $additional_service_price_tax_excl;
|
||||
$room_price_tax_incl = $room_price_tax_incl + $additional_service_price_tax_incl;
|
||||
|
||||
// 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));
|
||||
|
||||
$data = array(
|
||||
'{cart_booking_data_html}' => $cart_booking_data_html,
|
||||
'{cart_booking_data_text}' => $cart_booking_data_text,
|
||||
'{extra_demands_details_html}' => $extra_demands_details_html,
|
||||
'{extra_demands_details_text}' => $extra_demands_details_text,
|
||||
'{normal_products_data_html}' => $normal_products_data_html,
|
||||
'{normal_products_data_txt}' => $normal_products_data_txt,
|
||||
'{total_extra_demands_te}' => Tools::displayPrice(
|
||||
$cart_booking_data['total_extra_demands_te'],
|
||||
$this->context->currency,
|
||||
@@ -1007,6 +1126,7 @@ abstract class PaymentModuleCore extends Module
|
||||
'{delivery_phone}' => ($delivery->phone) ? $delivery->phone : $delivery->phone_mobile,
|
||||
'{delivery_other}' => $delivery->other,
|
||||
'{invoice_company}' => $invoice->company,
|
||||
'{invoice_vat_number}' => $invoice->vat_number,
|
||||
'{invoice_firstname}' => $invoice->firstname,
|
||||
'{invoice_lastname}' => $invoice->lastname,
|
||||
'{invoice_address2}' => $invoice->address2,
|
||||
@@ -1030,7 +1150,20 @@ abstract class PaymentModuleCore extends Module
|
||||
'{total_discounts}' => Tools::displayPrice($order->total_discounts, $this->context->currency, false),
|
||||
'{total_shipping}' => Tools::displayPrice($order->total_shipping, $this->context->currency, false),
|
||||
'{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $this->context->currency, false),
|
||||
'{total_tax_paid}' => Tools::displayPrice(($order->total_products_wt - $order->total_products) + ($order->total_shipping_tax_incl - $order->total_shipping_tax_excl), $this->context->currency, false)
|
||||
// '{total_tax_paid}' => Tools::displayPrice(($order->total_products_wt - $order->total_products) + ($order->total_shipping_tax_incl - $order->total_shipping_tax_excl), $this->context->currency, false),
|
||||
'{total_tax_paid}' => Tools::displayPrice(($order->total_paid_tax_incl - $order->total_paid_tax_excl), $this->context->currency, false),
|
||||
// additional data
|
||||
'{room_price_tax_excl}' => Tools::displayPrice($room_price_tax_excl, $this->context->currency, false),
|
||||
'{room_price_tax_incl}' => Tools::displayPrice($room_price_tax_incl, $this->context->currency, false),
|
||||
'{room_tax}' => Tools::displayPrice($room_tax, $this->context->currency, false),
|
||||
// '{service_products_price_tax_excl}' => Tools::displayPrice($service_products_price_tax_excl, $this->context->currency, false),
|
||||
// '{service_products_price_tax_incl}' => Tools::displayPrice($service_products_price_tax_incl, $this->context->currency, false),
|
||||
// '{service_products_tax}' => Tools::displayPrice($service_products_tax, $this->context->currency, false),
|
||||
'{additional_service_price_tax_excl}' => Tools::displayPrice($additional_service_price_tax_excl, $this->context->currency, false),
|
||||
'{additional_service_price_tax_incl}' => Tools::displayPrice($additional_service_price_tax_incl, $this->context->currency, false),
|
||||
'{additional_service_tax}' => Tools::displayPrice($additional_service_tax, $this->context->currency, false),
|
||||
'{total_convenience_fee_ti}' => Tools::displayPrice($total_convenience_fee_ti, $this->context->currency, false),
|
||||
'{total_convenience_fee_te}' => Tools::displayPrice($total_convenience_fee_te, $this->context->currency, false),
|
||||
);
|
||||
|
||||
if (is_array($extra_vars)) {
|
||||
@@ -1416,8 +1549,11 @@ abstract class PaymentModuleCore extends Module
|
||||
$obj_htl_bk_dtl = new HotelBookingDetail();
|
||||
$obj_rm_type = new HotelRoomType();
|
||||
$objBookingDemand = new HotelBookingDemands();
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
$result['total_extra_demands_te'] = 0;
|
||||
$result['total_extra_demands_ti'] = 0;
|
||||
$result['total_additional_services_te'] =0;
|
||||
$result['total_additional_services_ti'] =0;
|
||||
$cart_htl_data = array();
|
||||
if (!empty($products)) {
|
||||
foreach ($products as $type_key => $type_value) {
|
||||
@@ -1436,100 +1572,200 @@ abstract class PaymentModuleCore extends Module
|
||||
} else {
|
||||
$cart_bk_data = $obj_htl_bk_dtl->getOnlyOrderBookingData($order->id, $customer->id_guest, $type_value['product_id']);
|
||||
}
|
||||
$rm_dtl = $obj_rm_type->getRoomTypeInfoByIdProduct($type_value['product_id']);
|
||||
if ($cart_bk_data) {
|
||||
$rm_dtl = $obj_rm_type->getRoomTypeInfoByIdProduct($type_value['product_id']);
|
||||
|
||||
$cart_htl_data[$type_key]['id_product'] = $type_value['product_id'];
|
||||
$cart_htl_data[$type_key]['cover_img'] = $cover_img;
|
||||
$cart_htl_data[$type_key]['name'] = $product->name;
|
||||
$cart_htl_data[$type_key]['hotel_name'] = $rm_dtl['hotel_name'];
|
||||
$cart_htl_data[$type_key]['id_product'] = $type_value['product_id'];
|
||||
$cart_htl_data[$type_key]['cover_img'] = $cover_img;
|
||||
$cart_htl_data[$type_key]['name'] = $product->name;
|
||||
$cart_htl_data[$type_key]['hotel_name'] = $rm_dtl['hotel_name'];
|
||||
|
||||
foreach ($cart_bk_data as $data_k => $data_v) {
|
||||
$date_join = strtotime($data_v['date_from']).strtotime($data_v['date_to']);
|
||||
foreach ($cart_bk_data as $data_k => $data_v) {
|
||||
$date_join = strtotime($data_v['date_from']).strtotime($data_v['date_to']);
|
||||
|
||||
if (isset($cart_htl_data[$type_key]['date_diff'][$date_join])) {
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['num_rm'] += 1;
|
||||
if (isset($cart_htl_data[$type_key]['date_diff'][$date_join])) {
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['num_rm'] += 1;
|
||||
|
||||
$num_days = $cart_htl_data[$type_key]['date_diff'][$date_join]['num_days'];
|
||||
$num_days = $cart_htl_data[$type_key]['date_diff'][$date_join]['num_days'];
|
||||
$vart_quant = (int)$cart_htl_data[$type_key]['date_diff'][$date_join]['num_rm'];
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['adults'] += $data_v['adults'];
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['children'] += $data_v['children'];
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['adults'] += $data_v['adults'];
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['children'] += $data_v['children'];
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_incl']/$num_days;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'];
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_incl'] += $data_v['total_price_tax_incl'];
|
||||
|
||||
// extra demands prices
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order->id,
|
||||
$type_value['product_id'],
|
||||
0,
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to']
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order->id,
|
||||
$type_value['product_id'],
|
||||
0,
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
0,
|
||||
1,
|
||||
0
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order->id,
|
||||
$type_value['product_id'],
|
||||
0,
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
0,
|
||||
1,
|
||||
1
|
||||
);
|
||||
} else {
|
||||
$num_days = $obj_htl_bk_dtl->getNumberOfDays($data_v['date_from'], $data_v['date_to']);
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['num_rm'] = 1;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['data_form'] = $data_v['date_from'];
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['data_to'] = $data_v['date_to'];
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['num_days'] = $num_days;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['adults'] = $data_v['adults'];
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['children'] = $data_v['children'];
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_incl']/$num_days;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] = $cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'];
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_incl'] = $data_v['total_price_tax_incl'];
|
||||
$roomTypeDateRangePrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice($type_value['id_product'], $data_v['date_from'], $data_v['date_to']);
|
||||
|
||||
// extra demands prices
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order->id,
|
||||
$type_value['product_id'],
|
||||
0,
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to']
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order->id,
|
||||
$type_value['product_id'],
|
||||
0,
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
0,
|
||||
1,
|
||||
0
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order->id,
|
||||
$type_value['product_id'],
|
||||
0,
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
0,
|
||||
1,
|
||||
1
|
||||
);
|
||||
$result['total_extra_demands_te'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'];
|
||||
$result['total_extra_demands_ti'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'];
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount'] = $roomTypeDateRangePrice['total_price_tax_incl']*$vart_quant;
|
||||
// extra demands prices
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order->id,
|
||||
$type_value['product_id'],
|
||||
0,
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to']
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order->id,
|
||||
$type_value['product_id'],
|
||||
0,
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
0,
|
||||
1,
|
||||
0
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order->id,
|
||||
$type_value['product_id'],
|
||||
0,
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
0,
|
||||
1,
|
||||
1
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
$type_value['product_id'],
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
$data_v['id_room'],
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
Product::PRICE_ADDITION_TYPE_WITH_ROOM
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
$type_value['product_id'],
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
$data_v['id_room'],
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
Product::PRICE_ADDITION_TYPE_WITH_ROOM
|
||||
);
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_incl']/$num_days;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] += ($cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_incl'] += ($data_v['total_price_tax_incl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
|
||||
} else {
|
||||
$num_days = $obj_htl_bk_dtl->getNumberOfDays($data_v['date_from'], $data_v['date_to']);
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['num_rm'] = 1;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['data_form'] = $data_v['date_from'];
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['data_to'] = $data_v['date_to'];
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['num_days'] = $num_days;
|
||||
/*$amount = Product::getPriceStatic($type_value['product_id'], true, null, 6, null, false, true, 1);
|
||||
$amount *= $num_days;*/
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['adults'] = $data_v['adults'];
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['children'] = $data_v['children'];
|
||||
|
||||
|
||||
|
||||
// extra demands prices
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order->id,
|
||||
$type_value['product_id'],
|
||||
0,
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to']
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order->id,
|
||||
$type_value['product_id'],
|
||||
0,
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
0,
|
||||
1,
|
||||
0
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$order->id,
|
||||
$type_value['product_id'],
|
||||
0,
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
0,
|
||||
1,
|
||||
1
|
||||
);
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
$type_value['product_id'],
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to']
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
$type_value['product_id'],
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
$data_v['id_room'],
|
||||
1,
|
||||
1
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_te'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
$type_value['product_id'],
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
$data_v['id_room'],
|
||||
1,
|
||||
0
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
$type_value['product_id'],
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
$data_v['id_room'],
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
Product::PRICE_ADDITION_TYPE_WITH_ROOM
|
||||
);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
$type_value['product_id'],
|
||||
$data_v['date_from'],
|
||||
$data_v['date_to'],
|
||||
$data_v['id_room'],
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
Product::PRICE_ADDITION_TYPE_WITH_ROOM
|
||||
);
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_incl']/$num_days;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] = ($cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_incl'] = ($data_v['total_price_tax_incl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
|
||||
|
||||
$result['total_extra_demands_te'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'];
|
||||
$result['total_extra_demands_ti'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'];
|
||||
$result['total_additional_services_te'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_te'];
|
||||
$result['total_additional_services_ti'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_ti'];
|
||||
}
|
||||
}
|
||||
}
|
||||
// calculate averages now
|
||||
|
||||
@@ -74,6 +74,12 @@ class ProductCore extends ObjectModel
|
||||
/** @var int Minimal quantity for add to cart */
|
||||
public $minimal_quantity = 1;
|
||||
|
||||
/** @var bool allow order for multiple quantities */
|
||||
public $allow_multiple_quantity;
|
||||
|
||||
/** @var bool max allowed quantities */
|
||||
public $max_quantity;
|
||||
|
||||
/** @var string available_now */
|
||||
public $available_now;
|
||||
|
||||
@@ -175,6 +181,16 @@ class ProductCore extends ObjectModel
|
||||
/** @var bool Product available for order */
|
||||
public $available_for_order = true;
|
||||
|
||||
// Room type required to buy
|
||||
public $service_product_type;
|
||||
|
||||
// add product to cart automatically
|
||||
public $auto_add_to_cart = false;
|
||||
|
||||
public $price_addition_type;
|
||||
|
||||
public $show_at_front;
|
||||
|
||||
/** @var string Object available order date */
|
||||
public $available_date = '0000-00-00';
|
||||
|
||||
@@ -226,6 +242,7 @@ class ProductCore extends ObjectModel
|
||||
public $cache_is_pack;
|
||||
public $cache_has_attachments;
|
||||
public $is_virtual;
|
||||
public $booking_product;
|
||||
public $id_pack_product_attribute;
|
||||
public $cache_default_attribute;
|
||||
|
||||
@@ -281,6 +298,8 @@ class ProductCore extends ObjectModel
|
||||
'cache_is_pack' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'cache_has_attachments' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'is_virtual' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'booking_product' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'service_product_type' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||
|
||||
/* Shop fields */
|
||||
'id_category_default' => array('type' => self::TYPE_INT, 'shop' => true, 'validate' => 'isUnsignedId'),
|
||||
@@ -289,6 +308,8 @@ class ProductCore extends ObjectModel
|
||||
'online_only' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
|
||||
'ecotax' => array('type' => self::TYPE_FLOAT, 'shop' => true, 'validate' => 'isPrice'),
|
||||
'minimal_quantity' => array('type' => self::TYPE_INT, 'shop' => true, 'validate' => 'isUnsignedInt'),
|
||||
'allow_multiple_quantity' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
|
||||
'max_quantity' => array('type' => self::TYPE_INT, 'shop' => true, 'validate' => 'isUnsignedInt'),
|
||||
'price' => array('type' => self::TYPE_FLOAT, 'shop' => true, 'validate' => 'isPrice', 'required' => true),
|
||||
'wholesale_price' => array('type' => self::TYPE_FLOAT, 'shop' => true, 'validate' => 'isPrice'),
|
||||
'unity' => array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isString'),
|
||||
@@ -303,6 +324,9 @@ class ProductCore extends ObjectModel
|
||||
'available_for_order' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
|
||||
'available_date' => array('type' => self::TYPE_DATE, 'shop' => true, 'validate' => 'isDateFormat'),
|
||||
'condition' => array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isGenericName', 'values' => array('new', 'used', 'refurbished'), 'default' => 'new'),
|
||||
'auto_add_to_cart' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
|
||||
'price_addition_type' => array('type' => self::TYPE_INT, 'shop' => true, 'validate' => 'isUnsignedInt'),
|
||||
'show_at_front' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
|
||||
'show_price' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
|
||||
'indexed' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
|
||||
'visibility' => array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isProductVisibility', 'values' => array('both', 'catalog', 'search', 'none'), 'default' => 'both'),
|
||||
@@ -475,6 +499,16 @@ class ProductCore extends ObjectModel
|
||||
const PTYPE_PACK = 1;
|
||||
const PTYPE_VIRTUAL = 2;
|
||||
|
||||
const PRICE_DISPALY_COMBINE = 1;
|
||||
const PRICE_DISPALY_INDIVISUAL = 2;
|
||||
|
||||
const SERVICE_PRODUCT_WITH_ROOMTYPE = 1;
|
||||
const SERVICE_PRODUCT_WITHOUT_ROOMTYPE = 2;
|
||||
|
||||
const PRICE_ADDITION_TYPE_WITH_ROOM = 1;
|
||||
const PRICE_ADDITION_TYPE_INDEPENDENT = 2;
|
||||
|
||||
|
||||
public function __construct($id_product = null, $full = false, $id_lang = null, $id_shop = null, Context $context = null)
|
||||
{
|
||||
parent::__construct($id_product, $id_lang, $id_shop);
|
||||
@@ -880,6 +914,14 @@ class ProductCore extends ObjectModel
|
||||
return parent::toggleStatus();
|
||||
}
|
||||
|
||||
public static function isBookingProduct($id_product)
|
||||
{
|
||||
return Db::getInstance()->getValue('
|
||||
SELECT `booking_product` FROM `'._DB_PREFIX_.'product` p
|
||||
WHERE p.`id_product` = '.(int)$id_product
|
||||
);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
/*
|
||||
@@ -919,6 +961,12 @@ class ProductCore extends ObjectModel
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!$this->booking_product) {
|
||||
if (!$this->deleteServiceInfo()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Hook::exec('actionProductDelete', array('id_product' => (int)$this->id, 'product' => $this));
|
||||
if (!$result ||
|
||||
!GroupReduction::deleteProductReduction($this->id) ||
|
||||
@@ -943,6 +991,16 @@ class ProductCore extends ObjectModel
|
||||
return true;
|
||||
}
|
||||
|
||||
public function deleteServiceInfo()
|
||||
{
|
||||
if (!RoomTypeServiceProduct::deleteRoomProductLink($this->id)
|
||||
|| !RoomTypeServiceProductPrice::deleteRoomProductPrices($this->id)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function deleteSelection($products)
|
||||
{
|
||||
$return = 1;
|
||||
@@ -1253,6 +1311,154 @@ class ProductCore extends ObjectModel
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||
}
|
||||
|
||||
|
||||
public function getProductServiceProducts($id_lang, $p, $n, $front = false, $available_for_order = 2, $auto_add_to_cart = 0, $get_total = false, $active = true, $sub_category = false, Context $context = null)
|
||||
{
|
||||
if (!$context) {
|
||||
$context = Context::getContext();
|
||||
}
|
||||
|
||||
// first check if product is booking product
|
||||
if (!$this->booking_product) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// get hotel and room type by id_product
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
$roomInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct((int)$this->id);
|
||||
|
||||
if ($get_total) {
|
||||
$sql = 'SELECT COUNT(DISTINCT(p.`id_product`)) AS total
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
'.Shop::addSqlAssociation('product', 'p').'
|
||||
INNER JOIN `'._DB_PREFIX_.'htl_room_type_service_product` rsp ON (rsp.`id_product` = p.`id_product`)
|
||||
WHERE
|
||||
('.
|
||||
'(`element_type` = '.RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE.' AND `id_element` = '.(int)$this->id.')
|
||||
)
|
||||
AND p.`service_product_type` = '.(int)self::SERVICE_PRODUCT_WITH_ROOMTYPE. '
|
||||
AND product_shop.`id_shop` = '.(int)$context->shop->id
|
||||
.($sub_category? ' AND product_shop.`id_category_default` = '.(int)$sub_category : '')
|
||||
.($front ? ' AND product_shop.`show_at_front` = 1':'')
|
||||
.(!is_null($auto_add_to_cart) ? ' AND product_shop.`auto_add_to_cart` = '.$auto_add_to_cart:'')
|
||||
.($available_for_order != 2 ? ' AND p.`available_for_order` = '.(int)$available_for_order:'')
|
||||
.($active ? ' AND product_shop.`active` = 1' : '');
|
||||
return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
|
||||
}
|
||||
|
||||
if ($p < 1) {
|
||||
$p = 1;
|
||||
}
|
||||
|
||||
$nb_days_new_product = Configuration::get('PS_NB_DAYS_NEW_PRODUCT');
|
||||
if (!Validate::isUnsignedInt($nb_days_new_product)) {
|
||||
$nb_days_new_product = 20;
|
||||
}
|
||||
|
||||
$sql = 'SELECT p.*, product_shop.*,
|
||||
stock.`out_of_stock`, IFNULL(stock.`quantity`, 0) AS quantity, pl.`description`, pl.`description_short`, pl.`available_now`,
|
||||
pl.`available_later`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, image_shop.`id_image` id_image,
|
||||
il.`legend` as legend, cl.`name` AS category_default,
|
||||
DATEDIFF(product_shop.`date_add`, DATE_SUB("'.date('Y-m-d').' 00:00:00",
|
||||
INTERVAL '.(int)$nb_days_new_product.' DAY)) > 0 AS new, product_shop.price AS orderprice
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
'.Shop::addSqlAssociation('product', 'p').'
|
||||
INNER JOIN `'._DB_PREFIX_.'htl_room_type_service_product` rsp ON (rsp.`id_product` = p.`id_product`)'
|
||||
.Product::sqlStock('p', 0).'
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl
|
||||
ON (product_shop.`id_category_default` = cl.`id_category`
|
||||
AND cl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').')
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl
|
||||
ON (p.`id_product` = pl.`id_product`
|
||||
AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').')
|
||||
LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop
|
||||
ON (image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop='.(int)$context->shop->id.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'image_lang` il
|
||||
ON (image_shop.`id_image` = il.`id_image`
|
||||
AND il.`id_lang` = '.(int)$id_lang.')
|
||||
WHERE
|
||||
('.
|
||||
'(`element_type` = '.RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE.' AND `id_element` = '.(int)$this->id.')
|
||||
)
|
||||
AND p.`service_product_type` = '.(int)self::SERVICE_PRODUCT_WITH_ROOMTYPE. '
|
||||
AND product_shop.`id_shop` = '.(int)$context->shop->id
|
||||
.($sub_category? ' AND product_shop.`id_category_default` = '.(int)$sub_category : '')
|
||||
.($front ? ' AND product_shop.`show_at_front` = 1':'')
|
||||
.(!is_null($auto_add_to_cart) ? ' AND product_shop.`auto_add_to_cart` = '.$auto_add_to_cart:'')
|
||||
.($available_for_order != 2 ? ' AND p.`available_for_order` = '.(int)$available_for_order:'')
|
||||
.($active ? ' AND product_shop.`active` = 1' : '');
|
||||
|
||||
$sql .= ' GROUP BY p.`id_product`';
|
||||
$sql .= ' ORDER BY rsp.`position` ASC';
|
||||
if ($p && $n) {
|
||||
$sql .= ' LIMIT '.(((int)$p - 1) * (int)$n).','.(int)$n;
|
||||
}
|
||||
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql, true, false);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getAvailableServiceProductsCategories($id_lang, $front = false, $active = true, Context $context = null)
|
||||
{
|
||||
if (!$context) {
|
||||
$context = Context::getContext();
|
||||
}
|
||||
|
||||
// first check if product is booking product
|
||||
if (!$this->booking_product) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// get hotel and room type by id_product
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
$roomInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct((int)$this->id);
|
||||
|
||||
$sql = 'SELECT cl.*, COUNT(DISTINCT(p.`id_product`)) as num_products
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
'.Shop::addSqlAssociation('product', 'p').'
|
||||
INNER JOIN `'._DB_PREFIX_.'htl_room_type_service_product` rsp ON (rsp.`id_product` = p.`id_product`)'
|
||||
.Product::sqlStock('p', 0).'
|
||||
INNER JOIN `'._DB_PREFIX_.'category_lang` cl
|
||||
ON (product_shop.`id_category_default` = cl.`id_category`
|
||||
AND cl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').')
|
||||
WHERE
|
||||
('.
|
||||
'(`element_type` = '.RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE.' AND `id_element` = '.(int)$this->id.')
|
||||
)
|
||||
AND p.`service_product_type` = '.(int)self::SERVICE_PRODUCT_WITH_ROOMTYPE. '
|
||||
AND product_shop.`id_shop` = '.(int)$context->shop->id
|
||||
.($front ? ' AND product_shop.`auto_add_to_cart` = 0 AND product_shop.`show_at_front` = 1':'')
|
||||
.($active ? ' AND product_shop.`active` = 1' : '');
|
||||
|
||||
|
||||
$sql .= ' GROUP BY cl.`id_category`';
|
||||
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql, true, false);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getServiceProducts($idLang, $front = false, $context = false)
|
||||
{
|
||||
if (!$context) {
|
||||
$context = Context::getContext();
|
||||
}
|
||||
$sql = 'SELECT p.*, product_shop.*, pl.*, image_shop.`id_image` id_image, il.`legend` as legend
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
'.Shop::addSqlAssociation('product', 'p').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` '.Shop::addSqlRestrictionOnLang('pl').')
|
||||
LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop
|
||||
ON (image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop='.(int)$context->shop->id.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'image_lang` il
|
||||
ON (image_shop.`id_image` = il.`id_image`
|
||||
AND il.`id_lang` = '.(int)$idLang.')';
|
||||
$sql .= 'WHERE pl.`id_lang` = '.(int)$idLang.' AND p.`booking_product` = 0
|
||||
AND p.`service_product_type` = '.Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE.'
|
||||
ORDER BY pl.`name`';
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||
}
|
||||
|
||||
public function isNew()
|
||||
{
|
||||
$result = Db::getInstance()->executeS('
|
||||
@@ -2770,7 +2976,7 @@ class ProductCore extends ObjectModel
|
||||
public static function getPriceStatic($id_product, $usetax = true, $id_product_attribute = null, $decimals = 6, $divisor = null,
|
||||
$only_reduc = false, $usereduc = true, $quantity = 1, $force_associated_tax = false, $id_customer = null, $id_cart = null,
|
||||
$id_address = null, &$specific_price_output = null, $with_ecotax = true, $use_group_reduction = true, Context $context = null,
|
||||
$use_customer_price = true)
|
||||
$use_customer_price = true, $id_roomtype = false)
|
||||
{
|
||||
if (!$context) {
|
||||
$context = Context::getContext();
|
||||
@@ -2834,13 +3040,30 @@ class ProductCore extends ObjectModel
|
||||
$id_state = 0;
|
||||
$zipcode = 0;
|
||||
|
||||
if ($id_address) {
|
||||
$address_infos = Address::getCountryAndState($id_address);
|
||||
} else {
|
||||
$address_infos = Address::getCountryAndState(Cart::getIdAddressForTaxCalculation($id_product));
|
||||
if (!$id_address) {
|
||||
if (!Product::isBookingProduct($id_product)) {
|
||||
if ($id_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_roomtype);
|
||||
}
|
||||
} else {
|
||||
$id_address = Cart::getIdAddressForTaxCalculation($id_product);
|
||||
}
|
||||
}
|
||||
|
||||
if ($address_infos['id_country']) {
|
||||
if (!$id_address) {
|
||||
if ($primaryHotel = ConfigurationCore::get('WK_PRIMARY_HOTEL')) {
|
||||
if ($address = HotelBranchInformation::getAddress($primaryHotel)) {
|
||||
$address_infos['id_country'] = $address['id_country'];
|
||||
$address_infos['id_state'] = $address['id_state'];
|
||||
$address_infos['postcode'] = $address['postcode'];
|
||||
}
|
||||
}
|
||||
} elseif ($id_address) {
|
||||
$address_infos = Address::getCountryAndState($id_address);
|
||||
}
|
||||
|
||||
if (isset($address_infos['id_country'])) {
|
||||
$id_country = (int)$address_infos['id_country'];
|
||||
$id_state = (int)$address_infos['id_state'];
|
||||
$zipcode = $address_infos['postcode'];
|
||||
@@ -2874,7 +3097,8 @@ class ProductCore extends ObjectModel
|
||||
$id_customer,
|
||||
$use_customer_price,
|
||||
$id_cart,
|
||||
$cart_quantity
|
||||
$cart_quantity,
|
||||
$id_roomtype
|
||||
);
|
||||
|
||||
return $return;
|
||||
@@ -2908,8 +3132,9 @@ class ProductCore extends ObjectModel
|
||||
**/
|
||||
public static function priceCalculation($id_shop, $id_product, $id_product_attribute, $id_country, $id_state, $zipcode, $id_currency,
|
||||
$id_group, $quantity, $use_tax, $decimals, $only_reduc, $use_reduc, $with_ecotax, &$specific_price, $use_group_reduction,
|
||||
$id_customer = 0, $use_customer_price = true, $id_cart = 0, $real_quantity = 0)
|
||||
$id_customer = 0, $use_customer_price = true, $id_cart = 0, $real_quantity = 0, $id_roomtype = false)
|
||||
{
|
||||
|
||||
static $address = null;
|
||||
static $context = null;
|
||||
|
||||
@@ -2936,7 +3161,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;
|
||||
'-'.($only_reduc?'1':'0').'-'.($use_reduc?'1':'0').'-'.($use_tax?'1':'0').'-'.(int)$decimals.'-'.($id_roomtype?(int)$id_roomtype:'0');
|
||||
|
||||
// reference parameter is filled before any returns
|
||||
$specific_price = SpecificPrice::getSpecificPrice(
|
||||
@@ -2999,11 +3224,23 @@ class ProductCore extends ObjectModel
|
||||
|
||||
$result = self::$_pricesLevel2[$cache_id_2][(int)$id_product_attribute];
|
||||
|
||||
if (!$specific_price || $specific_price['price'] < 0) {
|
||||
// get price per room type
|
||||
if ($id_roomtype) {
|
||||
$priceForRoomInfo = RoomTypeServiceProductPrice::getProductRoomTypePriceAndTax(
|
||||
$id_product,
|
||||
$id_roomtype,
|
||||
RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($priceForRoomInfo) && isset($priceForRoomInfo['price'])) {
|
||||
$price = (float)$priceForRoomInfo['price'];
|
||||
} elseif (!$specific_price || $specific_price['price'] < 0) {
|
||||
$price = (float)$result['price'];
|
||||
} else {
|
||||
$price = (float)$specific_price['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);
|
||||
@@ -3021,12 +3258,29 @@ class ProductCore extends ObjectModel
|
||||
}
|
||||
}
|
||||
|
||||
// find and add if any auto_add services are attached
|
||||
|
||||
|
||||
Hook::exec(
|
||||
'actionProductPriceModifier',
|
||||
array(
|
||||
'price' => &$price,
|
||||
'type' => 'pre_tax'
|
||||
)
|
||||
);
|
||||
|
||||
// Tax
|
||||
$address->id_country = $id_country;
|
||||
$address->id_state = $id_state;
|
||||
$address->postcode = $zipcode;
|
||||
|
||||
$tax_manager = TaxManagerFactory::getManager($address, Product::getIdTaxRulesGroupByIdProduct((int)$id_product, $context));
|
||||
if (isset($priceForRoomInfo) && isset($priceForRoomInfo['id_tax_rules_group'])) {
|
||||
$id_tax_rule_group = $priceForRoomInfo['id_tax_rules_group'];
|
||||
} else {
|
||||
$id_tax_rule_group = Product::getIdTaxRulesGroupByIdProduct((int)$id_product, $context);
|
||||
}
|
||||
|
||||
$tax_manager = TaxManagerFactory::getManager($address, $id_tax_rule_group);
|
||||
$product_tax_calculator = $tax_manager->getTaxCalculator();
|
||||
|
||||
// Add Tax
|
||||
@@ -3057,6 +3311,14 @@ class ProductCore extends ObjectModel
|
||||
}
|
||||
}
|
||||
|
||||
Hook::exec(
|
||||
'actionProductPriceModifier',
|
||||
array(
|
||||
'price' => &$price,
|
||||
'type' => 'post_tax'
|
||||
)
|
||||
);
|
||||
|
||||
// Reduction
|
||||
$specific_price_reduction = 0;
|
||||
if (($only_reduc || $use_reduc) && $specific_price) {
|
||||
@@ -3138,7 +3400,7 @@ class ProductCore extends ObjectModel
|
||||
$quantity = $cart_quantity ? $cart_quantity : $quantity;
|
||||
|
||||
$id_currency = (int)$context->currency->id;
|
||||
$ids = Address::getCountryAndState(cart::getIdAddressForTaxCalculation($id_product));
|
||||
$ids = Address::getCountryAndState(Cart::getIdAddressForTaxCalculation($id_product));
|
||||
$id_country = $ids['id_country'] ? (int)$ids['id_country'] : (int)Configuration::get('PS_COUNTRY_DEFAULT');
|
||||
return (bool)SpecificPrice::getSpecificPrice((int)$id_product, $context->shop->id, $id_currency, $id_country, $id_group, $quantity, null, 0, 0, $quantity);
|
||||
}
|
||||
@@ -3743,7 +4005,7 @@ class ProductCore extends ObjectModel
|
||||
}
|
||||
|
||||
$sql = new DbQuery();
|
||||
$sql->select('p.`id_product`, pl.`name`, p.`ean13`, p.`upc`, p.`active`, p.`reference`, m.`name` AS manufacturer_name, stock.`quantity`, product_shop.advanced_stock_management, p.`customizable`');
|
||||
$sql->select('p.`id_product`, pl.`name`, p.`ean13`, p.`upc`, p.`active`, p.`reference`, m.`name` AS manufacturer_name, stock.`quantity`, product_shop.advanced_stock_management, p.`customizable`, p.`booking_product`');
|
||||
$sql->from('product', 'p');
|
||||
$sql->join(Shop::addSqlAssociation('product', 'p'));
|
||||
$sql->leftJoin('product_lang', 'pl', '
|
||||
|
||||
@@ -145,8 +145,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
FROM `'._DB_PREFIX_.'specific_price`
|
||||
WHERE 1 '.self::filterOutField('id_product', $id_product).
|
||||
($id_product_attribute ? ' AND id_product_attribute = '.(int) $id_product_attribute : '').'
|
||||
AND id_cart = '.(int) $id_cart.'
|
||||
GROUP BY `id_specific_price_rule`'
|
||||
AND id_cart = '.(int) $id_cart
|
||||
);
|
||||
}
|
||||
|
||||
@@ -335,7 +334,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
}
|
||||
}
|
||||
|
||||
public static function getSpecificPrice($id_product, $id_shop, $id_currency, $id_country, $id_group, $quantity, $id_product_attribute = null, $id_customer = 0, $id_cart = 0, $real_quantity = 0)
|
||||
public static function getSpecificPrice($id_product, $id_shop, $id_currency, $id_country, $id_group, $quantity, $id_product_attribute = null, $id_customer = 0, $id_cart = 0, $real_quantity = 0, $id_room = 0)
|
||||
{
|
||||
if (!SpecificPrice::isFeatureActive()) {
|
||||
return array();
|
||||
@@ -359,7 +358,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
AND IF(`from_quantity` > 1, `from_quantity`, 0) <= ';
|
||||
|
||||
$query .= (Configuration::get('PS_QTY_DISCOUNT_ON_COMBINATION') || !$id_cart || !$real_quantity) ? (int)$quantity : max(1, (int)$real_quantity);
|
||||
$query .= ' ORDER BY `id_product_attribute` DESC, `from_quantity` DESC, `id_specific_price_rule` ASC, `score` DESC, `to` DESC, `from` DESC';
|
||||
$query .= ' ORDER BY `id_product_attribute` DESC, `from_quantity` DESC, `score` DESC, `to` DESC, `from` DESC';
|
||||
|
||||
SpecificPrice::$_specificPriceCache[$key] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($query);
|
||||
}
|
||||
|
||||
@@ -345,7 +345,7 @@ class ThemeCore extends ObjectModel
|
||||
public function toggleResponsive()
|
||||
{
|
||||
// Object must have a variable called 'responsive'
|
||||
if (!array_key_exists('responsive', $this)) {
|
||||
if (!property_exists($this, 'responsive')) {
|
||||
throw new PrestaShopException('property "responsive" is missing in object '.get_class($this));
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ class ThemeCore extends ObjectModel
|
||||
|
||||
public function toggleDefaultLeftColumn()
|
||||
{
|
||||
if (!array_key_exists('default_left_column', $this)) {
|
||||
if (!property_exists($this, 'default_left_column')) {
|
||||
throw new PrestaShopException('property "default_left_column" is missing in object '.get_class($this));
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ class ThemeCore extends ObjectModel
|
||||
|
||||
public function toggleDefaultRightColumn()
|
||||
{
|
||||
if (!array_key_exists('default_right_column', $this)) {
|
||||
if (!property_exists($this,'default_right_column')) {
|
||||
throw new PrestaShopException('property "default_right_column" is missing in object '.get_class($this));
|
||||
}
|
||||
|
||||
|
||||
@@ -3312,6 +3312,20 @@ exit;
|
||||
return preg_replace('/\\\[px]\{[a-z]{1,2}\}|(\/[a-z]*)u([a-z]*)$/i', '$1$2', $pattern);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $file
|
||||
* @param int $timeout
|
||||
* @return bool
|
||||
*/
|
||||
public static function isFresh($file, $timeout = _TIME_1_WEEK_)
|
||||
{
|
||||
if (($time = @filemtime(_PS_ROOT_DIR_.$file)) && filesize(_PS_ROOT_DIR_.$file) > 0) {
|
||||
return ((time() - $time) < $timeout);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected static $is_addons_up = true;
|
||||
public static function addonsRequest($request, $params = array())
|
||||
{
|
||||
@@ -3421,6 +3435,20 @@ exit;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $file_to_refresh
|
||||
* @param string $external_file
|
||||
* @return bool
|
||||
*/
|
||||
public static function refresh($file_to_refresh, $external_file)
|
||||
{
|
||||
if (self::$is_addons_up && $content = Tools::file_get_contents($external_file)) {
|
||||
return (bool)file_put_contents(_PS_ROOT_DIR_.$file_to_refresh, $content);
|
||||
}
|
||||
self::$is_addons_up = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array containing information about
|
||||
* HTTP file upload variable ($_FILES)
|
||||
|
||||
@@ -709,6 +709,24 @@ class AdminControllerCore extends Controller
|
||||
$filter_value .= ' - '.$date[1];
|
||||
}
|
||||
}
|
||||
} elseif (isset($t['type']) && $t['type'] == 'range') {
|
||||
$range = json_decode($val, true);
|
||||
if (isset($range[0]) && !empty($range[0])) {
|
||||
if (Validate::isUnsignedInt($range[0])) {
|
||||
$filter_value = $range[0];
|
||||
if (isset($range[1]) && !empty($range[1])) {
|
||||
if (Validate::isUnsignedInt($range[1]) && $range[0] < $range[1]) {
|
||||
$filter_value .= ' - '.$range[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isset($range[1]) && !empty($range[1])) {
|
||||
if (Validate::isUnsignedInt($range[1])) {
|
||||
$filter_value = $range[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif (is_string($val)) {
|
||||
$filter_value = htmlspecialchars($val, ENT_QUOTES, 'UTF-8');
|
||||
}
|
||||
@@ -849,6 +867,7 @@ class AdminControllerCore extends Controller
|
||||
foreach ($filters as $key => $value) {
|
||||
/* Extracting filters from $_POST on key filter_ */
|
||||
if ($value != null && !strncmp($key, $prefix.$this->list_id.'Filter_', 7 + Tools::strlen($prefix.$this->list_id))) {
|
||||
$key_org = $key;
|
||||
$key = Tools::substr($key, 7 + Tools::strlen($prefix.$this->list_id));
|
||||
/* Table alias could be specified using a ! eg. alias!field */
|
||||
$tmp_tab = explode('!', $key);
|
||||
@@ -856,7 +875,7 @@ class AdminControllerCore extends Controller
|
||||
|
||||
if ($field = $this->filterToField($key, $filter)) {
|
||||
$type = (array_key_exists('filter_type', $field) ? $field['filter_type'] : (array_key_exists('type', $field) ? $field['type'] : false));
|
||||
if (($type == 'date' || $type == 'datetime') && is_string($value)) {
|
||||
if (($type == 'date' || $type == 'datetime' || $type == 'range') && is_string($value)) {
|
||||
$value = json_decode($value, true);
|
||||
}
|
||||
$key = isset($tmp_tab[1]) ? $tmp_tab[0].'.`'.$tmp_tab[1].'`' : '`'.$tmp_tab[0].'`';
|
||||
@@ -874,22 +893,42 @@ class AdminControllerCore extends Controller
|
||||
} else {
|
||||
$sql_filter = & $this->_filter;
|
||||
}
|
||||
|
||||
/* Only for date filtering (from, to) */
|
||||
if (is_array($value)) {
|
||||
if (isset($value[0]) && !empty($value[0])) {
|
||||
if (!Validate::isDate($value[0])) {
|
||||
$this->errors[] = Tools::displayError('The \'From\' date format is invalid (YYYY-MM-DD)');
|
||||
} else {
|
||||
$sql_filter .= ' AND '.pSQL($key).' >= \''.pSQL(Tools::dateFrom($value[0])).'\'';
|
||||
if ($type == 'range') {
|
||||
if (isset($value[0]) && !empty($value[0])) {
|
||||
if (!Validate::isUnsignedInt($value[0])) {
|
||||
$this->errors[] = Tools::displayError('The \'From\' value is invalid');
|
||||
} else {
|
||||
$sql_filter .= ' AND '.pSQL($key).' >= '.pSQL($value[0]);
|
||||
}
|
||||
}
|
||||
if (isset($value[1]) && !empty($value[1])) {
|
||||
if (!Validate::isUnsignedInt($value[1])) {
|
||||
$this->errors[] = Tools::displayError('The \'From\' value is invalid');
|
||||
} elseif (isset($value[0]) && !empty($value[0]) && $value[0] > $value[1]) {
|
||||
$this->errors[] = Tools::displayError('The \'To\' value cannot be less than from value');
|
||||
} else {
|
||||
$sql_filter .= ' AND '.pSQL($key).' <= '.pSQL($value[1]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isset($value[0]) && !empty($value[0])) {
|
||||
if (!Validate::isDate($value[0])) {
|
||||
$this->errors[] = Tools::displayError('The \'From\' date format is invalid (YYYY-MM-DD)');
|
||||
} else {
|
||||
$sql_filter .= ' AND '.pSQL($key).' >= \''.pSQL(Tools::dateFrom($value[0])).'\'';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($value[1]) && !empty($value[1])) {
|
||||
if (!Validate::isDate($value[1])) {
|
||||
$this->errors[] = Tools::displayError('The \'To\' date format is invalid (YYYY-MM-DD)');
|
||||
} else {
|
||||
$sql_filter .= ' AND '.pSQL($key).' <= \''.pSQL(Tools::dateTo($value[1])).'\'';
|
||||
if (isset($value[1]) && !empty($value[1])) {
|
||||
if (!Validate::isDate($value[1])) {
|
||||
$this->errors[] = Tools::displayError('The \'To\' date format is invalid (YYYY-MM-DD)');
|
||||
} elseif (isset($value[0]) && !empty($value[0]) && strtotime($value[0]) > strtotime($value[1])) {
|
||||
$this->errors[] = Tools::displayError('The \'To\' date cannot be before than from date');
|
||||
} else {
|
||||
$sql_filter .= ' AND '.pSQL($key).' <= \''.pSQL(Tools::dateTo($value[1])).'\'';
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -915,6 +954,15 @@ class AdminControllerCore extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function processListVisibility()
|
||||
{
|
||||
$listFieldsVisibility = Tools::getValue('list_fields_visibility');
|
||||
$controller = 'list_visibility_'.$this->context->controller->className;
|
||||
$this->context->cookie->$controller = json_encode($listFieldsVisibility);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @TODO uses redirectAdmin only if !$this->ajax
|
||||
* @return bool
|
||||
@@ -2214,36 +2262,7 @@ class AdminControllerCore extends Controller
|
||||
|
||||
public function ajaxProcessRefreshModuleList($force_reload_cache = false)
|
||||
{
|
||||
if (!$this->isFresh(Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, _TIME_1_DAY_) || $force_reload_cache) {
|
||||
if (file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, Tools::addonsRequest('native'))) {
|
||||
$this->status = 'refresh';
|
||||
} else {
|
||||
$this->status = 'error';
|
||||
}
|
||||
} else {
|
||||
$this->status = 'cache';
|
||||
}
|
||||
|
||||
if (!$this->isFresh(Module::CACHE_FILE_MUST_HAVE_MODULES_LIST, _TIME_1_DAY_) || $force_reload_cache) {
|
||||
if (file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_MUST_HAVE_MODULES_LIST, Tools::addonsRequest('must-have'))) {
|
||||
$this->status = 'refresh';
|
||||
} else {
|
||||
$this->status = 'error';
|
||||
}
|
||||
} else {
|
||||
$this->status = 'cache';
|
||||
}
|
||||
|
||||
if (!$this->isFresh(Module::CACHE_FILE_TAB_MODULES_LIST, _TIME_1_WEEK_)) {
|
||||
if ($this->refresh(Module::CACHE_FILE_TAB_MODULES_LIST, _QLO_TAB_MODULE_LIST_URL_)) {
|
||||
$this->status = 'refresh';
|
||||
} else {
|
||||
$this->status = 'error';
|
||||
}
|
||||
} else {
|
||||
$this->status = 'cache';
|
||||
}
|
||||
Module::generateTrustedXml();
|
||||
$this->status = Module::refreshModuleList($force_reload_cache);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2835,7 +2854,7 @@ class AdminControllerCore extends Controller
|
||||
));
|
||||
|
||||
// get upgrade available info
|
||||
if (!$this->isFresh(Upgrader::CACHE_FILE_UPGRADE_AVAILABE, _TIME_1_DAY_)) {
|
||||
if (!Tools::isFresh(Upgrader::CACHE_FILE_UPGRADE_AVAILABE, _TIME_1_DAY_)) {
|
||||
file_put_contents(_PS_ROOT_DIR_.Upgrader::CACHE_FILE_UPGRADE_AVAILABE, Tools::addonsRequest('check-version'));
|
||||
}
|
||||
if (file_exists(_PS_ROOT_DIR_.Upgrader::CACHE_FILE_UPGRADE_AVAILABE)) {
|
||||
@@ -3640,7 +3659,7 @@ class AdminControllerCore extends Controller
|
||||
{
|
||||
/* Classical fields */
|
||||
foreach ($_POST as $key => $value) {
|
||||
if (array_key_exists($key, $object) && $key != 'id_'.$table) {
|
||||
if (property_exists($object, $key) && $key != 'id_'.$table) {
|
||||
/* Do not take care of password field if empty */
|
||||
if ($key == 'passwd' && Tools::getValue('id_'.$table) && empty($value)) {
|
||||
continue;
|
||||
@@ -3929,6 +3948,45 @@ class AdminControllerCore extends Controller
|
||||
die($popup_content);
|
||||
}
|
||||
|
||||
public function ajaxProcessGetRecommendationContent()
|
||||
{
|
||||
$response = array('success' => false);
|
||||
if (isset($this->context->cookie->{$this->controller_name.'_closed'}) && $this->context->cookie->{$this->controller_name.'_closed'}) {
|
||||
$response['success'] = true;
|
||||
} else {
|
||||
if (method_exists($this, 'getRecommendationContent')) {
|
||||
if ($content = $this->getRecommendationContent()) {
|
||||
$response['success'] = true;
|
||||
$response['content'] = $content;
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
public function ajaxProcessRecommendationClosed()
|
||||
{
|
||||
$this->context->cookie->{Tools::getValue('tab').'_closed'} = true;
|
||||
$response = array('success' => true);
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Save list visible columns
|
||||
*
|
||||
* @return json as response
|
||||
*/
|
||||
public function ajaxProcessUpdateListVisivility()
|
||||
{
|
||||
$response = array(
|
||||
'success' => false
|
||||
);
|
||||
|
||||
$response['success'] = $this->processListVisibility();
|
||||
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable multiple items
|
||||
*
|
||||
@@ -4075,28 +4133,24 @@ class AdminControllerCore extends Controller
|
||||
* @param string $file
|
||||
* @param int $timeout
|
||||
* @return bool
|
||||
* @deprecated Deprecated 1.6.0.0 Use Tools::isFresh instead
|
||||
*/
|
||||
public function isFresh($file, $timeout = _TIME_1_WEEK_)
|
||||
{
|
||||
if (($time = @filemtime(_PS_ROOT_DIR_.$file)) && filesize(_PS_ROOT_DIR_.$file) > 0) {
|
||||
return ((time() - $time) < $timeout);
|
||||
}
|
||||
|
||||
return false;
|
||||
Tools::displayAsDeprecated();
|
||||
return Tools::isFresh($file, $timeout);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $file_to_refresh
|
||||
* @param string $external_file
|
||||
* @return bool
|
||||
* @deprecated Deprecated 1.6.0.0 Use Tools::refresh instead
|
||||
*/
|
||||
public function refresh($file_to_refresh, $external_file)
|
||||
{
|
||||
if (self::$is_qloapps_up && $content = Tools::file_get_contents($external_file)) {
|
||||
return (bool)file_put_contents(_PS_ROOT_DIR_.$file_to_refresh, $content);
|
||||
}
|
||||
self::$is_qloapps_up = false;
|
||||
return false;
|
||||
Tools::displayAsDeprecated();
|
||||
return Tools::refresh($file_to_refresh, $external_file);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -441,7 +441,7 @@ class FrontControllerCore extends Controller
|
||||
}
|
||||
|
||||
$occupancyRequiredForBooking = false;
|
||||
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
$occupancyRequiredForBooking = true;
|
||||
}
|
||||
$this->context->smarty->assign(array(
|
||||
|
||||
@@ -81,6 +81,8 @@ class HelperListCore extends Helper
|
||||
*/
|
||||
protected $fields_list;
|
||||
|
||||
protected $fields_optional = array();
|
||||
|
||||
/** @var bool Content line is clickable if true */
|
||||
public $no_link = false;
|
||||
|
||||
@@ -333,6 +335,12 @@ class HelperListCore extends Helper
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->fields_list as $key => $params) {
|
||||
if (isset($field['optional']) && $field['optional']) {
|
||||
$this->fields_optional[$key] = $field;
|
||||
}
|
||||
}
|
||||
|
||||
$this->content_tpl->assign(array_merge($this->tpl_vars, array(
|
||||
'shop_link_type' => $this->shopLinkType,
|
||||
'name' => isset($name) ? $name : null,
|
||||
@@ -348,6 +356,7 @@ class HelperListCore extends Helper
|
||||
'order_way' => $this->orderWay,
|
||||
'is_cms' => $this->is_cms,
|
||||
'fields_display' => $this->fields_list,
|
||||
'fields_optional' => $this->fields_optional,
|
||||
'list' => $this->_list,
|
||||
'actions' => $this->actions,
|
||||
'no_link' => $this->no_link,
|
||||
@@ -626,6 +635,17 @@ class HelperListCore extends Helper
|
||||
if (isset($value[0]) && !Validate::isCleanHtml($value[0]) || isset($value[1]) && !Validate::isCleanHtml($value[1])) {
|
||||
$value = '';
|
||||
}
|
||||
if (isset($value[0]) && !Validate::isDate($value[0])) {
|
||||
$value[0] = '';
|
||||
}
|
||||
if (isset($value[1]) && !Validate::isDate($value[1])) {
|
||||
$value[1] = '';
|
||||
}
|
||||
if (isset($value[0]) && !empty($value[0]) && strtotime($value[0]) > strtotime($value[1])) {
|
||||
$value[1] = '';
|
||||
}
|
||||
|
||||
|
||||
$name = $this->list_id.'Filter_'.(isset($params['filter_key']) ? $params['filter_key'] : $key);
|
||||
$name_id = str_replace('!', '__', $name);
|
||||
|
||||
@@ -635,6 +655,22 @@ class HelperListCore extends Helper
|
||||
$this->context->controller->addJqueryUI('ui.datepicker');
|
||||
break;
|
||||
|
||||
case 'range':
|
||||
if (is_string($value)) {
|
||||
$value = json_decode($value, true);
|
||||
}
|
||||
|
||||
if (isset($value[0]) && !Validate::isUnsignedInt($value[0])) {
|
||||
$value[0] = '';
|
||||
}
|
||||
if (isset($value[1]) && !Validate::isUnsignedInt($value[1])) {
|
||||
$value[1] = '';
|
||||
}
|
||||
if (isset($value[0]) && isset($value[1]) && $value[0] > $value[1]) {
|
||||
$value[1] = '';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'select':
|
||||
foreach ($params['list'] as $option_value => $option_display) {
|
||||
if (isset(Context::getContext()->cookie->{$prefix.$this->list_id.'Filter_'.$params['filter_key']})
|
||||
@@ -667,9 +703,22 @@ class HelperListCore extends Helper
|
||||
$has_value = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// get selected fields to display
|
||||
$list_visibility = json_decode($this->context->cookie->{'list_visibility_'.$this->context->controller->className});
|
||||
foreach ($this->fields_list as $key => $field) {
|
||||
if (!(isset($field['search']) && $field['search'] === false)) {
|
||||
$has_search_field = true;
|
||||
}
|
||||
if (isset($field['optional']) && $field['optional']) {
|
||||
$this->fields_optional[$key] = $field;
|
||||
if ((empty($list_visibility) && isset($field['visible_default']) && $field['visible_default'])
|
||||
|| $list_visibility && in_array($key , $list_visibility)
|
||||
) {
|
||||
$this->fields_optional[$key]['selected'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Context::getContext()->smarty->assign(array(
|
||||
@@ -699,6 +748,7 @@ class HelperListCore extends Helper
|
||||
'order_way' => $this->orderWay,
|
||||
'order_by' => $this->orderBy,
|
||||
'fields_display' => $this->fields_list,
|
||||
'fields_optional' => $this->fields_optional,
|
||||
'delete' => in_array('delete', $this->actions),
|
||||
'identifier' => $this->identifier,
|
||||
'id_cat' => $id_cat,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user