Files
newwalls.pl/modules/squaremeter__/views/templates/admin/admintab.tpl
2024-12-17 13:43:22 +01:00

688 lines
48 KiB
Smarty

{*
* Module Name: Perimeter / Length / Surface (Area) / Volume / Weight Calculator for Prestashop
* Module URI: Please contact with info@megventure.com
* Description: A utility to calculate quantity in perimeter, length, area, volume or weight units
* Version: 5.5.0
* Author: MEG Venture
*
* Copyright 2013, MEG Venture (info@megventure.com)
*
* This program is not a free software: you can't redistribute it and/or modify
* it. All rights reserved.
*
*
* This copyright notice and licence should be retained in all modules based on this framework.
* This does not affect your rights to assert copyright over your own original work.
*}
<!-- Square Meter Calculation Module -->
{if $psversion == ''}
{assign var='psversion' value=Configuration::get('PS_VERSION_DB')}
{/if}
<div class="panel">
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item active">
<a
class="nav-link active"
data-toggle="tab"
href="#displayOptions"
role="tab"
>{l s='Display Options' mod='squaremeter'}</a
>
</li>
<li class="nav-item">
<a
class="nav-link"
data-toggle="tab"
href="#calculationOptions"
role="tab"
>{l s='Calculation Options' mod='squaremeter'}</a
>
</li>
<li class="nav-item">
<a
class="nav-link"
data-toggle="tab"
href="#conversionOptions"
role="tab"
>{l s='Conversion Options' mod='squaremeter'}</a
>
</li>
<li class="nav-item">
<a
class="nav-link"
data-toggle="tab"
href="#pricingOptions"
role="tab"
>{l s='Pricing Options' mod='squaremeter'}</a
>
</li>
<li class="nav-item">
<a
class="nav-link"
data-toggle="tab"
href="#minMaxLimits"
role="tab"
>{l s='Min/Max Limits' mod='squaremeter'}</a
>
</li>
</ul>
<hr>
<div class="tab-content" id="tabContent">
<div class="tab-pane active" id="displayOptions" role="tabpanel">
<div class="panel">
<div class="form-group">
<label for="squaremeter_display"> {* Module Display Option *}
<input
data-toggle="switch"
class=""
data-inverse="true"
type="checkbox"
name="squaremeter_display"
id="squaremeter_display"
value="1"
{if $admintab_display == '1'}checked{/if}>
{l s='Display Applet' mod='squaremeter'}
<span
class="help-box"
data-container="body"
data-toggle="popover"
data-trigger="hover"
data-placement="right"
title="{l s='Applet Display Option' mod='squaremeter'}"
data-content="{l s='If the checkbox is unchecked, then the calculation applet is not diplayed on the product page.' mod='squaremeter'}"
>
</span>
</label>
<small class="form-text">{l s='Enable the applet on the product page.' mod='squaremeter'}</small>
</div> {* Module Display Option *}
<hr>
<div class="form-row"> {* Calculation Type *}
<label class="form-control-label" for="calculation_type">{l s='Applet Type:' mod='squaremeter'}</label>
<select class="form-control" id="calculation_type" name="calculation_type" data-toggle="calculation_type" data-minimumresultsforsearch="3" aria-hidden="true">
<option value="" {if $admintab_type == ''}selected="selected"{/if} >{l s='Please choose' mod='squaremeter'}</option>
<option value="surface" {if $admintab_type == 'surface'}selected="selected"{/if} >{l s='Surface' mod='squaremeter'}</option>
<option value="volume" {if $admintab_type == 'volume'}selected="selected"{/if} >{l s='Volume' mod='squaremeter'}</option>
<option value="linear" {if $admintab_type == 'linear'}selected="selected"{/if} >{l s='Linear' mod='squaremeter'}</option>
<option value="perimeter" {if $admintab_type == 'perimeter'}selected="selected"{/if} >{l s='Perimeter' mod='squaremeter'}</option>
<option value="weight" {if $admintab_type == 'weight'}selected="selected"{/if} >{l s='Weight' mod='squaremeter'}</option>
</select>
<small class="form-text">{l s='Calculation input fields change accordingly.' mod='squaremeter'}</small>
</div>
<p style="color:red;" id="errort3_"></p>
<p style="color:red;" id="errort4_"></p>
<p style="color:red;" id="errort6_"></p>
<p style="color:red;" id="errort8_"></p>
<p style="color:red;" id="errort9_"></p>
<p style="color:red;" id="errort3__"></p>
<p style="color:red;" id="errort4__"></p>
<p style="color:red;" id="errort6__"></p>
<p style="color:red;" id="errort7__"></p>
<p style="color:red;" id="errort9__"></p>
{* Calculation Type *}
<hr>
<div class="form-group"> {* Descriptive Image *}
<div class="form-group">
<img class="image-preview" src="{if $image_src != ''}{$image_src|escape:'html':'UTF-8'}{else}{$module_dir|escape:'html':'UTF-8'}views/img/noimage.png{/if}" class="upload-preview" />
</div>
<div id="refresh"></div>
<label for="squaremeter_picture">
<input
data-toggle="switch"
class=""
data-inverse="true"
type="checkbox"
name="squaremeter_picture"
id="squaremeter_picture"
value="1"
{if $admintab_picture == '1'}checked{/if}>
{l s='Enable picture hint on the product page.' mod='squaremeter'}
</label>
<div class="custom-file">
<input
type="file"
class="custom-file-input"
name="inputfile1"
id="inputfile1"
data-multiple-files-text="%count% files"
/>
<label class="custom-file-label" for="inputfile1">{l s='Choose file...' mod='squaremeter'}</label>
</div>
<small class="form-text">{l s='This picture is used to describe the dimensions needed for the product with a picture depiction. Not mandatory. If no picture is selected, there will be no picture hint button displayed on the product page. A width of 400px is suggested.' mod='squaremeter'}</small>
</div> {* Descriptive Image *}
<hr>
<div class="form-group"> {* Display of "Disable Applet Checkbox" Option *}
<label for="disableapplet">
<input
data-toggle="switch"
class=""
data-inverse="true"
type="checkbox"
name="disableapplet"
id="disableapplet"
value="1"
{if $disableapplet == '1'}checked{/if}>
{l s='"Order by Quantity" option' mod='squaremeter'}
</label>
<small class="form-text">{l s='Present an option to use standard quantity and close the calculator.' mod='squaremeter'}</small>
</div> {* Display of "Disable Applet Checkbox" Option *}
<hr>
<div class="form-group"> {* Allow ordering from product listing pages option *}
<label for="allow_ordering_from_listing">
<input
data-toggle="switch"
class=""
data-inverse="true"
type="checkbox"
name="allow_ordering_from_listing"
id="allow_ordering_from_listing"
value="1"
{if $allow_ordering_from_listing == '1'}checked{/if}>
{l s='Allow ordering from product listing pages' mod='squaremeter'}
</label>
<small class="form-text">{l s='If checked, product can be ordered from the product listing pages by entering the required dimension.' mod='squaremeter'}</small>
</div> {* Allow ordering from product listing pages option *}
</div>
</div>
<div class="tab-pane" id="calculationOptions" role="tabpanel">
<div class="panel">
<div class="form-row"> {* Price Calculation *}
<label class="form-control-label" for="display_quantity">{l s='Order Quantity Display and Price Calculation Options:' mod='squaremeter'}</label>
<select class="form-control" id="display_quantity" name="display_quantity" data-toggle="display_quantity" data-minimumresultsforsearch="3" aria-hidden="true">
<option value="" {if $admintab_dispquan == ''}selected="selected"{/if} >{l s='Please choose' mod='squaremeter'}</option>
<option value="decimalok" {if $admintab_dispquan == 'decimalok'}selected="selected"{/if} >{l s='Quantity overridden, decimals allowed (Recommended)' mod='squaremeter'}</option>
<option value="onevisible" {if $admintab_dispquan == 'onevisible'}selected="selected"{/if} >{l s='Quantity always 1 and visible, price constant' mod='squaremeter'}</option>
<option value="oneinvisible" {if $admintab_dispquan == 'oneinvisible'}selected="selected"{/if} >{l s='Quantity always 1 and invisible, price constant' mod='squaremeter'}</option>
<option value="calcvisible" {if $admintab_dispquan == 'calcvisible'}selected="selected"{/if} >{l s='Quantity calculated and visible, price calculated by applet' mod='squaremeter'}</option>
<option value="calcinvisible" {if $admintab_dispquan == 'calcinvisible'}selected="selected"{/if} >{l s='Quantity calculated and invisible, price calculated by applet' mod='squaremeter'}</option>
<option value="onewithcalcvisible" {if $admintab_dispquan == 'onewithcalcvisible'}selected="selected"{/if} >{l s='Quantity always 1 and visible, price calculated by applet' mod='squaremeter'}</option>
<option value="onewithcalcinvisible" {if $admintab_dispquan == 'onewithcalcinvisible'}selected="selected"{/if} >{l s='Quantity always 1 and invisible, price calculated by applet' mod='squaremeter'}</option>
</select>
<small class="form-text">{l s='Choose the appropriate one according to your case.' mod='squaremeter'}</small>
</div> {* Price Calculation *}
<hr>
<div class="form-row align-items-center" style="display:flex;padding-top:5px;padding-bottom:5px;" id="req_quan"> {* Manual Quantity Input *}
<label for="additional_quantity">
<input data-toggle="switch" class="" data-inverse="true" type="checkbox" name="additional_quantity" id="additional_quantity" value="1" {if $admintab_addquan == '1'}checked{/if}>
{l s='Manual quantity input field' mod='squaremeter'}
</label>
<small class="form-text col-md-12">{l s='Recommended if you don\'t want to use the default quantity option of Prestashop.' mod='squaremeter'}</small>
</div> {* Manual Quantity Input *}
<hr>
<div class="form-row" id="direct_input_field"> {* Direct Input *}
<label for="direct_input">
<input data-toggle="switch" class="" data-inverse="true" type="checkbox" name="direct_input" id="direct_input" value="1" {if $admintab_directinput == '1'}checked{/if}>
{l s='Allow direct input' mod='squaremeter'}
</label>
<small class="form-text">{l s='If enabled, the final total is asked from the customer, instead of entering the dimensions and calculation the required total. For the minimum and maximum limits, the first dimension parameter\'s minimums and maximums will be assigned. For example if you are using the surface applet, it is the width limits to be used.' mod='squaremeter'}</small>
</div> {* Direct Input *}
<hr>
<div class="form-row" id="ratio_field"> {* Dimension Ratio *}
<label for="ratio">{l s='Ratio:' mod='squaremeter'}</label>
<input type="text" class="form-control edit" name="ratio" id="ratio" size="10" value="{if isset($admintab_ratio)}{$admintab_ratio|escape:'htmlall':'UTF-8'}{/if}" placeholder="Surface H:W, Volume H:W:D, Perimeter H:W."/>
<small class="form-text">{l s='Not mandatory, leave it blank if not required. Valid only applet having more than 1 dimensions like surface, volume and perimeter. If direct input is used, ratio is cancelled. Ratios cannot be decimal, but integer. If a ratio is entered, the dimensions are set based on the ratio delimited by colon. For example, a ratio of 3:2 for the surface applet means, 3 times Height requires 2 times Width (3x2). Surface H:W, Volume H:W:D, Perimeter H:W.' mod='squaremeter'}</small>
<hr>
</div> {* Dimension Ratio *}
<div class="form-row" id="step_field"> {* Increase/Decrease Step Value *}
<label for="step">{l s='Increase/Decrease Step Value' mod='squaremeter'}</label>
<input type="text" class="form-control edit" name="step" id="step" size="10" value="{if isset($step)}{$step|escape:'htmlall':'UTF-8'}{/if}" placeholder="{l s='(Default: 1)' mod='squaremeter'}" onchange="checkstep()" />
<small class="form-text">{l s='When the customer clicks on the up/down buttons, the value will be changed by the step value.' mod='squaremeter'}</small>
</div>
<p style="color:red;" id="error_step"></p>
{* Increase/Decrease Step Value *}
</div>
</div>
<div class="tab-pane" id="conversionOptions" role="tabpanel">
<div class="panel">
<div class="form-row">
<label>{l s='Conversion Setup:' mod='squaremeter'}</label>
</div>
<div class="form-row align-items-center" style="display:flex;padding-top:5px;padding-bottom:5px;" id="attselect_conv"> {* Conversion Value Setup (Normal) *}
<div class="col-sm-4">
<label>{l s='1 piece (quantity) equals to:' mod='squaremeter'}</label>
</div>
<div class="col-sm-4">
<input type="text" class="form-control edit" name="conversion" id="conversion" size="10" value="{if isset($admintab_conversion)}{$admintab_conversion|escape:'htmlall':'UTF-8'}{/if}" onchange="checktest()"/>
</div>
<div class="col-sm-4">
<select class="form-control" id="conversion_unit" name="conversion_unit" data-toggle="conversion_unit" data-minimumresultsforsearch="3" aria-hidden="true">
<option value="" {if $admintab_conversion_unit == ''}selected="selected"{/if} >{l s='Please choose' mod='squaremeter'}</option>
<optgroup label="Perimeter Units">
<option text="perimeter" id="perimeter" value="mm" {if $admintab_conversion_unit == 'mm'}selected="selected"{/if} >{l s='mm' mod='squaremeter'}</option>
<option text="perimeter" id="perimeter" value="cm" {if $admintab_conversion_unit == 'cm'}selected="selected"{/if} >{l s='cm' mod='squaremeter'}</option>
<option text="perimeter" id="perimeter" value="dm" {if $admintab_conversion_unit == 'dm'}selected="selected"{/if} >{l s='dm' mod='squaremeter'}</option>
<option text="perimeter" id="perimeter" value="m" {if $admintab_conversion_unit == 'm'}selected="selected"{/if} >{l s='m' mod='squaremeter'}</option>
</optgroup>
<optgroup label="Linear Units">
<option id="linear" value="mm" {if $admintab_conversion_unit == 'mm'}selected="selected"{/if} >{l s='mm' mod='squaremeter'}</option>
<option id="linear" value="cm" {if $admintab_conversion_unit == 'cm'}selected="selected"{/if} >{l s='cm' mod='squaremeter'}</option>
<option id="linear" value="dm" {if $admintab_conversion_unit == 'dm'}selected="selected"{/if} >{l s='dm' mod='squaremeter'}</option>
<option id="linear" value="m" {if $admintab_conversion_unit == 'm'}selected="selected"{/if} >{l s='m' mod='squaremeter'}</option>
</optgroup>
<optgroup label="Surface Units">
<option id="surface" value="mm2" {if $admintab_conversion_unit == 'mm2'}selected="selected"{/if} >{l s='mm2' mod='squaremeter'}</option>
<option id="surface" value="cm2" {if $admintab_conversion_unit == 'cm2'}selected="selected"{/if} >{l s='cm2' mod='squaremeter'}</option>
<option id="surface" value="dm2" {if $admintab_conversion_unit == 'dm2'}selected="selected"{/if} >{l s='dm2' mod='squaremeter'}</option>
<option id="surface" value="m2" {if $admintab_conversion_unit == 'm2'}selected="selected"{/if} >{l s='m2' mod='squaremeter'}</option>
</optgroup>
<optgroup label="Volume Units">
<option id="volume" value="mm3" {if $admintab_conversion_unit == 'mm3'}selected="selected"{/if} >{l s='mm3' mod='squaremeter'}</option>
<option id="volume" value="cm3" {if $admintab_conversion_unit == 'cm3'}selected="selected"{/if} >{l s='cm3' mod='squaremeter'}</option>
<option id="volume" value="dm3" {if $admintab_conversion_unit == 'dm3'}selected="selected"{/if} >{l s='dm3' mod='squaremeter'}</option>
<option id="volume" value="m3" {if $admintab_conversion_unit == 'm3'}selected="selected"{/if} >{l s='m3' mod='squaremeter'}</option>
</optgroup>
<optgroup label="Weight Units">
<option id="weight" value="mg" {if $admintab_conversion_unit == 'mg'}selected="selected"{/if} >{l s='mg' mod='squaremeter'}</option>
<option id="weight" value="cg" {if $admintab_conversion_unit == 'cg'}selected="selected"{/if} >{l s='cg' mod='squaremeter'}</option>
<option id="weight" value="dg" {if $admintab_conversion_unit == 'dg'}selected="selected"{/if} >{l s='dg' mod='squaremeter'}</option>
<option id="weight" value="g" {if $admintab_conversion_unit == 'g'}selected="selected"{/if} >{l s='g' mod='squaremeter'}</option>
<option id="weight" value="dag" {if $admintab_conversion_unit == 'dag'}selected="selected"{/if} >{l s='dag' mod='squaremeter'}</option>
<option id="weight" value="hg" {if $admintab_conversion_unit == 'hg'}selected="selected"{/if} >{l s='hg' mod='squaremeter'}</option>
<option id="weight" value="kg" {if $admintab_conversion_unit == 'kg'}selected="selected"{/if} >{l s='kg' mod='squaremeter'}</option>
<option id="weight" value="ton" {if $admintab_conversion_unit == 'ton'}selected="selected"{/if} >{l s='ton' mod='squaremeter'}</option>
</optgroup>
</select>
</div>
<small class="form-text">{l s='If you write 1 piece equals to 100 m2, the quantity field will be adjusted accordingly. To simply put, quantity will change 1 ea on every 100 m2 calculation. Ex: Width is entered 10 m. and height is entered 5 m., it makes 10x5 = 50 m2. It is roundedup to 100m2 and quantity field will be 1. If width is entered 10 m. and height is entered 20 m., it makes 10x20 = 200 m2, so the quantity will be 2.' mod='squaremeter'}</small>
</div> {* Conversion Value Setup (Normal) *}
<div class="form-row align-items-center" style="display:flex;padding-top:5px;padding-bottom:5px;" id="attselect_attr"> {* Conversion Value Setup (Attribute) *}
<div class="col-sm-4">
<label>{l s='Attribute group name and attribute unit:' mod='squaremeter'}</label>
</div>
<div class="col-sm-4">
<select class="form-control" id="attribute" name="attribute" data-toggle="attribute" data-minimumresultsforsearch="3" aria-hidden="true" onchange="checktest()">
{foreach from=$admintab_attributesListProduct key=k item=attributes}
<option value="{$attributes.id_attribute_group|escape:'htmlall':'UTF-8'}" {if ($admintab_attribute == $attributes.id_attribute_group)}selected="selected"{/if} >{$attributes.public_name|escape:'htmlall':'UTF-8'}</option>
{/foreach}
</select>
</div>
<div class="col-sm-4">
<select class="form-control" id="attribute_unit" name="attribute_unit" data-toggle="attribute_unit" data-minimumresultsforsearch="3" aria-hidden="true">
<option value="" {if $admintab_attribute_unit == ''}selected="selected"{/if} >{l s='Please choose' mod='squaremeter'}</option>
<option id="perimeter" value="mm" {if $admintab_attribute_unit == 'mm'}selected="selected"{/if} >{l s='mm' mod='squaremeter'}</option>
<option id="perimeter" value="cm" {if $admintab_attribute_unit == 'cm'}selected="selected"{/if} >{l s='cm' mod='squaremeter'}</option>
<option id="perimeter" value="dm" {if $admintab_attribute_unit == 'dm'}selected="selected"{/if} >{l s='dm' mod='squaremeter'}</option>
<option id="perimeter" value="m" {if $admintab_attribute_unit == 'm'}selected="selected"{/if} >{l s='m' mod='squaremeter'}</option>
<option id="linear" value="mm" {if $admintab_attribute_unit == 'mm'}selected="selected"{/if} >{l s='mm' mod='squaremeter'}</option>
<option id="linear" value="cm" {if $admintab_attribute_unit == 'cm'}selected="selected"{/if} >{l s='cm' mod='squaremeter'}</option>
<option id="linear" value="dm" {if $admintab_attribute_unit == 'dm'}selected="selected"{/if} >{l s='dm' mod='squaremeter'}</option>
<option id="linear" value="m" {if $admintab_attribute_unit == 'm'}selected="selected"{/if} >{l s='m' mod='squaremeter'}</option>
<option id="surface" value="mm2" {if $admintab_attribute_unit == 'mm2'}selected="selected"{/if} >{l s='mm2' mod='squaremeter'}</option>
<option id="surface" value="cm2" {if $admintab_attribute_unit == 'cm2'}selected="selected"{/if} >{l s='cm2' mod='squaremeter'}</option>
<option id="surface" value="dm2" {if $admintab_attribute_unit == 'dm2'}selected="selected"{/if} >{l s='dm2' mod='squaremeter'}</option>
<option id="surface" value="m2" {if $admintab_attribute_unit == 'm2'}selected="selected"{/if} >{l s='m2' mod='squaremeter'}</option>
<option id="volume" value="mm3" {if $admintab_attribute_unit == 'mm3'}selected="selected"{/if} >{l s='mm3' mod='squaremeter'}</option>
<option id="volume" value="cm3" {if $admintab_attribute_unit == 'cm3'}selected="selected"{/if} >{l s='cm3' mod='squaremeter'}</option>
<option id="volume" value="dm3" {if $admintab_attribute_unit == 'dm3'}selected="selected"{/if} >{l s='dm3' mod='squaremeter'}</option>
<option id="volume" value="m3" {if $admintab_attribute_unit == 'm3'}selected="selected"{/if} >{l s='m3' mod='squaremeter'}</option>
<option id="weight" value="mg" {if $admintab_attribute_unit == 'mg'}selected="selected"{/if} >{l s='mg' mod='squaremeter'}</option>
<option id="weight" value="cg" {if $admintab_attribute_unit == 'cg'}selected="selected"{/if} >{l s='cg' mod='squaremeter'}</option>
<option id="weight" value="dg" {if $admintab_attribute_unit == 'dg'}selected="selected"{/if} >{l s='dg' mod='squaremeter'}</option>
<option id="weight" value="g" {if $admintab_attribute_unit == 'g'}selected="selected"{/if} >{l s='g' mod='squaremeter'}</option>
<option id="weight" value="dag" {if $admintab_attribute_unit == 'dag'}selected="selected"{/if} >{l s='dag' mod='squaremeter'}</option>
<option id="weight" value="hg" {if $admintab_attribute_unit == 'hg'}selected="selected"{/if} >{l s='hg' mod='squaremeter'}</option>
<option id="weight" value="kg" {if $admintab_attribute_unit == 'kg'}selected="selected"{/if} >{l s='kg' mod='squaremeter'}</option>
<option id="weight" value="ton" {if $admintab_attribute_unit == 'ton'}selected="selected"{/if} >{l s='ton' mod='squaremeter'}</option>
</select>
</div>
<small class="form-text">{l s='Please enter the attribute id number and the unit of the attribute for the calculated dimension to be converted.' mod='squaremeter'}</small>
</div> {* Conversion Value Setup (Attribute) *}
<p style="color:red;" id="errort7"></p>
<p style="color:red;" id="errort"></p>
<hr>
<div class="form-row" id="direct_input_field"> {* Attribute Selection *}
<label for="attselect">
<input data-toggle="switch" class="" data-inverse="true" type="checkbox" name="attselect" id="attselect" value="1" {if $admintab_attselect}checked{/if}>
{l s='Use an attribute group for the conversion.' mod='squaremeter'}
</label>
<small class="form-text">{l s='With the attribute conversion, you can enter as many conversion values as you want in condition, they are gathered under one attribute id.' mod='squaremeter'}</small>
</div> {* Attribute Selection *}
<hr>
<div class="form-row"> {* Second Conversion Option *}
<label>{l s='Second Conversion Option:' mod='squaremeter'}</label>
</div>
<div class="form-row align-items-center" style="display:flex;padding-top:5px;padding-bottom:5px;">
<div class="col-sm-5">
<label for="secconversionselect">
<input data-toggle="switch" class="" data-inverse="true" type="checkbox" name="secconversionselect" id="secconversionselect" value="1" {if $admintab_secconversionselect}checked{/if}>
{l s='Use a second conversion step' mod='squaremeter'}
</label>
</div>
<div class="col-sm-5" id="second_conversion">
<label>{l s='1 piece (quantity) of first conversion unit equals to:' mod='squaremeter'}</label>
<input type="text" class="form-control edit" name="secconversion" id="secconversion" size="10" value="{if isset($admintab_secconversion)}{$admintab_secconversion|escape:'htmlall':'UTF-8'}{/if}" onchange="checktest()" />
</div>
<small class="form-text">{l s='Description: You have different liters of color boxes like 1L, 4L, 8L. Each liters covers wall of 10 m2. Then the entered/calculated dimension of surface is divided by the box conversion (Ex:1,4,8) which is the primary conversion, then the coming result should be divided to the secondary conversion which is 10 to find the quantity needed. The conversion unit should be m2 in this example.' mod='squaremeter'}</small>
</div>
{* Second Conversion Option *}
</div>
</div>
<div class="tab-pane" id="pricingOptions" role="tabpanel">
<div class="panel">
<div class="form-row"> {* Total Price Display *}
<label class="form-control-label" for="display_price">{l s='Total Price Display Options:' mod='squaremeter'}</label>
<select class="form-control" id="display_price" name="display_price" data-toggle="display_price" data-minimumresultsforsearch="3" aria-hidden="true">
<option value="" {if $admintab_dispprice == ''}selected="selected"{/if} >{l s='Please choose' mod='squaremeter'}</option>
<option value="pricebutton" {if $admintab_dispprice == 'pricebutton'}selected="selected"{/if} >{l s='Native price is visible and total price with button click' mod='squaremeter'}</option>
<option value="nopricebutton" {if $admintab_dispprice == 'nopricebutton'}selected="selected"{/if} >{l s='Native price is hidden and total price with button click' mod='squaremeter'}</option>
<option value="pricetotalprice" {if $admintab_dispprice == 'pricetotalprice'}selected="selected"{/if} >{l s='Native price and total price are visible (Recommended)' mod='squaremeter'}</option>
<option value="nopricetotalprice" {if $admintab_dispprice == 'nopricetotalprice'}selected="selected"{/if} >{l s='Native price is hidden and total price is visible' mod='squaremeter'}</option>
<option value="pricenototalprice" {if $admintab_dispprice == 'pricenototalprice'}selected="selected"{/if} >{l s='(Normal) Native price is visible and no total price' mod='squaremeter'}</option>
</select>
<small class="form-text">{l s='Choose the appropriate one according to your case.' mod='squaremeter'}</small>
</div> {* Total Price Display *}
<hr>
<div class="form-row"> {* Custom Base Price *}
<label for="reserve">{l s='Custom Base price:' mod='squaremeter'}</label>
<input type="text" class="form-control edit" name="reserve" id="reserve" size="10" value="{if isset($admintab_reserve)}{$admintab_reserve|escape:'htmlall':'UTF-8'}{/if}"/>
<small class="form-text">{l s='If the total price calculated is below the base price, the total price is equal to the base price. For example, if 1 m is $5 and the customer orders 2m, and if the base price is $20, then the calculated total will be $20 as 2 x 5 < 20. If empty, base price is ignored.' mod='squaremeter'}</small>
</div> {* Custom Base Price *}
<hr>
<div class="form-row"> {* Unit Price as Base Price *}
<label for="unit_baseprice">
<input data-toggle="switch" class="" data-inverse="true" type="checkbox" name="unit_baseprice" id="unit_baseprice" value="1" {if $admintab_unit_baseprice == '1'}checked{/if}>
{l s='Use Unit Price as Base Price' mod='squaremeter'}
</label>
<small class="form-text">{l s='If enabled, the unit price will be used as base price. If the total price calculated is below the unit price, the total price is equal to the unit price. For example, if 1 unit is $5 and the customer enters a dimension having a total price of $3, then the calculated total will be $5 as 3 < 5.' mod='squaremeter'}</small>
</div> {* Unit Price as Starting Price *}
<hr>
<div class="form-row"> {* Starting Price *}
<label for="startingprice">{l s='Starting price:' mod='squaremeter'}</label>
<input type="text" class="form-control edit" name="startingprice" id="startingprice" size="10" value="{if isset($admintab_startingprice)}{$admintab_startingprice|escape:'htmlall':'UTF-8'}{/if}"/>
<small class="form-text">{l s='The calculated price will start from the starting price. For example, if 1 m is $5 and the customer orders 2m, and if the starting price is $10, then the calculated total will be 10 + 2 x 5 = $20. If empty, starting price is ignored. ' mod='squaremeter'}</small>
</div> {* Starting Price *}
<hr>
<div class="form-row"> {* Extra Fee Option *}
<label>{l s='Extra Fee:' mod='squaremeter'}</label>
</div>
<div class="form-row align-items-center" style="display:flex;padding-top:5px;padding-bottom:5px;">
<div class="col-sm-5">
<label for="extrafee_select">
<input data-toggle="switch" class="" data-inverse="true" type="checkbox" name="extrafee_select" id="extrafee_select" value="1" {if $admintab_extrafee_select}checked{/if}>
{l s='If checked, extra fee option will be visible.' mod='squaremeter'}
</label>
</div>
<div class="col-sm-5">
<input type="text" class="form-control edit" name="displayextrafee" id="displayextrafee" size="10" value="{if isset($admintab_extrafee)}{$admintab_extrafee|escape:'htmlall':'UTF-8'}{/if}" placeholder="{l s='Fee Value' mod='squaremeter'}"/>
</div>
<small class="form-text">{l s='The stated extra fee will be added to the total price, if the checkbox is selected by the customer.' mod='squaremeter'}</small>
</div> {* Extra Fee Option *}
<hr>
<div class="form-row"> {* Waste Percentage Option *}
<label>{l s='Waste Percentage Increase Option:' mod='squaremeter'}</label>
</div>
<div class="form-row align-items-center" style="display:flex;padding-top:5px;padding-bottom:5px;">
<div class="col-sm-6">
<label for="waste_select">
<input data-toggle="switch" class="" data-inverse="true" type="checkbox" name="waste_select" id="waste_select" value="1" {if $admintab_waste_select}checked{/if}>
{l s='If checked, percentage increase for waste option will be visible.' mod='squaremeter'}
</label>
</div>
<div class="col-sm-4 input-group">
<input type="text" class="form-control edit" name="displaywaste" id="displaywaste" size="10" value="{if isset($admintab_waste)}{$admintab_waste|escape:'htmlall':'UTF-8'}{/if}" placeholder="{l s='Waste Percentage Amount:' mod='squaremeter'}"/>
<div class="input-group-append">
<span class="input-group-text">%</span>
</div>
</div>
<small class="form-text">{l s='The stated percentage will be added to the total dimension for the waste, if the checkbox is selected by the customer.' mod='squaremeter'}</small>
</div> {* Waste Percentage Option *}
</div>
</div>
<div class="tab-pane" id="minMaxLimits" role="tabpanel">
<div class="panel">
{* Height Settings *}
<fieldset id="height" style="border:none;">
<p>{l s='Height Limits' mod='squaremeter'}</p>
<div class="form-row align-items-center" style="display:flex;padding-top:5px;padding-bottom:5px;">
<div class="col-sm-3">
<label for="minimum_height">{l s='Min. Height Value (Ex: 1):' mod='squaremeter'}
<input type="text" class="form-control edit" name="minimum_height" id="minimum_height" size="10" value="{if isset($admintab_minheight)}{$admintab_minheight|escape:'html':'UTF-8'}{/if}" onchange="checktest()"/>
</label>
</div>
<div class="col-sm-3">
<label for="maximum_height">{l s='Max. Height Value (Ex: 20):' mod='squaremeter'}
<input type="text" class="form-control edit" name="maximum_height" id="maximum_height" size="10" value="{if isset($admintab_maxheight)}{$admintab_maxheight|escape:'htmlall':'UTF-8'}{/if}" onchange="checktest()"/>
</label>
</div>
<div class="col-sm-3">
<label for="maximum_height_unit">{l s='Unit:' mod='squaremeter'}
<select class="form-control" name="maximum_height_unit" id="maximum_height_unit" data-toggle="maximum_height_unit" data-minimumresultsforsearch="3" aria-hidden="true">
<option value="" {if $admintab_maxheight_unit == ''}selected="selected"{/if} >{l s='Please choose unit' mod='squaremeter'}</option>
<option value="mm" {if $admintab_maxheight_unit == 'mm'}selected="selected"{/if} >{l s='mm' mod='squaremeter'}</option>
<option value="cm" {if $admintab_maxheight_unit == 'cm'}selected="selected"{/if} >{l s='cm' mod='squaremeter'}</option>
<option value="dm" {if $admintab_maxheight_unit == 'dm'}selected="selected"{/if} >{l s='dm' mod='squaremeter'}</option>
<option value="m" {if $admintab_maxheight_unit == 'm'}selected="selected"{/if} >{l s='m' mod='squaremeter'}</option>
</select>
</label>
</div>
</div>
<small class="form-text">{l s='Customer will not be allowed to increase or decrease the applet\'s value above/below the limits.' mod='squaremeter'}</small>
<div class="form-row">
<label for="step_height">{l s='Height Step Value:' mod='squaremeter'}</label>
<input type="text" class="form-control edit" name="step_height" id="step_height" size="10" value="{if isset($step_height)}{$step_height|escape:'htmlall':'UTF-8'}{/if}" onchange="checkstep_height()"/>
</div>
<small class="form-text">{l s='If a step value is entered, this value will be used for the input field instead of the global step value. Leave it empty to use the global step value.' mod='squaremeter'}</small>
<div class="form-row">
<label for="_heightcheck">
<input data-toggle="switch" class="" data-inverse="true" type="checkbox" name="heightcheck" id="_heightcheck" value="1" {if $admintab_heightcheck == '1'}checked{/if}>
{l s='Use Dropdown box' mod='squaremeter'}
</label>
<div class="warning-feedback" id="height_dropdown_warning"></div>
</div>
<small class="form-text">{l s='If checked, select options in between min. and max. values are generated using the step values.' mod='squaremeter'}</small>
<p style="color:red;" id="errort1"></p>
<p style="color:red;" id="errort1_"></p>
<p style="color:red;" id="error_height"></p>
<p style="color:red;" id="error_step_height"></p>
<hr>
</fieldset>
{* Height Settings *}
{* Width Settings *}
<fieldset id="width" style="border:none;">
<p>{l s='Width Limits' mod='squaremeter'}</p>
<div class="form-row align-items-center" style="display:flex;padding-top:5px;padding-bottom:5px;">
<div class="col-sm-3">
<label for="minimum_width">{l s='Min. Width Value (Ex: 1):' mod='squaremeter'}
<input type="text" class="form-control edit" name="minimum_width" id="minimum_width" size="10" value="{if isset($admintab_minwidth)}{$admintab_minwidth|escape:'html':'UTF-8'}{/if}" onchange="checktest()"/>
</label>
</div>
<div class="col-sm-3">
<label for="maximum_width">{l s='Max. Width Value (Ex: 20):' mod='squaremeter'}
<input type="text" class="form-control edit" name="maximum_width" id="maximum_width" size="10" value="{if isset($admintab_maxwidth)}{$admintab_maxwidth|escape:'htmlall':'UTF-8'}{/if}" onchange="checktest()"/>
</label>
</div>
<div class="col-sm-3">
<label for="maximum_width_unit">{l s='Unit:' mod='squaremeter'}
<select class="form-control" name="maximum_width_unit" id="maximum_width_unit" data-toggle="maximum_width_unit" data-minimumresultsforsearch="3" aria-hidden="true">
<option value="" {if $admintab_maxwidth_unit == ''}selected="selected"{/if} >{l s='Please choose unit' mod='squaremeter'}</option>
<option value="mm" {if $admintab_maxwidth_unit == 'mm'}selected="selected"{/if} >{l s='mm' mod='squaremeter'}</option>
<option value="cm" {if $admintab_maxwidth_unit == 'cm'}selected="selected"{/if} >{l s='cm' mod='squaremeter'}</option>
<option value="dm" {if $admintab_maxwidth_unit == 'dm'}selected="selected"{/if} >{l s='dm' mod='squaremeter'}</option>
<option value="m" {if $admintab_maxwidth_unit == 'm'}selected="selected"{/if} >{l s='m' mod='squaremeter'}</option>
</select>
</label>
</div>
</div>
<small class="form-text">{l s='Customer will not be allowed to increase or decrease the applet\'s value above/below the limits.' mod='squaremeter'}</small>
<div class="form-row">
<label for="step_width">{l s='Width Step Value:' mod='squaremeter'}</label>
<input type="text" class="form-control edit" name="step_width" id="step_width" size="10" value="{if isset($step_width)}{$step_width|escape:'htmlall':'UTF-8'}{/if}" onchange="checkstep_width()"/>
</div>
<small class="form-text">{l s='If a step value is entered, this value will be used for the input field instead of the global step value. Leave it empty to use the global step value.' mod='squaremeter'}</small>
<div class="form-row">
<label for="_widthcheck">
<input data-toggle="switch" class="" data-inverse="true" type="checkbox" name="widthcheck" id="_widthcheck" value="1" {if $admintab_widthcheck == '1'}checked{/if}>
{l s='Use Dropdown box' mod='squaremeter'}
</label>
<div class="warning-feedback" id="width_dropdown_warning"></div>
</div>
<small class="form-text">{l s='If checked, select options in between min. and max. values are generated using the step values.' mod='squaremeter'}</small>
<p style="color:red;" id="errort2"></p>
<p style="color:red;" id="errort2_"></p>
<p style="color:red;" id="error_width"></p>
<p style="color:red;" id="error_step_width"></p>
<hr>
</fieldset>
{* Width Settings *}
{* Depth Settings *}
<fieldset id="depth" style="border:none;">
<p>{l s='Depth Limits' mod='squaremeter'}</p>
<div class="form-row align-items-center" style="display:flex;padding-top:5px;padding-bottom:5px;">
<div class="col-sm-3">
<label for="minimum_depth">{l s='Min. Depth Value (Ex: 1):' mod='squaremeter'}
<input type="text" class="form-control edit" name="minimum_depth" id="minimum_depth" size="10" value="{if isset($admintab_mindepth)}{$admintab_mindepth|escape:'html':'UTF-8'}{/if}" onchange="checktest()"/>
</label>
</div>
<div class="col-sm-3">
<label for="maximum_depth">{l s='Max. Depth Value (Ex: 20):' mod='squaremeter'}
<input type="text" class="form-control edit" name="maximum_depth" id="maximum_depth" size="10" value="{if isset($admintab_maxdepth)}{$admintab_maxdepth|escape:'htmlall':'UTF-8'}{/if}" onchange="checktest()"/>
</label>
</div>
<div class="col-sm-3">
<label for="maximum_depth_unit">{l s='Unit:' mod='squaremeter'}
<select class="form-control" name="maximum_depth_unit" id="maximum_depth_unit" data-toggle="maximum_depth_unit" data-minimumresultsforsearch="3" aria-hidden="true">
<option value="" {if $admintab_maxdepth_unit == ''}selected="selected"{/if} >{l s='Please choose unit' mod='squaremeter'}</option>
<option value="mm" {if $admintab_maxdepth_unit == 'mm'}selected="selected"{/if} >{l s='mm' mod='squaremeter'}</option>
<option value="cm" {if $admintab_maxdepth_unit == 'cm'}selected="selected"{/if} >{l s='cm' mod='squaremeter'}</option>
<option value="dm" {if $admintab_maxdepth_unit == 'dm'}selected="selected"{/if} >{l s='dm' mod='squaremeter'}</option>
<option value="m" {if $admintab_maxdepth_unit == 'm'}selected="selected"{/if} >{l s='m' mod='squaremeter'}</option>
</select>
</label>
</div>
</div>
<small class="form-text">{l s='Customer will not be allowed to increase or decrease the applet\'s value above/below the limits.' mod='squaremeter'}</small>
<div class="form-row">
<label for="step_depth">{l s='Depth Step Value:' mod='squaremeter'}</label>
<input type="text" class="form-control edit" name="step_depth" id="step_depth" size="10" value="{if isset($step_depth)}{$step_depth|escape:'htmlall':'UTF-8'}{/if}" onchange="checkstep_depth()"/>
</div>
<small class="form-text">{l s='If a step value is entered, this value will be used for the input field instead of the global step value. Leave it empty to use the global step value.' mod='squaremeter'}</small>
<div class="form-row">
<label for="_depthcheck">
<input data-toggle="switch" class="" data-inverse="true" type="checkbox" name="depthcheck" id="_depthcheck" value="1" {if $admintab_depthcheck == '1'}checked{/if}>
{l s='Use Dropdown box' mod='squaremeter'}
</label>
<div class="warning-feedback" id="depth_dropdown_warning"></div>
</div>
<small class="form-text">{l s='If checked, select options in between min. and max. values are generated using the step values.' mod='squaremeter'}</small>
<p style="color:red;" id="errort4"></p>
<p style="color:red;" id="errort5_"></p>
<p style="color:red;" id="error_depth"></p>
<p style="color:red;" id="error_step_depth"></p>
</fieldset>
{* Depth Settings *}
{* Weight Settings *}
<fieldset id="weight" style="border:none;">
<p>{l s='Weight Limits' mod='squaremeter'}</p>
<div class="form-row align-items-center" style="display:flex;padding-top:5px;padding-bottom:5px;">
<div class="col-sm-3">
<label for="minimum_weight">{l s='Min. Weight Value (Ex: 1):' mod='squaremeter'}
<input type="text" class="form-control edit" name="minimum_weight" id="minimum_weight" size="10" value="{if isset($admintab_minweight)}{$admintab_minweight|escape:'html':'UTF-8'}{/if}" onchange="checktest()"/>
</label>
</div>
<div class="col-sm-3">
<label for="maximum_weight">{l s='Max. Weight Value (Ex: 20):' mod='squaremeter'}
<input type="text" class="form-control edit" name="maximum_weight" id="maximum_weight" size="10" value="{if isset($admintab_maxweight)}{$admintab_maxweight|escape:'htmlall':'UTF-8'}{/if}" onchange="checktest()"/>
</label>
</div>
<div class="col-sm-3">
<label for="maximum_weight_unit">{l s='Unit:' mod='squaremeter'}
<select class="form-control" name="maximum_weight_unit" id="maximum_weight_unit" data-toggle="maximum_weight_unit" data-minimumresultsforsearch="3" aria-hidden="true">
<option value="" {if $admintab_maxweight_unit == ''}selected="selected"{/if} >{l s='Please choose unit' mod='squaremeter'}</option>
<option value="mg" {if $admintab_maxweight_unit == 'mg'}selected="selected"{/if} >{l s='mg' mod='squaremeter'}</option>
<option value="cg" {if $admintab_maxweight_unit == 'cg'}selected="selected"{/if} >{l s='cg' mod='squaremeter'}</option>
<option value="dg" {if $admintab_maxweight_unit == 'dg'}selected="selected"{/if} >{l s='dg' mod='squaremeter'}</option>
<option value="g" {if $admintab_maxweight_unit == 'g'}selected="selected"{/if} >{l s='g' mod='squaremeter'}</option>
<option value="dag" {if $admintab_maxweight_unit == 'dag'}selected="selected"{/if} >{l s='dag' mod='squaremeter'}</option>
<option value="hg" {if $admintab_maxweight_unit == 'hg'}selected="selected"{/if} >{l s='hg' mod='squaremeter'}</option>
<option value="kg" {if $admintab_maxweight_unit == 'kg'}selected="selected"{/if} >{l s='kg' mod='squaremeter'}</option>
<option value="t" {if $admintab_maxweight_unit == 't'}selected="selected"{/if} >{l s='t' mod='squaremeter'}</option>
</select>
</label>
</div>
</div>
<small class="form-text">{l s='Customer will not be allowed to increase or decrease the applet\'s value above/below the limits.' mod='squaremeter'}</small>
<div class="form-row">
<label for="_weightcheck">
<input data-toggle="switch" class="" data-inverse="true" type="checkbox" name="weightcheck" id="_weightcheck" value="1" {if $admintab_weightcheck == '1'}checked{/if}>
{l s='Use Dropdown box' mod='squaremeter'}
</label>
<div class="warning-feedback" id="weight_dropdown_warning"></div>
</div>
<small class="form-text">{l s='If checked, select options in between min. and max. values are generated using the step values.' mod='squaremeter'}</small>
<p style="color:red;" id="errort8"></p>
<p style="color:red;" id="error_weight"></p>
</fieldset>
{* Weight Settings *}
</div>
</div>
</div>
</div>
{if ($psversion > '1.6.0.0') && ($psversion < '1.7.0.0')}
<div class="separation"></div>
<div class="clear">&nbsp;</div>
<div class="panel-footer"> <a href="{$link->getAdminLink('AdminProducts')|escape:'htmlall':'UTF-8'}" class="btn btn-default"><i class="process-icon-cancel"></i> {l s='Cancel' mod='squaremeter'}</a>
<button type="submit" name="submitAddproduct" id="desc-product-save" class="btn btn-default pull-right"><i class="process-icon-save"></i> {l s='Save' mod='squaremeter'}</button>
<button type="submit" name="submitAddproductAndStay" id="desc-product-save-and-stay" class="btn btn-default pull-right"><i class="process-icon-save"></i> {l s='Save and stay' mod='squaremeter'}</button>
</div>
{/if}
<script type="text/javascript" src="{$module_dir|escape:'html':'UTF-8'}views/js/product_admin.js"></script>
<script>
$(window).on('load', function(){
calc_type();
var IsChecked = $('input[name="attselect"]:checked').length > 0;
if (IsChecked)
checktest4();
else
checktest3();
{if $admintab_attselect}
$('#attselect').attr('checked', true);
{else}
$('#attselect').attr('checked', false);
{/if}
{if $admintab_secconversionselect}
$('#secconversionselect').attr('checked', true);
{else}
$('#secconversionselect').attr('checked', false);
{/if}
checkconversion();
});
</script>
<style>
.image-preview {
width:100px;
height:auto;
}
.col-sm-6, .col-sm-5, .col-sm-4, .col-sm-3 {
float:left;
}
.form-group {
display:grid;
}
.form-row {
margin-right: 10px;
}
#myTab {
left:0;
}
.panel {
overflow:auto;
overflow-x:hidden;
padding-left:10px;
padding-top:2px;
}
.tab-pane {
overflow:auto;
overflow-x:hidden;
}
.product-page .nav-tabs {
height: 3.625rem;
width: unset;
}
</style>
<!-- Square Meter Calculation Module -->