first commit

This commit is contained in:
2024-12-17 13:43:22 +01:00
commit 8e6cd8b410
21292 changed files with 3514826 additions and 0 deletions

View File

@@ -0,0 +1,688 @@
{*
* 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.1
* 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 -->

View File

@@ -0,0 +1,666 @@
{*
* 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.1
* 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="in" {if $admintab_conversion_unit == 'in'}selected="selected"{/if} >{l s='in' mod='squaremeter'}</option>
<option text="perimeter" id="perimeter" value="ft" {if $admintab_conversion_unit == 'ft'}selected="selected"{/if} >{l s='ft' mod='squaremeter'}</option>
<option text="perimeter" id="perimeter" value="yd" {if $admintab_conversion_unit == 'yd'}selected="selected"{/if} >{l s='yd' mod='squaremeter'}</option>
</optgroup>
<optgroup label="Linear Units">
<option id="linear" value="in" {if $admintab_conversion_unit == 'in'}selected="selected"{/if} >{l s='in' mod='squaremeter'}</option>
<option id="linear" value="ft" {if $admintab_conversion_unit == 'ft'}selected="selected"{/if} >{l s='ft' mod='squaremeter'}</option>
<option id="linear" value="yd" {if $admintab_conversion_unit == 'yd'}selected="selected"{/if} >{l s='yd' mod='squaremeter'}</option>
</optgroup>
<optgroup label="Surface Units">
<option id="surface" value="in2" {if $admintab_conversion_unit == 'in2'}selected="selected"{/if} >{l s='in2' mod='squaremeter'}</option>
<option id="surface" value="ft2" {if $admintab_conversion_unit == 'ft2'}selected="selected"{/if} >{l s='ft2' mod='squaremeter'}</option>
<option id="surface" value="yd2" {if $admintab_conversion_unit == 'yd2'}selected="selected"{/if} >{l s='yd2' mod='squaremeter'}</option>
<option id="surface" value="acre" {if $admintab_conversion_unit == 'acre'}selected="selected"{/if} >{l s='acre' mod='squaremeter'}</option>
</optgroup>
<optgroup label="Volume Units">
<option id="volume" value="in3" {if $admintab_conversion_unit == 'in3'}selected="selected"{/if} >{l s='in3' mod='squaremeter'}</option>
<option id="volume" value="ft3" {if $admintab_conversion_unit == 'ft3'}selected="selected"{/if} >{l s='ft3' mod='squaremeter'}</option>
<option id="volume" value="yd3" {if $admintab_conversion_unit == 'yd3'}selected="selected"{/if} >{l s='yd3' mod='squaremeter'}</option>
<option id="volume" value="acre-feet" {if $admintab_conversion_unit == 'acre-feet'}selected="selected"{/if} >{l s='acre-feet' mod='squaremeter'}</option>
</optgroup>
<optgroup label="Weight Units">
<option id="weight" value="oz" {if $admintab_conversion_unit == 'oz'}selected="selected"{/if} >{l s='oz' mod='squaremeter'}</option>
<option id="weight" value="lbs" {if $admintab_conversion_unit == 'lbs'}selected="selected"{/if} >{l s='lbs' mod='squaremeter'}</option>
<option id="weight" value="tn" {if $admintab_conversion_unit == 'tn'}selected="selected"{/if} >{l s='tn' 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="in" {if $admintab_attribute_unit == 'in'}selected="selected"{/if} >{l s='in' mod='squaremeter'}</option>
<option id="perimeter" value="ft" {if $admintab_attribute_unit == 'ft'}selected="selected"{/if} >{l s='ft' mod='squaremeter'}</option>
<option id="perimeter" value="yd" {if $admintab_attribute_unit == 'yd'}selected="selected"{/if} >{l s='yd' mod='squaremeter'}</option>
<option id="linear" value="in" {if $admintab_attribute_unit == 'in'}selected="selected"{/if} >{l s='in' mod='squaremeter'}</option>
<option id="linear" value="ft" {if $admintab_attribute_unit == 'ft'}selected="selected"{/if} >{l s='ft' mod='squaremeter'}</option>
<option id="linear" value="yd" {if $admintab_attribute_unit == 'yd'}selected="selected"{/if} >{l s='yd' mod='squaremeter'}</option>
<option id="surface" value="in2" {if $admintab_attribute_unit == 'in2'}selected="selected"{/if} >{l s='in2' mod='squaremeter'}</option>
<option id="surface" value="ft2" {if $admintab_attribute_unit == 'ft2'}selected="selected"{/if} >{l s='ft2' mod='squaremeter'}</option>
<option id="surface" value="yd2" {if $admintab_attribute_unit == 'yd2'}selected="selected"{/if} >{l s='yd2' mod='squaremeter'}</option>
<option id="surface" value="acre" {if $admintab_attribute_unit == 'acre'}selected="selected"{/if} >{l s='acre' mod='squaremeter'}</option>
<option id="volume" value="in3" {if $admintab_attribute_unit == 'in3'}selected="selected"{/if} >{l s='in3' mod='squaremeter'}</option>
<option id="volume" value="ft3" {if $admintab_attribute_unit == 'ft3'}selected="selected"{/if} >{l s='ft3' mod='squaremeter'}</option>
<option id="volume" value="yd3" {if $admintab_attribute_unit == 'yd3'}selected="selected"{/if} >{l s='yd3' mod='squaremeter'}</option>
<option id="volume" value="acre-feet" {if $admintab_attribute_unit == 'acre-feet'}selected="selected"{/if} >{l s='acre-feet' mod='squaremeter'}</option>
<option id="weight" value="oz" {if $admintab_attribute_unit == 'oz'}selected="selected"{/if} >{l s='oz' mod='squaremeter'}</option>
<option id="weight" value="lbs" {if $admintab_attribute_unit == 'lbs'}selected="selected"{/if} >{l s='lbs' mod='squaremeter'}</option>
<option id="weight" value="tn" {if $admintab_attribute_unit == 'tn'}selected="selected"{/if} >{l s='tn' 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 ft is $5 and the customer orders 2 ft, 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="in" {if $admintab_maxheight_unit == 'in'}selected="selected"{/if} >{l s='in' mod='squaremeter'}</option>
<option value="ft" {if $admintab_maxheight_unit == 'ft'}selected="selected"{/if} >{l s='ft' mod='squaremeter'}</option>
<option value="yd" {if $admintab_maxheight_unit == 'yd'}selected="selected"{/if} >{l s='yd' 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="in" {if $admintab_maxwidth_unit == 'in'}selected="selected"{/if} >{l s='in' mod='squaremeter'}</option>
<option value="ft" {if $admintab_maxwidth_unit == 'ft'}selected="selected"{/if} >{l s='ft' mod='squaremeter'}</option>
<option value="yd" {if $admintab_maxwidth_unit == 'yd'}selected="selected"{/if} >{l s='yd' 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="in" {if $admintab_maxdepth_unit == 'in'}selected="selected"{/if} >{l s='in' mod='squaremeter'}</option>
<option value="ft" {if $admintab_maxdepth_unit == 'ft'}selected="selected"{/if} >{l s='ft' mod='squaremeter'}</option>
<option value="yd" {if $admintab_maxdepth_unit == 'yd'}selected="selected"{/if} >{l s='yd' 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="oz" {if $admintab_maxweight_unit == 'oz'}selected="selected"{/if} >{l s='oz' mod='squaremeter'}</option>
<option value="lbs" {if $admintab_maxweight_unit == 'lbs'}selected="selected"{/if} >{l s='lbs' mod='squaremeter'}</option>
<option value="tn" {if $admintab_maxweight_unit == 'tn'}selected="selected"{/if} >{l s='tn' 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_e.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 -->

View File

@@ -0,0 +1,124 @@
{*
* 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.1
* 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.
*}
<div class="panel">
<h3><i class="icon icon-folder-open-alt"></i> {l s='Mass Update and Documents' mod='squaremeter'}</h3>
<div class="alert alert-info" role="alert">
<p class="alert-text">{l s='You can add surface/volume/length/perimeter/weight applet to the selected products at once. All previous entries will be replaced. To do this, Please export a sample CSV file first. By playing on this, import the CSV. If you need help for CSV file creation, click on the import CSV to MySQL button.' mod='squaremeter'}</p>
</div>
<fieldset class="field_container align_right">
<span class="import"
onclick="show_popup('popup_upload')">{l s='Import CSV to MySQL' mod='squaremeter'}</span>
<a href="{$path|escape:'htmlall':'UTF-8'}modules/squaremeter/controllers/admin/export.php" class="export">{l s='Export from MySQL to CSV' mod='squaremeter'}</a>
</fieldset>
<p>
&raquo; {l s='You can get a PDF documentation to configure this module' mod='squaremeter'} :
<ul>
<li><a href="../modules/squaremeter/libs/readme_nl.pdf" target="_blank">{l s='Dutch' mod='squaremeter'}</a></li>
<li><a href="../modules/squaremeter/libs/readme_en.pdf" target="_blank">{l s='English' mod='squaremeter'}</a></li>
<li><a href="../modules/squaremeter/libs/readme_fr.pdf" target="_blank">{l s='French' mod='squaremeter'}</a></li>
<li><a href="../modules/squaremeter/libs/readme_de.pdf" target="_blank">{l s='German' mod='squaremeter'}</a></li>
<li><a href="../modules/squaremeter/libs/readme_it.pdf" target="_blank">{l s='Italian' mod='squaremeter'}</a></li>
<li><a href="../modules/squaremeter/libs/readme_pl.pdf" target="_blank">{l s='Polish' mod='squaremeter'}</a></li>
<li><a href="../modules/squaremeter/libs/readme_pl.pdf" target="_blank">{l s='Portuguese' mod='squaremeter'}</a></li>
<li><a href="../modules/squaremeter/libs/readme_es.pdf" target="_blank">{l s='Spanish' mod='squaremeter'}</a></li>
<li><a href="../modules/squaremeter/libs/readme_tr.pdf" target="_blank">{l s='Turkish' mod='squaremeter'}</a></li>
</ul>
</p>
</div>
<!-- The popup for upload a csv file -->
<div id="popup_upload">
<div class="form_upload">
<span class="close" onclick="close_popup('popup_upload')">x</span>
<h2>{l s='Upload CSV file' mod='squaremeter'}</h2>
<form action="{$path|escape:'htmlall':'UTF-8'}modules/squaremeter/controllers/admin/import.php" method="post" enctype="multipart/form-data" target="_blank">
<input type="file" name="csv_file" id="csv_file" class="file_input">
<input value="{l s='Quick help' mod='squaremeter'}" id="help_btn" data-toggle="modal" data-target="#myModal" style="width:90px;">
<input type="submit" value="{l s='Upload file' mod='squaremeter'}" id="upload_btn" onclick="close_popup('popup_upload')">
</form>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<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">&times;</span>
</button>
<h4 class="modal-title" id="myModalLabel">{l s='IMPORTING INSTRUCTIONS' mod='squaremeter'}</h4>
</div>
<div class="modal-body">
<p>{l s='1. Please be sure that you have backed-up the ps_squaremeteradmin table.' mod='squaremeter'}</p>
<p>{l s='2. You can have a sample CSV file by clicking to the \'Export from MySQL to CSV\' button.' mod='squaremeter'}</p>
<p>{l s='3. CSV file data should be separated by commas.' mod='squaremeter'}</p>
<p>{l s='4. Document shape should be UNIX and encoding should be UTF-8 without BOM.' mod='squaremeter'}</p>
<p>{l s='5. id_shop: The shop id to which the product will be configured (integer and manadatory). Use 1 if you do not have multistore.' mod='squaremeter'}</p>
<p>{l s='6. id_product: The product id to which the dimensions will be added (integer and mandatory).' mod='squaremeter'}</p>
<p>{l s='7. displaycalculator: 1/empty to display the applet on the product page.' mod='squaremeter'}</p>
<p>{l s='8. displaypicture: 1/empty to display the hint picture on the dimension applet.' mod='squaremeter'}</p>
<p>{l s='9. calculationtype: surface/volume/linear/perimeter/weight type of the applet' mod='squaremeter'}</p>
<p>{l s='10. additionalquantity: 1/empty to display the additional quantity field on the dimension applet.' mod='squaremeter'}</p>
<p>{l s='11. directinput: 1/empty, if enabled, the final total is asked from the customer, instead of entering the dimensions and calculation the required total.' mod='squaremeter'}</p>
<p>{l s='12. displayquantity: decimalok/onevisible/oneinvisible/calcvisible/calcinvisible/onewithcalcvisible/onewithcalcinvisible order quantity display and price calculation options' mod='squaremeter'}</p>
<p>{l s='13. displayprice: pricebutton/nopricebutton/pricetotalprice/nopricetotalprice/pricenototalprice total price display options' mod='squaremeter'}</p>
<p>{l s='14. displayreserve: Base price with no currency if available (Ex: 20)' mod='squaremeter'}</p>
<p>{l s='15. unit_baseprice: This is a checkbox 1/empty, if the unit price will be used as base price, it should be 1, empty otherwise.' mod='squaremeter'}</p>
<p>{l s='16. displaystartingprice: Starting price with no currency if available (Ex: 20)' mod='squaremeter'}</p>
<p>{l s='17. displayextrafee: Extra fee option to be added onto the total cost (Ex: 20)' mod='squaremeter'}</p>
<p>{l s='18. displayextrafeeselect: This is a checkbox 1/empty, if extra fee option will be used, it should be 1, empty otherwise.' mod='squaremeter'}</p>
<p>{l s='19. displaywaste: Percentage increase amount which will be added on the total dimension (Ex: 10)' mod='squaremeter'}</p>
<p>{l s='20. displaywasteselect: This is a checkbox 1/empty, if waste increase option will be used, it should be 1, empty otherwise.' mod='squaremeter'}</p>
<p>{l s='21. conversion: Conversion value (Ex: 1)' mod='squaremeter'}</p>
<p>{l s='22. secconversionselect: This is a checkbox 1/empty, if second conversion scheme will be used, it should be 1, empty otherwise.' mod='squaremeter'}</p>
<p>{l s='23. secconversion: Conversion value (Ex: 10)' mod='squaremeter'}</p>
<p>{l s='24. conversionunit: Conversion unit based on the calculation type selected (Ex: m)' mod='squaremeter'}</p>
<p>{l s='25. attribute: Integer attribute id for the conversion (Ex: 4)' mod='squaremeter'}</p>
<p>{l s='26. attributeunit: Attribute unit based on the calculation type selected (Ex: m2)' mod='squaremeter'}</p>
<p>{l s='27. step: When the customer clicks on the up/down buttons, the value will be changed by the step value. (Ex: 0.5)' mod='squaremeter'}</p>
<p>{l s='28. disableapplet: 1/empty to display the "close calculator and use standard quantity" checkbox on the product page.' mod='squaremeter'}</p>
<p>{l s='29. allow_ordering_from_listing: 1/empty to allow ordering from product listing pages.' mod='squaremeter'}</p>
<p>{l s='30. attselect: This is a checkbox 1/empty, if attribute conversion will be used, it should be 1, empty otherwise.' mod='squaremeter'}</p>
<p>{l s='31. minheight: (Integer) Minimum height value (Ex: 0)' mod='squaremeter'}</p>
<p>{l s='32. maxheight: (Integer) Maximum height value (Ex: 99999)' mod='squaremeter'}</p>
<p>{l s='33. maxheightunit: Height unit based on the calculation type selected (Ex: m)' mod='squaremeter'}</p>
<p>{l s='34. heightcheck: This is a checkbox 1/empty, if dropdown box will be used to enter dimensions, it should be 1, empty otherwise.' mod='squaremeter'}</p>
<p>{l s='35. step_height: When the customer clicks on the up/down buttons, the value will be changed by the height step value. If empty, global step value is used. (Ex: 0.5)' mod='squaremeter'}</p>
<p>{l s='36. minwidth: (Integer) Minimum width value (Ex: 0)' mod='squaremeter'}</p>
<p>{l s='37. maxwidth: (Integer) Maximum width value (Ex: 99999)' mod='squaremeter'}</p>
<p>{l s='38. maxwidthunit: Width unit based on the calculation type selected (Ex: m)' mod='squaremeter'}</p>
<p>{l s='39. widthcheck: This is a checkbox 1/empty, if dropdown box will be used to enter dimensions, it should be 1, empty otherwise.' mod='squaremeter'}</p>
<p>{l s='40. step_width: When the customer clicks on the up/down buttons, the value will be changed by the width step value. If empty, global step value is used. (Ex: 0.5)' mod='squaremeter'}</p>
<p>{l s='41. mindepth: (Integer) Minimum depth value (Ex: 0)' mod='squaremeter'}</p>
<p>{l s='42. maxdepth: (Integer) Maximum depth value (Ex: 99999)' mod='squaremeter'}</p>
<p>{l s='43. maxdepthunit: Depth unit based on the calculation type selected (Ex: m)' mod='squaremeter'}</p>
<p>{l s='44. depthcheck: This is a checkbox 1/empty, if dropdown box will be used to enter dimensions, it should be 1, empty otherwise.' mod='squaremeter'}</p>
<p>{l s='45. step_depth: When the customer clicks on the up/down buttons, the value will be changed by the depth step value. If empty, global step value is used. (Ex: 0.5)' mod='squaremeter'}</p>
<p>{l s='46. minweight: (Integer) Minimum weight value (Ex: 0)' mod='squaremeter'}</p>
<p>{l s='47. maxweight: (Integer) Maximum weight value (Ex: 99999)' mod='squaremeter'}</p>
<p>{l s='48. maxweightunit: Weight unit based on the calculation type selected (Ex: kg)' mod='squaremeter'}</p>
<p>{l s='49. weightcheck: This is a checkbox 1/empty, if dropdown box will be used to enter dimensions, it should be 1, empty otherwise.' mod='squaremeter'}</p>
<p>{l s='50. ratio: Integer delimeted with colon. 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'}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-tertiary-outline btn-lg" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,19 @@
{*
* 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.1
* 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.
*}
<p>{l s='Something went wrong. Please read the quick help and try again.' mod='squaremeter'}</p>
<p><input type="button" value="Close this window" onclick="self.close()"></p>

View File

@@ -0,0 +1,19 @@
{*
* 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.1
* 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.
*}
<p>{l s='CSV file is imported successfully.' mod='squaremeter'}</p>
<p><input type="button" value="Close this window" onclick="self.close()"></p>

View File

@@ -0,0 +1,63 @@
<?php
/**
* 2007-2021 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-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,112 @@
{*
* 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.1
* 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 ($page_name == 'cart')}
<script src="{$module_dir|escape:'html':'UTF-8'}views/js/jquery-1.12.4.js"></script>
<script>
//jQuery().ready(function($) {
// unitPriceRemove();
//});
$(document).on('change', '.js-cart-line-product-quantity', function (event) {
initial = setTimeout(function() {
unitPriceRemove();
clearTimeout(initial);
}, 1500);
});
$(document).on('click', '.input-group-btn-vertical', function (event) {
initial = setTimeout(function() {
unitPriceRemove();
clearTimeout(initial);
}, 1500);
});
//function unitPriceRemove() {
// $('.unit-price-cart').hide();
//}
</script>
{/if}
{if ($page_name == 'product')}
{if $design_type == 'design2'} {*Design 2*}
{if ($admintab_type == 'linear')}
<script>
$(document).ready(function () {
{if !$admintab_widthcheck}
$('#quantity_wanted_alt').spinner({ min: {$admintab_minwidth|escape:'html':'UTF-8'}, max: {$admintab_maxwidth|escape:'html':'UTF-8'}, step:{if $step_width}{$step_width|escape:'html':'UTF-8'}{else}{$step|escape:'html':'UTF-8'}{/if}, showOn: 'both' });
{/if}
$('#quantity').spinner({ min: 1, showOn: 'both' });
});
</script>
{/if}
{if ($admintab_type == 'surface') || ($admintab_type == 'perimeter')}
<script>
$(document).ready(function () {
{if !$admintab_widthcheck}
$('#directinput').spinner({ min: {$admintab_minwidth|escape:'html':'UTF-8'}, max: {$admintab_maxwidth|escape:'html':'UTF-8'}, step:{if $step_width}{$step_width|escape:'html':'UTF-8'}{else}{$step|escape:'html':'UTF-8'}{/if}, showOn: 'both' });
{if !$admintab_directinput}
$('#quantity_wanted_alt').spinner({ min: {$admintab_minwidth|escape:'html':'UTF-8'}, max: {$admintab_maxwidth|escape:'html':'UTF-8'}, step:{if $step_width}{$step_width|escape:'html':'UTF-8'}{else}{$step|escape:'html':'UTF-8'}{/if}, showOn: 'both' });
{/if}
{/if}
{if !$admintab_heightcheck}
{if !$admintab_directinput}
$('#quantity_wanted_alth').spinner({ min: {$admintab_minheight|escape:'html':'UTF-8'}, max: {$admintab_maxheight|escape:'html':'UTF-8'}, step:{if $step_height}{$step_height|escape:'html':'UTF-8'}{else}{$step|escape:'html':'UTF-8'}{/if}, showOn: 'both' });
{/if}
{/if}
$('#quantity').spinner({ min: 1, showOn: 'both' });
});
</script>
{/if}
{if ($admintab_type == 'volume')}
<script>
$(document).ready(function () {
{if !$admintab_widthcheck}
$('#directinput').spinner({ min: {$admintab_minwidth|escape:'html':'UTF-8'}, max: {$admintab_maxwidth|escape:'html':'UTF-8'}, step:{if $step_width}{$step_width|escape:'html':'UTF-8'}{else}{$step|escape:'html':'UTF-8'}{/if}, showOn: 'both' });
{if !$admintab_directinput}
$('#quantity_wanted_alt').spinner({ min: {$admintab_minwidth|escape:'html':'UTF-8'}, max: {$admintab_maxwidth|escape:'html':'UTF-8'}, step:{if $step_width}{$step_width|escape:'html':'UTF-8'}{else}{$step|escape:'html':'UTF-8'}{/if}, showOn: 'both' });
{/if}
{/if}
{if !$admintab_heightcheck}
{if !$admintab_directinput}
$('#quantity_wanted_alth').spinner({ min: {$admintab_minheight|escape:'html':'UTF-8'}, max: {$admintab_maxheight|escape:'html':'UTF-8'}, step:{if $step_height}{$step_height|escape:'html':'UTF-8'}{else}{$step|escape:'html':'UTF-8'}{/if}, showOn: 'both' });
{/if}
{/if}
{if !$admintab_depthcheck}
{if !$admintab_directinput}
$('#quantity_wanted_altd').spinner({ min: {$admintab_mindepth|escape:'html':'UTF-8'}, max: {$admintab_maxdepth|escape:'html':'UTF-8'}, step:{if $step_depth}{$step_depth|escape:'html':'UTF-8'}{else}{$step|escape:'html':'UTF-8'}{/if}, showOn: 'both' });
{/if}
{/if}
$('#quantity').spinner({ min: 1, showOn: 'both' });
});
</script>
{/if}
{if ($admintab_type == 'weight')}
<script>
$(document).ready(function () {
{if !$admintab_weightcheck}
$('#quantity_wanted_alt').spinner({ min: {$admintab_minweight|escape:'html':'UTF-8'}, max: {$admintab_maxweight|escape:'htmlall':'UTF-8'}, step:{$step|escape:'htmlall':'UTF-8'}, showOn: 'both' });
{/if}
$('#quantity').spinner({ min: 1, showOn: 'both' });
});
</script>
{/if}
{/if}
{/if}
<!-- Square Meter Calculation Module -->

View File

@@ -0,0 +1,787 @@
{*
* 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.1
* 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.
*}
{if $psversion == ''}
{assign var='psversion' value=Configuration::get('PS_VERSION_DB')}
{/if}
{if ($page_name == 'product') AND isset($admintab_display)}
{if ($admintab_type == "linear")}
<!-- Square Meter Calculation Module -->
{if ($decimaltype == 'comma')}
{assign var="format" value="#.##0,00##"}
{else}
{assign var="format" value="#,##0.00##"}
{/if}
<script type="text/javascript">
var product_total_price = Number({$admintab_startingprice|escape:'htmlall':'UTF-8'}) + 0;
var product_calc_quantity = 1;
var qty_prod2 = 0;
var qty_prod3 = 0;
check_waste();
$(document).ready(function () {
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricebutton"))
$('.product-prices').hide();
//detect if the quantity field or applet dimensions changed and See the Calculated Total price
var searchValue = "";
var searchValue5 = "";
var oldLocation = location.href;
var running = true;
document.getElementById("quantity_wanted").readOnly=true;
totalpriceinfospecific();
prod();
$(document).on('change', '.product-variants [data-product-attribute]', function (event) {
initial = setTimeout(function() {
TextboxChanged();
//checkHrefChanged();
clearTimeout(initial);
}, 1500);
});
$(document).on('click', '.ui-spinner', function (event) {
TextboxChanged();
});
$(document).on('change', 'input', function (event) {
initial = setTimeout(function() {
TextboxChanged();
clearTimeout(initial);
}, 1000);
});
$(document).on('click', '.input-group-btn-vertical', function (event) {
TextboxChanged();
});
$(document).on('keyup', 'input', function (event) {
check_waste();
TextboxChanged();
});
$("input[name='discretion']").change(function(){
check_discretion();
});
$("input[name='waste']").change(function(){
check_waste();
});
$(document).on('click', '.ui-spinner-button, .ui-icon, .value-button', function (event) {
check_waste();
TextboxChanged();
});
$(document).on('click', '#totalprice_product_button', function (event) {
document.getElementById('totalpriceinfo').style.display = 'block';
});
setInterval(function() {
isCartValidCheck();
}, 1000);
function isCartValidCheck() {
var available_quantity = JSON.parse($('#product-details').attr('data-product'))["quantity"];
var allow_oosp = JSON.parse($('#product-details').attr('data-product'))["allow_oosp"];
if ((product_total_price == 0) || ((qty_prod3 > available_quantity) && (allow_oosp == 0))) {
$('.add-to-cart').addClass('squaremeter_disablecart');
$('.add').addClass('squaremeter_disablecart_wrapper');
if (product_total_price == 0) {
$("#squaremeter_availability").html("<span style='color:#f39d72;' class='material-icons'>remove_shopping_cart</span> {l s='Total price cannot be zero.' mod='squaremeter'}");
}
if ((qty_prod3 > available_quantity) && (allow_oosp == 0)) {
$("#squaremeter_availability").html("<span style='color:#f39d72;' class='material-icons'>remove_shopping_cart</span> {l s='Not enough stock is available.' mod='squaremeter'}");
}
}
else {
if (($(".product-unavailable")[0]) && ($(".product-unavailable:visible").length > 0)){
} else {
$('.add-to-cart').removeClass('squaremeter_disablecart');
$('.add').removeClass('squaremeter_disablecart_wrapper');
$('#squaremeter_availability').html('');
}
}
}
function TextboxChanged() {
if (running == true) {
prod();
}
}
function check_discretion()
{
var check1 = $('input[name="discretion"]:checked').length; // We are checking whether the switch is checked or not. If it is checked, the applet is visible.
var check2 = $('#quantity_wanted').is('[readonly]'); // We are checking whether the standard quantity input is readonly or not.
{if $design_type == "design1"}
if (check1 > 0) {
$('#squaremeter, #totalprice').show();
$(".qty").hide();
$(".qty").prev("span").hide();
$('.close_calculator').show();
$('.open_calculator').hide();
} else {
$('#squaremeter, #totalprice').hide();
$(".qty").show();
$(".qty").prev("span").show();
$('.close_calculator').hide();
$('.open_calculator').show();
}
if (check1 > 0) {
running = true;
$('input[name="discretion"]').val('on');
} else {
document.getElementById("quantity_wanted").readOnly=false;
running = false;
$('input[name="discretion"]').val('off');
}
{/if}
{if $design_type == "design2"}
if (("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onevisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "calcvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok")) { // We are checking whether the standard quantity field is visible or not at the page load.
if (check1 > 0) {
$('#squaremeter, #dimension, #totalprice').show();
$('.close_calculator').show();
$('.open_calculator').hide();
} else {
$('#squaremeter, #dimension, #totalprice').hide();
$('.close_calculator').hide();
$('.open_calculator').show();
}
$(".qty").show();
$(".qty").prev("span").show();
} else {
if (check1 > 0) {
$('#squaremeter, #dimension, #totalprice').show();
$(".qty").hide();
$(".qty").prev("span").hide();
$('.close_calculator').show();
$('.open_calculator').hide();
} else {
$('#squaremeter, #dimension, #totalprice').hide();
$(".qty").show();
$(".qty").prev("span").show();
$('.close_calculator').hide();
$('.open_calculator').show();
}
}
if (check1 > 0) {
running = true;
$('input[name="discretion"]').val('on');
} else {
document.getElementById("quantity_wanted").readOnly=false;
running = false;
$('input[name="discretion"]').val('off');
}
{/if}
}
});
function countDecimals (x){
if(Math.floor(x) === x) return 0;
return x.toString().split(".")[1].length || 0;
}
function check_waste()
{
{if ($admintab_waste_select|escape:'html':'UTF-8')}
var admintab_waste_select = {$admintab_waste_select|escape:'html':'UTF-8'};
{else}
var admintab_waste_select = '';
{/if}
{if $step_width > 0}
var step = {$step_width};
{else}
var step = {$step};
{/if}
if ((typeof waste_increase_percentage === 'undefined')) {
var step = 1;
}
var numofdecimal = countDecimals(step);
var waste_check = $('input[name="waste"]:checked').length;
if ((admintab_waste_select) && (waste_check > 0)) {
{if $admintab_directinput}
if ($('#wastevalue').val() > 0) {
waste_increase_percentage = 1;
} else {
waste_increase_percentage = 1 + Number({$admintab_waste|escape:'htmlall':'UTF-8'})/100;
$('#wastevalue').val(Number({$admintab_waste|escape:'htmlall':'UTF-8'}));
}
{else}
waste_increase_percentage = 1 + Number({$admintab_waste|escape:'htmlall':'UTF-8'})/100;
$('#wastevalue').val(Number({$admintab_waste|escape:'htmlall':'UTF-8'}));
{/if}
} else {
if ((typeof waste_increase_percentage !== 'undefined')) {
waste_increase_percentage = 1 + $('#wastevalue').val()/100;
{if $admintab_directinput}
{if $design_type == 'design1'}
var old_value = $('#directinput').val();
var rounded_old_value = (old_value/waste_increase_percentage).toFixed(numofdecimal);
$('#directinput').val(rounded_old_value);
{else}
var old_value = $('#quantity_wanted_alt').val();
var rounded_old_value = (old_value/waste_increase_percentage).toFixed(numofdecimal);
$('#quantity_wanted_alt').val(rounded_old_value);
{/if}
{else}
{if $design_type != 'design1'}
var old_value = $('#quantity_wanted_alt').val();
var rounded_old_value = (old_value/waste_increase_percentage).toFixed(numofdecimal);
$('#quantity_wanted_alt').val(rounded_old_value);
{/if}
{/if}
}
$('#wastevalue').val(0);
waste_increase_percentage = 1;
}
}
function check_directinput()
{
var qty_el_alt = document.getElementById('directinput');
var qty_alt = Number(qty_el_alt.value);
{if $design_type == 'design1'}
if (qty_alt < {$admintab_minwidth|escape:'html':'UTF-8'})
{
qty_el_alt.value = {$admintab_minwidth|escape:'html':'UTF-8'};
}
else if (isNaN( qty_alt ))
{
qty_el_alt.value = {$admintab_minwidth|escape:'html':'UTF-8'};
}
{else}
if (qty_alt<{$admintab_minwidth|escape:'html':'UTF-8'})
{
qty_el_alt.value = Number({$admintab_minwidth|escape:'html':'UTF-8'});
}
else if (qty_alt>{$admintab_maxwidth|escape:'htmlall':'UTF-8'})
{
qty_el_alt.value = Number({$admintab_maxwidth|escape:'htmlall':'UTF-8'});
}
else if (isNaN( qty_alt ))
{
qty_el_alt.value = Number({$admintab_minwidth|escape:'html':'UTF-8'});
}
{/if}
prod();
return false;
}
function check_width()
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value);
if (qty_alt<{$admintab_minwidth|escape:'html':'UTF-8'})
{
qty_el_alt.value = Number({$admintab_minwidth|escape:'html':'UTF-8'});
}
else if (qty_alt>{$admintab_maxwidth|escape:'htmlall':'UTF-8'})
{
qty_el_alt.value = Number({$admintab_maxwidth|escape:'htmlall':'UTF-8'});
}
else if (isNaN( qty_alt ))
{
qty_el_alt.value = Number({$admintab_minwidth|escape:'html':'UTF-8'});
}
prod();
return false;
}
function check_quantity()
{
var quantity = document.getElementById('quantity');
var quantity_value = Number(quantity.value);
if (quantity_value<1)
quantity.value = 1;
else if (isNaN( quantity_value ))
quantity.value = 1;
prod();
return false;
}
function prod()
{
{if $admintab_directinput && ($design_type == 'design1')}
{if $admintab_conversion_unit}
{$admintab_maxwidth_unit = $admintab_conversion_unit}
{else if ($admintab_attribute_unit)}
{$admintab_maxwidth_unit = $admintab_attribute_unit}
{/if}
{/if}
{if $unittype == 'metric'}
//Quantity in m
if ("{$admintab_conversion_unit|escape:'html':'UTF-8'}" == "m" || "{$admintab_attribute_unit|escape:'htmlall':'UTF-8'}" == "m")
{
if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "mm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = (Number(qty_el_alt.value))/1000;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "cm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = (Number(qty_el_alt.value))/100;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "dm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = (Number(qty_el_alt.value))/10;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "m")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value);
}
}
//Quantity in dm
if ("{$admintab_conversion_unit|escape:'html':'UTF-8'}" == "dm" || "{$admintab_attribute_unit|escape:'htmlall':'UTF-8'}" == "dm")
{
if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "mm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)/100;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "cm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)/10;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "dm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value);
}
else
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)*10;
}
}
//Quantity in cm
if ("{$admintab_conversion_unit|escape:'html':'UTF-8'}" == "cm"|| "{$admintab_attribute_unit|escape:'htmlall':'UTF-8'}" == "cm")
{
if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "mm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)/10;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "cm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value);
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "dm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)*10;
}
else
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)*100;
}
}
//Quanitity in mm
if ("{$admintab_conversion_unit|escape:'html':'UTF-8'}" == "mm" || "{$admintab_attribute_unit|escape:'htmlall':'UTF-8'}" == "mm")
{
if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "mm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value);
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "cm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)*10;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "dm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)*100;
}
else
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)*1000;
}
}
{else}
//Quantity in yd
if ("{$admintab_conversion_unit|escape:'html':'UTF-8'}" == "yd" || "{$admintab_attribute_unit|escape:'htmlall':'UTF-8'}" == "yd")
{
if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "in")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = (Number(qty_el_alt.value))/36;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "ft")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = (Number(qty_el_alt.value))/3;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "yd")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = (Number(qty_el_alt.value));
}
}
//Quantity in ft
if ("{$admintab_conversion_unit|escape:'html':'UTF-8'}" == "ft" || "{$admintab_attribute_unit|escape:'htmlall':'UTF-8'}" == "ft")
{
if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "in")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)/12;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "ft")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value);
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "yd")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)*3;
}
}
//Quanitity in in
if ("{$admintab_conversion_unit|escape:'html':'UTF-8'}" == "in" || "{$admintab_attribute_unit|escape:'htmlall':'UTF-8'}" == "in")
{
if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "in")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value);
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "ft")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)*12;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "yd")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)*36;
}
}
{/if}
{if $admintab_directinput}
{if $design_type == 'design1'}
var qty_el_directinput = document.getElementById('directinput');
var qty_directinput = Number(qty_el_directinput.value);
var multiplication = qty_directinput * waste_increase_percentage;
{else}
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value);
var multiplication = qty_alt * waste_increase_percentage;
{/if}
{else}
var multiplication = qty_alt * waste_increase_percentage;
{/if}
var qty_prod = document.getElementById('quantity_wanted');
var qty_production = Number(qty_prod.value);
{if $admintab_attselect}
var e = document.getElementById("group_" + {$admintab_attribute|escape:'htmlall':'UTF-8'});
if (e.tagName == "SELECT")
{
var selectedlength = e.options[e.selectedIndex].text;
} else {
var selectedlength = $( "input[name='group[{$admintab_attribute|escape:'htmlall':'UTF-8'}]']:checked" ).siblings("span").text()
}
selectedlength = selectedlength.replace(/[^0-9\.]/g, '');
{else}
var selectedlength = {$admintab_conversion|escape:'htmlall':'UTF-8'};
{/if}
{if $admintab_secconversionselect}
selectedlength = selectedlength*{$admintab_secconversion|escape:'htmlall':'UTF-8'};
{/if}
if ("{$admintab_addquan|escape:'htmlall':'UTF-8'}" == "1")
{
var req = document.getElementById('quantity');
var req_value = Number(req.value);
if (("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onevisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "oneinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok"))
{
qty_prod.value = 1;
qty_prod2 = Math.ceil((multiplication/selectedlength) * req_value);
//qty_prod3 = parseFloat(Math.round((multiplication/selectedlength) * req_value * 100) / 100).toFixed(2);
qty_prod3 = (multiplication/selectedlength) * req_value;
{if ($admintab_dispquan != "decimalok")}
if (qty_prod3 < 1)
qty_prod3 = 1;
{/if}
fulllength = multiplication * req_value;
extra = Math.ceil(multiplication * req_value / selectedlength) * selectedlength - fulllength;
}
else
qty_prod.value = Math.ceil((multiplication/selectedlength) * req_value);
if (qty_prod.value == 0)
qty_prod.value = 1;
if ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok")
//product_calc_quantity = parseFloat(Math.round((multiplication/selectedlength) * req_value * 100) / 100).toFixed(2);
product_calc_quantity = (multiplication/selectedlength) * req_value;
else
product_calc_quantity = Math.ceil((multiplication/selectedlength) * req_value);
var dimen=document.getElementById("dimension");
var unit={if $admintab_attselect}"{$admintab_attribute_unit|escape:'htmlall':'UTF-8'}"{else}"{$admintab_conversion_unit|escape:'html':'UTF-8'}"{/if};
if ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok")
dimen.innerHTML="{l s='Length' mod='squaremeter'}&nbsp;" + qty_el_alt.value + "&nbsp;{$admintab_maxwidth_unit|escape:'html':'UTF-8'},&nbsp;" + qty_prod3 + "&nbsp;{l s='ea' mod='squaremeter'}"{if ($dimensiondisplaytype == 'on')}+"<br>({l s='Calculated Total' mod='squaremeter'}&nbsp;" + format( "{$format|escape:'htmlall':'UTF-8'}", qty_alt*req_value) + "&nbsp;" + unit + ")"{else}+""{/if};
else
dimen.innerHTML="{l s='Length' mod='squaremeter'}&nbsp;" + qty_el_alt.value + "&nbsp;{$admintab_maxwidth_unit|escape:'html':'UTF-8'}&nbsp;" + req_value + "&nbsp;{l s='ea' mod='squaremeter'}"{if ($dimensiondisplaytype == 'on')}+"&nbsp;<br>({l s='Total' mod='squaremeter'}&nbsp;" + format("{$format|escape:'htmlall':'UTF-8'}", qty_alt*req_value) + "&nbsp;" + unit + ")({l s='Extra' mod='squaremeter'}&nbsp;" + format("{$format|escape:'htmlall':'UTF-8'}", extra) + "&nbsp;" + unit + ")"{else}+""{/if};
}
else
{
fulllength = multiplication;
extra = Math.ceil(multiplication / selectedlength) * selectedlength - fulllength;
if (("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onevisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "oneinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok"))
{
qty_prod.value = 1;
qty_prod2 = Math.ceil(multiplication/selectedlength);
//qty_prod3 = parseFloat(Math.round((multiplication/selectedlength) * 100) / 100).toFixed(2);
qty_prod3 = multiplication/selectedlength;
{if ($admintab_dispquan != "decimalok")}
if (qty_prod3 < 1)
qty_prod3 = 1;
{/if}
}
else
qty_prod.value = Math.ceil(multiplication/selectedlength);
if (qty_prod.value == 0)
qty_prod.value = 1;
if ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok")
//product_calc_quantity = parseFloat(Math.round((multiplication/selectedlength) * 100) / 100).toFixed(2);
product_calc_quantity = multiplication/selectedlength;
else
product_calc_quantity = Math.ceil(multiplication/selectedlength);
var dimen=document.getElementById("dimension");
var unit={if $admintab_attselect}"{$admintab_attribute_unit|escape:'htmlall':'UTF-8'}"{else}"{$admintab_conversion_unit|escape:'html':'UTF-8'}"{/if};
if ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok")
dimen.innerHTML="{l s='Length' mod='squaremeter'}&nbsp;" + parseFloat(multiplication).toFixed(2) + "&nbsp;{$admintab_maxwidth_unit|escape:'html':'UTF-8'},&nbsp;" + qty_prod3 + "&nbsp;{l s='ea' mod='squaremeter'}"{if ($dimensiondisplaytype == 'on')}+"<br>({l s='Calculated Total' mod='squaremeter'}&nbsp;" + format( "{$format|escape:'htmlall':'UTF-8'}", qty_alt) + "&nbsp;" + unit + ")"{else}+""{/if};
else
dimen.innerHTML="{l s='Length' mod='squaremeter'}&nbsp;" + parseFloat(multiplication).toFixed(2) + "&nbsp;{$admintab_maxwidth_unit|escape:'html':'UTF-8'}&nbsp;"{if ($dimensiondisplaytype == 'on')}+"<br>({l s='Total' mod='squaremeter'}&nbsp;" + format( "{$format|escape:'htmlall':'UTF-8'}", qty_alt) + "&nbsp;" + unit + ")({l s='Extra' mod='squaremeter'}&nbsp;" + format( "{$format|escape:'htmlall':'UTF-8'}", extra) + "&nbsp;" + unit + ")"{else}+""{/if};
}
if (typeof fulllength !== 'undefined') {
$('#calculated_total').val((fulllength).toFixed(4));
if ((typeof extra !== 'undefined') && ("{$admintab_dispquan|escape:'html':'UTF-8'}" != "decimalok")) {
$('#grand_calculated_total').val((fulllength).toFixed(4) + extra);
}
}
totalpriceinfospecific();
if(("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcvisible"))
{
var pricecurrencyval = $('meta[property="product:price:currency"]').attr('content');
var totalpriceinfo = document.getElementById("totalpriceinfo");
totalpriceinfo.innerHTML = "{l s='Total Price' mod='squaremeter'} : <span>" + pricecurrencyval + " " + format( "{$format|escape:'htmlall':'UTF-8'}", product_total_price) + "</span>";
}
var dimx = dimen.innerHTML;
dimx=dimx.replace(/&nbsp;/gi," ");
dimx=dimx.replace(/&amp;/gi,"&");
dimx=dimx.replace(/&quot;/gi,'"');
dimx=dimx.replace(/<br>/gi,', ');
dimx=dimx.replace(/&lt;/gi,'<');
dimx=dimx.replace(/&gt;/gi,'>');
document.getElementById("dim").value = dimx;
return false;
}
function calc_pos()
{
$('#squaremeter').insertBefore('.product-add-to-cart');
{if $design_type == 'design2'}
$('#dimension').insertBefore('.product-add-to-cart');
{/if}
if ("{$admintab_dispprice|escape:'html':'UTF-8'}"!="pricenototalprice")
$('#totalprice').insertBefore('.product-add-to-cart');
$('#switchx').insertBefore('.product-add-to-cart');
$('<span id="squaremeter_availability"></span>').insertBefore('.product-add-to-cart');
}
//totalpriceinfospecific function is the same for all dimension types
function totalpriceinfospecific()
{
if (("{$admintab_dispprice|escape:'html':'UTF-8'}"=="pricetotalprice") || ("{$admintab_dispprice|escape:'html':'UTF-8'}"=="nopricetotalprice"))
document.getElementById('totalpriceinfo').style.display = 'block';
var qty_prod = document.getElementById('quantity_wanted');
if(("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcvisible"))
var qty_production = qty_prod2;
else if ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok")
var qty_production = qty_prod3;
else
var qty_production = Number(qty_prod.value);
$('#converted_ea').val(qty_production.toFixed(4));
var pricecurrencyval = $('meta[property="product:price:currency"]').attr('content');
if ($("#product-details").length) {
window.pricenumberval = $("#product-details").data("product").price_amount;
} else {
window.pricenumberval = $('meta[property="product:price:amount"]').attr('content');
}
//if quantity discounts are available
// if ($("#product-details").length) {
// var qty_discount = $("#product-details").data("product").quantity_discounts;
// if(qty_discount.length > 0 && parseFloat(qty_discount[0].from_quantity) <= parseFloat(qty_production))
// {
// for(var i =0; i<qty_discount.length ; i++){
// if(parseFloat(qty_production) >= parseFloat(qty_discount[i].from_quantity)){
// var type_of_discount = qty_discount[i].discount.includes("%", 0);
// if (type_of_discount == true) {
// discount_amount = qty_discount[i].discount.replace('%','');
// pricenumberval = pricenumberval * (100 - discount_amount) /100;
// } else {
// pricenumberval = qty_discount[i].discount.replace(/[^0-9.,]/g, "").replace(/[,]/g, ".");
// }
//var iskonto = qty_discount[i].discount.replace(/[^0-9.,]/g, "").replace(/[,]/g, ".");
//pricenumberval = pricenumberval - iskonto;
//break;
// }
// }
// }
// }
$("#quantity_wanted").change();
var totalprice = Number({$admintab_startingprice|escape:'htmlall':'UTF-8'}) + qty_production * pricenumberval;
totalprice = Math.round((totalprice + Number.EPSILON) * 100) / 100; //We convert the price to 2 decimals
var totalpriceinfo = document.getElementById("totalpriceinfo");
$('#product_total_price_calc').val(totalprice);
if ($("#product-details").length) {
var pricenumberval = $("#product-details").data("product").price_amount;
} else {
var pricenumberval = $('meta[property="product:price:amount"]').attr('content');
}
if ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok")
product_total_price = Number({$admintab_startingprice|escape:'htmlall':'UTF-8'}) + parseFloat(product_calc_quantity) * pricenumberval;
else
product_total_price = Number({$admintab_startingprice|escape:'htmlall':'UTF-8'}) + parseInt(product_calc_quantity,10) * pricenumberval;
{if ($admintab_extrafee_select|escape:'html':'UTF-8')}
var admintab_extrafee_select = {$admintab_extrafee_select|escape:'html':'UTF-8'};
{else}
var admintab_extrafee_select = '';
{/if}
var fee_check = $('input[name="extrafee"]:checked').length;
if ((admintab_extrafee_select) && (fee_check > 0)) {
product_total_price = product_total_price + Number({$admintab_extrafee|escape:'htmlall':'UTF-8'});
$('#extrafeevalue').val(Number({$admintab_extrafee|escape:'htmlall':'UTF-8'}));
} else {
$('#extrafeevalue').val(0);
}
var cart_button_initial_status = $('.add-to-cart').attr("disabled");
if (cart_button_initial_status != "disabled") {
var available_quantity = JSON.parse($('#product-details').attr('data-product'))["quantity"];
var allow_oosp = JSON.parse($('#product-details').attr('data-product'))["allow_oosp"];
if ((product_total_price == 0) || ((qty_prod3 > available_quantity) && (allow_oosp == 0))) {
$('.add-to-cart').addClass('squaremeter_disablecart');
$('.add').addClass('squaremeter_disablecart_wrapper');
if ((qty_prod3 > available_quantity) && (allow_oosp == 0)) {
$("#squaremeter_availability").html("<span style='color:#f39d72;' class='material-icons'>remove_shopping_cart</span> {l s='Not enough stock is available.' mod='squaremeter'}");
}
} else {
if (($(".product-unavailable")[0]) && ($(".product-unavailable:visible").length > 0)){
} else {
$('.add-to-cart').removeClass('squaremeter_disablecart');
$('.add').removeClass('squaremeter_disablecart_wrapper');
$('#squaremeter_availability').html('');
}
}
}
if ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onevisible" || "{$admintab_dispquan|escape:'html':'UTF-8'}" == "oneinvisible") {
product_total_price = pricenumberval;
}
{if $admintab_unit_baseprice}
if(pricenumberval > product_total_price)
product_total_price = pricenumberval;
{/if}
{if $admintab_reserve}
if(Number("{$admintab_reserve|escape:'htmlall':'UTF-8'}")>product_total_price)
product_total_price = Number({$admintab_reserve|escape:'htmlall':'UTF-8'});
{/if}
product_total_price = Math.round((product_total_price + Number.EPSILON) * 100) / 100; //We convert the price to 2 decimals
if(!$("#product_total_price_calc").size())
$('<input type="hidden" name="product_total_price_calc" id="product_total_price_calc" value='+product_total_price+' />').appendTo('form#add-to-cart-or-refresh');
else
$("#product_total_price_calc").val(product_total_price);
if(("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok"))
totalprice = $('#product_total_price_calc').val();
totalpriceinfo.innerHTML = "{l s='Total Price' mod='squaremeter'} : <span>" + pricecurrencyval + " " + format( "{$format|escape:'htmlall':'UTF-8'}", $('#product_total_price_calc').val()) + "</span>";
{if $design_type == 'design1'}
if (waste_increase_percentage != 1) {
if((product_calc_quantity % 1 < 1) && (product_calc_quantity % 1 != 0))
document.getElementById('directinput').value = parseFloat(product_calc_quantity).toFixed(4);
else
document.getElementById('directinput').value = parseFloat(product_calc_quantity);
}
check_waste();
{if !$admintab_directinput}
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value);
if((qty_alt % 1 < 1) && (qty_alt % 1 != 0))
document.getElementById('quantity_wanted_alt').value = parseFloat(qty_alt).toFixed(2);
else
document.getElementById('quantity_wanted_alt').value = parseFloat(qty_alt);
if((product_calc_quantity % 1 < 1) && (product_calc_quantity % 1 != 0))
document.getElementById('directinput').value = parseFloat(product_calc_quantity).toFixed(4);
else
document.getElementById('directinput').value = parseFloat(product_calc_quantity);
{/if}
{else}
if((product_calc_quantity % 1 < 1) && (product_calc_quantity % 1 != 0))
document.getElementById('quantity_wanted_alt').value = parseFloat(product_calc_quantity).toFixed(2);
else
document.getElementById('quantity_wanted_alt').value = parseFloat(product_calc_quantity);
{/if}
}
</script>
{/if}
{/if}
<!-- Square Meter Calculation Module -->

View File

@@ -0,0 +1,956 @@
{*
* 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.1
* 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.
*}
{if $psversion == ''}
{assign var='psversion' value=Configuration::get('PS_VERSION_DB')}
{/if}
{if ($page_name == 'product') AND isset($admintab_display)}
{if ($admintab_type == "perimeter")}
<!-- Square Meter Calculation Module -->
{if ($decimaltype == 'comma')}
{assign var="format" value="#.##0,00##"}
{else}
{assign var="format" value="#,##0.00##"}
{/if}
<script type="text/javascript">
var product_total_price = Number({$admintab_startingprice|escape:'htmlall':'UTF-8'}) + 0;
var product_calc_quantity = 1;
var qty_prod2 = 0;
var qty_prod3 = 0;
check_waste();
$(document).ready(function () {
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricebutton"))
$('.product-prices').hide();
//detect if the quantity field or applet dimensions changed and See the Calculated Total price
var searchValue = "";
var searchValue5 = "";
var oldLocation = location.href;
var running = true;
document.getElementById("quantity_wanted").readOnly=true;
totalpriceinfospecific();
prod();
$(document).on('change', '.product-variants [data-product-attribute]', function (event) {
initial = setTimeout(function() {
TextboxChanged();
//checkHrefChanged();
clearTimeout(initial);
}, 1500);
});
$(document).on('click', '.ui-spinner', function (event) {
TextboxChanged();
});
$(document).on('change', 'input', function (event) {
initial = setTimeout(function() {
TextboxChanged();
clearTimeout(initial);
}, 1000);
});
$(document).on('click', '.input-group-btn-vertical', function (event) {
TextboxChanged();
});
$(document).on('keyup', 'input', function (event) {
check_waste();
TextboxChanged();
});
$("input[name='discretion']").change(function(){
check_discretion();
});
$("input[name='waste']").change(function(){
check_waste();
});
$(document).on('click', '.ui-spinner-button, .ui-icon, .value-button', function (event) {
check_waste();
TextboxChanged();
});
$(document).on('click', '#totalprice_product_button', function (event) {
document.getElementById('totalpriceinfo').style.display = 'block';
});
{if !($admintab_directinput)}
$("#quantity_wanted_alt").change(function() {
check_width();
prod();
});
$('#quantity_wanted_alt').parent().click(function() {
check_width();
prod();
});
$("#quantity_wanted_alth").change(function() {
check_height();
prod();
});
$('#quantity_wanted_alth').parent().click(function() {
check_height();
prod();
});
{/if}
setInterval(function() {
isCartValidCheck();
}, 1000);
function isCartValidCheck() {
var available_quantity = JSON.parse($('#product-details').attr('data-product'))["quantity"];
var allow_oosp = JSON.parse($('#product-details').attr('data-product'))["allow_oosp"];
if ((product_total_price == 0) || ((qty_prod3 > available_quantity) && (allow_oosp == 0))) {
$('.add-to-cart').addClass('squaremeter_disablecart');
$('.add').addClass('squaremeter_disablecart_wrapper');
if (product_total_price == 0) {
$("#squaremeter_availability").html("<span style='color:#f39d72;' class='material-icons'>remove_shopping_cart</span> {l s='Total price cannot be zero.' mod='squaremeter'}");
}
if ((qty_prod3 > available_quantity) && (allow_oosp == 0)) {
$("#squaremeter_availability").html("<span style='color:#f39d72;' class='material-icons'>remove_shopping_cart</span> {l s='Not enough stock is available.' mod='squaremeter'}");
}
}
else {
if (($(".product-unavailable")[0]) && ($(".product-unavailable:visible").length > 0)){
} else {
$('.add-to-cart').removeClass('squaremeter_disablecart');
$('.add').removeClass('squaremeter_disablecart_wrapper');
$('#squaremeter_availability').html('');
}
}
}
function TextboxChanged() {
if (running == true) {
prod();
}
}
function check_discretion()
{
var check1 = $('input[name="discretion"]:checked').length; // We are checking whether the switch is checked or not. If it is checked, the applet is visible.
var check2 = $('#quantity_wanted').is('[readonly]'); // We are checking whether the standard quantity input is readonly or not.
{if $design_type == "design1"}
if (check1 > 0) {
$('#squaremeter, #totalprice').show();
$(".qty").hide();
$(".qty").prev("span").hide();
$('.close_calculator').show();
$('.open_calculator').hide();
} else {
$('#squaremeter, #totalprice').hide();
$(".qty").show();
$(".qty").prev("span").show();
$('.close_calculator').hide();
$('.open_calculator').show();
}
if (check1 > 0) {
running = true;
$('input[name="discretion"]').val('on');
} else {
document.getElementById("quantity_wanted").readOnly=false;
running = false;
$('input[name="discretion"]').val('off');
}
{/if}
{if $design_type == "design2"}
if (("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onevisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "calcvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok")) { // We are checking whether the standard quantity field is visible or not at the page load.
if (check1 > 0) {
$('#squaremeter, #dimension, #totalprice').show();
$('.close_calculator').show();
$('.open_calculator').hide();
} else {
$('#squaremeter, #dimension, #totalprice').hide();
$('.close_calculator').hide();
$('.open_calculator').show();
}
$(".qty").show();
$(".qty").prev("span").show();
} else {
if (check1 > 0) {
$('#squaremeter, #dimension, #totalprice').show();
$(".qty").hide();
$(".qty").prev("span").hide();
$('.close_calculator').show();
$('.open_calculator').hide();
} else {
$('#squaremeter, #dimension, #totalprice').hide();
$(".qty").show();
$(".qty").prev("span").show();
$('.close_calculator').hide();
$('.open_calculator').show();
}
}
if (check1 > 0) {
running = true;
$('input[name="discretion"]').val('on');
} else {
document.getElementById("quantity_wanted").readOnly=false;
running = false;
$('input[name="discretion"]').val('off');
}
{/if}
}
});
function countDecimals (x){
if(Math.floor(x) === x) return 0;
return x.toString().split(".")[1].length || 0;
}
function check_waste()
{
{if ($admintab_waste_select|escape:'html':'UTF-8')}
var admintab_waste_select = {$admintab_waste_select|escape:'html':'UTF-8'};
{else}
var admintab_waste_select = '';
{/if}
{if $step_width > 0}
var step = {$step_width};
{else}
var step = {$step};
{/if}
if ((typeof waste_increase_percentage === 'undefined')) {
var step = 1;
}
var numofdecimal = countDecimals(step);
var waste_check = $('input[name="waste"]:checked').length;
if ((admintab_waste_select) && (waste_check > 0)) {
{if $admintab_directinput}
if ($('#wastevalue').val() > 0) {
waste_increase_percentage = 1;
} else {
waste_increase_percentage = 1 + Number({$admintab_waste|escape:'htmlall':'UTF-8'})/100;
$('#wastevalue').val(Number({$admintab_waste|escape:'htmlall':'UTF-8'}));
}
{else}
waste_increase_percentage = 1 + Number({$admintab_waste|escape:'htmlall':'UTF-8'})/100;
$('#wastevalue').val(Number({$admintab_waste|escape:'htmlall':'UTF-8'}));
{/if}
} else {
if ((typeof waste_increase_percentage !== 'undefined')) {
waste_increase_percentage = 1 + $('#wastevalue').val()/100;
{if $admintab_directinput}
{if $design_type == 'design1'}
var old_value = $('#directinput').val();
var rounded_old_value = (old_value/waste_increase_percentage).toFixed(numofdecimal);
$('#directinput').val(rounded_old_value);
{else}
var old_value = $('#quantity_wanted_alt').val();
var rounded_old_value = (old_value/waste_increase_percentage).toFixed(numofdecimal);
$('#quantity_wanted_alt').val(rounded_old_value);
{/if}
{else}
{if $design_type != 'design1'}
var old_value = $('#quantity_wanted_alt').val();
var rounded_old_value = (old_value/waste_increase_percentage).toFixed(numofdecimal);
$('#quantity_wanted_alt').val(rounded_old_value);
{/if}
{/if}
}
$('#wastevalue').val(0);
waste_increase_percentage = 1;
}
}
function check_directinput()
{
var qty_el_alt = document.getElementById('directinput');
var qty_alt = Number(qty_el_alt.value);
{if $design_type == 'design1'}
if (qty_alt < {$admintab_minwidth|escape:'html':'UTF-8'})
{
qty_el_alt.value = {$admintab_minwidth|escape:'html':'UTF-8'};
}
else if (isNaN( qty_alt ))
{
qty_el_alt.value = {$admintab_minwidth|escape:'html':'UTF-8'};
}
{else}
if (qty_alt<{$admintab_minwidth|escape:'html':'UTF-8'})
{
qty_el_alt.value = Number({$admintab_minwidth|escape:'html':'UTF-8'});
}
else if (qty_alt>{$admintab_maxwidth|escape:'htmlall':'UTF-8'})
{
qty_el_alt.value = Number({$admintab_maxwidth|escape:'htmlall':'UTF-8'});
}
else if (isNaN( qty_alt ))
{
qty_el_alt.value = Number({$admintab_minwidth|escape:'html':'UTF-8'});
}
{/if}
prod();
return false;
}
function check_width()
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value);
if (qty_alt<{$admintab_minwidth|escape:'html':'UTF-8'})
{
qty_el_alt.value = Number({$admintab_minwidth|escape:'html':'UTF-8'});
}
else if (qty_alt>{$admintab_maxwidth|escape:'htmlall':'UTF-8'})
{
qty_el_alt.value = Number({$admintab_maxwidth|escape:'htmlall':'UTF-8'});
}
else if (isNaN( qty_alt ))
{
qty_el_alt.value = Number({$admintab_minwidth|escape:'html':'UTF-8'});
}
/* If ratio is available H:W */
{if !$admintab_directinput}
{if $admintab_ratio}
var ratio = "{$admintab_ratio|escape:'htmlall':'UTF-8'}";
var height_coefficient = Number(ratio.split(":")[0]);
var width_coefficient = Number(ratio.split(":")[1]);
var width_value = $('#quantity_wanted_alt').val();
var height_value = $('#quantity_wanted_alth').val();
/* Change height value keeping the width stable based on the ratio */
var new_height_value = width_value*height_coefficient/width_coefficient;
new_height_value = new_height_value.toFixed(2);
$('#quantity_wanted_alth').val(new_height_value);
{/if}
{/if}
/* If ratio is available H:W */
prod();
return false;
}
function check_height()
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value);
if (qty_alth<{$admintab_minheight|escape:'html':'UTF-8'})
{
qty_el_alth.value = Number({$admintab_minheight|escape:'html':'UTF-8'});
}
else if (qty_alth>{$admintab_maxheight|escape:'htmlall':'UTF-8'})
{
qty_el_alth.value = Number({$admintab_maxheight|escape:'htmlall':'UTF-8'});
}
else if (isNaN( qty_alth ))
{
qty_el_alth.value = Number({$admintab_minheight|escape:'html':'UTF-8'});
}
/* If ratio is available H:W */
{if !$admintab_directinput}
{if $admintab_ratio}
var ratio = "{$admintab_ratio|escape:'htmlall':'UTF-8'}";
var height_coefficient = Number(ratio.split(":")[0]);
var width_coefficient = Number(ratio.split(":")[1]);
var width_value = $('#quantity_wanted_alt').val();
var height_value = $('#quantity_wanted_alth').val();
/* Change width value keeping the height stable based on the ratio */
var new_width_value = height_value*width_coefficient/height_coefficient;
new_width_value = new_width_value.toFixed(2);
$('#quantity_wanted_alt').val(new_width_value);
{/if}
{/if}
/* If ratio is available H:W */
prod();
return false;
}
function check_quantity()
{
var quantity = document.getElementById('quantity');
var quantity_value = Number(quantity.value);
if (quantity_value<1)
quantity.value = 1;
else if (isNaN( quantity_value ))
quantity.value = 1;
prod();
return false;
}
function prod()
{
{if $admintab_directinput && ($design_type == 'design1')}
{if $admintab_conversion_unit}
{$admintab_maxwidth_unit = $admintab_conversion_unit}
{else if ($admintab_attribute_unit)}
{$admintab_maxwidth_unit = $admintab_attribute_unit}
{/if}
{/if}
{if $unittype == 'metric'}
//Quantity in m
if ("{$admintab_conversion_unit|escape:'html':'UTF-8'}" == "m" || "{$admintab_attribute_unit|escape:'htmlall':'UTF-8'}" == "m")
{
if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "mm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = (Number(qty_el_alt.value))/1000;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "cm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = (Number(qty_el_alt.value))/100;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "dm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = (Number(qty_el_alt.value))/10;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "m")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value);
}
if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "mm")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = (Number(qty_el_alth.value))/1000;
}
else if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "cm")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = (Number(qty_el_alth.value))/100;
}
else if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "dm")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = (Number(qty_el_alth.value))/10;
}
else if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "m")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value);
}
}
//Quantity in dm
if ("{$admintab_conversion_unit|escape:'html':'UTF-8'}" == "dm" || "{$admintab_attribute_unit|escape:'htmlall':'UTF-8'}" == "dm")
{
if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "mm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)/100;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "cm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)/10;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "dm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value);
}
else
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)*10;
}
if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "mm")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value)/100;
}
else if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "cm")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value)/10;
}
else if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "dm")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value);
}
else
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value)*10;
}
}
//Quantity in cm
if ("{$admintab_conversion_unit|escape:'html':'UTF-8'}" == "cm" || "{$admintab_attribute_unit|escape:'htmlall':'UTF-8'}" == "cm")
{
if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "mm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)/10;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "cm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value);
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "dm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)*10;
}
else
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)*100;
}
if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "mm")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value)/10;
}
else if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "cm")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value);
}
else if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "dm")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value)*10;
}
else
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value)*100;
}
}
//Quanitity in mm
if ("{$admintab_conversion_unit|escape:'html':'UTF-8'}" == "mm" || "{$admintab_attribute_unit|escape:'htmlall':'UTF-8'}" == "mm")
{
if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "mm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value);
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "cm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)*10;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "dm")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)*100;
}
else
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)*1000;
}
if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "mm")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value);
}
else if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "cm")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value)*10;
}
else if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "dm")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value)*100;
}
else
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value)*1000;
}
}
{else}
//Quantity in yd
if ("{$admintab_conversion_unit|escape:'html':'UTF-8'}" == "yd" || "{$admintab_attribute_unit|escape:'htmlall':'UTF-8'}" == "yd")
{
if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "in")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = (Number(qty_el_alt.value))/36;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "ft")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = (Number(qty_el_alt.value))/3;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "yd")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = (Number(qty_el_alt.value));
}
if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "in")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = (Number(qty_el_alth.value))/36;
}
else if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "ft")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = (Number(qty_el_alth.value))/3;
}
else if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "yd")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = (Number(qty_el_alth.value));
}
}
//Quantity in ft
if ("{$admintab_conversion_unit|escape:'html':'UTF-8'}" == "ft" || "{$admintab_attribute_unit|escape:'htmlall':'UTF-8'}" == "ft")
{
if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "in")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)/12;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "ft")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value);
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "yd")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)*3;
}
if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "in")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value)/12;
}
else if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "ft")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value);
}
else if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "yd")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value)*3;
}
}
//Quanitity in in
if ("{$admintab_conversion_unit|escape:'html':'UTF-8'}" == "in" || "{$admintab_attribute_unit|escape:'htmlall':'UTF-8'}" == "in")
{
if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "in")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value);
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "ft")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)*12;
}
else if ("{$admintab_maxwidth_unit|escape:'html':'UTF-8'}" == "yd")
{
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value)*36;
}
if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "in")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value);
}
else if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "ft")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value)*12;
}
else if ("{$admintab_maxheight_unit|escape:'html':'UTF-8'}" == "yd")
{
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value)*36;
}
}
{/if}
{if $admintab_directinput}
var qty_el_directinput = document.getElementById('directinput');
var qty_directinput = Number(qty_el_directinput.value);
var multiplication = qty_directinput * waste_increase_percentage;
{else}
var multiplication = (qty_alth + qty_alt) * 2 * waste_increase_percentage;
{/if}
var qty_prod = document.getElementById('quantity_wanted');
var qty_production = Number(qty_prod.value);
{if $admintab_attselect}
var e = document.getElementById("group_" + {$admintab_attribute|escape:'htmlall':'UTF-8'});
if (e.tagName == "SELECT")
{
var selectedlength = e.options[e.selectedIndex].text;
} else {
var selectedlength = $( "input[name='group[{$admintab_attribute|escape:'htmlall':'UTF-8'}]']:checked" ).siblings("span").text()
}
selectedlength = selectedlength.replace(/[^0-9\.]/g, '');
{else}
var selectedlength = {$admintab_conversion|escape:'htmlall':'UTF-8'};
{/if}
{if $admintab_secconversionselect}
selectedlength = selectedlength*{$admintab_secconversion|escape:'htmlall':'UTF-8'};
{/if}
fulllength = multiplication;
extra = Math.ceil(multiplication / selectedlength) * selectedlength - fulllength;
if (("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onevisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "oneinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok"))
{
qty_prod.value = 1;
qty_prod2 = Math.ceil(multiplication/selectedlength);
//qty_prod3 = parseFloat(Math.round((multiplication/selectedlength) * 100) / 100).toFixed(2);
qty_prod3 = multiplication/selectedlength;
{if ($admintab_dispquan != "decimalok")}
if (qty_prod3 < 1)
qty_prod3 = 1;
{/if}
}
else
qty_prod.value = Math.ceil(multiplication/selectedlength);
if (qty_prod.value == 0)
qty_prod.value = 1;
if ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok")
//product_calc_quantity = parseFloat(Math.round((multiplication/selectedlength) * 100) / 100).toFixed(2);
product_calc_quantity = multiplication/selectedlength;
else
product_calc_quantity = Math.ceil(multiplication/selectedlength);
var dimen=document.getElementById("dimension");
var unit={if $admintab_attselect}"{$admintab_attribute_unit|escape:'htmlall':'UTF-8'}"{else}"{$admintab_conversion_unit|escape:'html':'UTF-8'}"{/if};
{if $admintab_directinput}
if ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok")
dimen.innerHTML= "({l s='Calculated Total' mod='squaremeter'}&nbsp;" + format( "{$format|escape:'htmlall':'UTF-8'}", multiplication) + "&nbsp;" + unit + ",&nbsp;" + qty_prod3 + "&nbsp;{l s='ea' mod='squaremeter'})";
else
dimen.innerHTML= "({l s='Total' mod='squaremeter'}&nbsp;" + format( "{$format|escape:'htmlall':'UTF-8'}", multiplication) + "&nbsp;" + unit + ")({l s='Extra' mod='squaremeter'}&nbsp;" + format( "{$format|escape:'htmlall':'UTF-8'}", extra) + "&nbsp;" + unit + ")";
{else}
if ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok")
dimen.innerHTML="{l s='Length' mod='squaremeter'}&nbsp;" + qty_el_alt.value + "&nbsp;{$admintab_maxwidth_unit|escape:'html':'UTF-8'},&nbsp;" + "{l s='Width' mod='squaremeter'}&nbsp;" + qty_el_alth.value + "&nbsp;{$admintab_maxheight_unit|escape:'html':'UTF-8'},&nbsp;" + qty_prod3 + "&nbsp;{l s='ea' mod='squaremeter'}"{if ($dimensiondisplaytype == 'on')}+"<br>({l s='Calculated Total' mod='squaremeter'}&nbsp;" + format( "{$format|escape:'htmlall':'UTF-8'}", multiplication) + "&nbsp;" + unit + ")"{else}+""{/if};
else
dimen.innerHTML="{l s='Length' mod='squaremeter'}&nbsp;" + qty_el_alt.value + "&nbsp;{$admintab_maxwidth_unit|escape:'html':'UTF-8'},&nbsp;" + "{l s='Width' mod='squaremeter'}&nbsp;" + qty_el_alth.value + "&nbsp;{$admintab_maxheight_unit|escape:'html':'UTF-8'}"{if ($dimensiondisplaytype == 'on')}+"<br>({l s='Total' mod='squaremeter'}&nbsp;" + format( "{$format|escape:'htmlall':'UTF-8'}", multiplication) + "&nbsp;" + unit + ")({l s='Extra' mod='squaremeter'}&nbsp;" + format( "{$format|escape:'htmlall':'UTF-8'}", extra) + "&nbsp;" + unit + ")"{else}+""{/if};
{/if}
if (typeof fulllength !== 'undefined') {
$('#calculated_total').val((fulllength).toFixed(4));
if ((typeof extra !== 'undefined') && ("{$admintab_dispquan|escape:'html':'UTF-8'}" != "decimalok")) {
$('#grand_calculated_total').val((fulllength).toFixed(4) + extra);
}
}
totalpriceinfospecific();
if(("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcvisible"))
{
var pricecurrencyval = $('meta[property="product:price:currency"]').attr('content');
var totalpriceinfo = document.getElementById("totalpriceinfo");
totalpriceinfo.innerHTML = "{l s='Total Price' mod='squaremeter'} : <span>" + pricecurrencyval + " " + format( "{$format|escape:'htmlall':'UTF-8'}", product_total_price) + "</span>";
}
var dimx = dimen.innerHTML;
dimx=dimx.replace(/&nbsp;/gi," ");
dimx=dimx.replace(/&amp;/gi,"&");
dimx=dimx.replace(/&quot;/gi,'"');
dimx=dimx.replace(/<br>/gi,', ');
dimx=dimx.replace(/&lt;/gi,'<');
dimx=dimx.replace(/&gt;/gi,'>');
document.getElementById("dim").value = dimx;
return false;
}
function calc_pos()
{
$('#squaremeter').insertBefore('.product-add-to-cart');
{if $design_type == 'design2'}
$('#dimension').insertBefore('.product-add-to-cart');
{/if}
if ("{$admintab_dispprice|escape:'html':'UTF-8'}"!="pricenototalprice")
$('#totalprice').insertBefore('.product-add-to-cart');
$('#switchx').insertBefore('.product-add-to-cart');
$('<span id="squaremeter_availability"></span>').insertBefore('.product-add-to-cart');
}
//totalpriceinfospecific function is the same for all dimension types
function totalpriceinfospecific()
{
if (("{$admintab_dispprice|escape:'html':'UTF-8'}"=="pricetotalprice") || ("{$admintab_dispprice|escape:'html':'UTF-8'}"=="nopricetotalprice"))
document.getElementById('totalpriceinfo').style.display = 'block';
var qty_prod = document.getElementById('quantity_wanted');
if(("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcvisible"))
var qty_production = qty_prod2;
else if ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok")
var qty_production = qty_prod3;
else
var qty_production = Number(qty_prod.value);
$('#converted_ea').val(qty_production.toFixed(4));
var pricecurrencyval = $('meta[property="product:price:currency"]').attr('content');
if ($("#product-details").length) {
window.pricenumberval = $("#product-details").data("product").price_amount;
} else {
window.pricenumberval = $('meta[property="product:price:amount"]').attr('content');
}
//if quantity discounts are available
// if ($("#product-details").length) {
// var qty_discount = $("#product-details").data("product").quantity_discounts;
// if(qty_discount.length > 0 && parseFloat(qty_discount[0].from_quantity) <= parseFloat(qty_production))
// {
// for(var i =0; i<qty_discount.length ; i++){
// if(parseFloat(qty_production) >= parseFloat(qty_discount[i].from_quantity)){
// var type_of_discount = qty_discount[i].discount.includes("%", 0);
// if (type_of_discount == true) {
// discount_amount = qty_discount[i].discount.replace('%','');
// pricenumberval = pricenumberval * (100 - discount_amount) /100;
// } else {
// pricenumberval = qty_discount[i].discount.replace(/[^0-9.,]/g, "").replace(/[,]/g, ".");
// }
//var iskonto = qty_discount[i].discount.replace(/[^0-9.,]/g, "").replace(/[,]/g, ".");
//pricenumberval = pricenumberval - iskonto;
//break;
// }
// }
// }
// }
$("#quantity_wanted").change();
var totalprice = Number({$admintab_startingprice|escape:'htmlall':'UTF-8'}) + qty_production * pricenumberval;
totalprice = Math.round((totalprice + Number.EPSILON) * 100) / 100; //We convert the price to 2 decimals
var totalpriceinfo = document.getElementById("totalpriceinfo");
$('#product_total_price_calc').val(totalprice);
if ($("#product-details").length) {
var pricenumberval = $("#product-details").data("product").price_amount;
} else {
var pricenumberval = $('meta[property="product:price:amount"]').attr('content');
}
if ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok")
product_total_price = Number({$admintab_startingprice|escape:'htmlall':'UTF-8'}) + parseFloat(product_calc_quantity) * pricenumberval;
else
product_total_price = Number({$admintab_startingprice|escape:'htmlall':'UTF-8'}) + parseInt(product_calc_quantity,10) * pricenumberval;
{if ($admintab_extrafee_select|escape:'html':'UTF-8')}
var admintab_extrafee_select = {$admintab_extrafee_select|escape:'html':'UTF-8'};
{else}
var admintab_extrafee_select = '';
{/if}
var fee_check = $('input[name="extrafee"]:checked').length;
if ((admintab_extrafee_select) && (fee_check > 0)) {
product_total_price = product_total_price + Number({$admintab_extrafee|escape:'htmlall':'UTF-8'});
$('#extrafeevalue').val(Number({$admintab_extrafee|escape:'htmlall':'UTF-8'}));
} else {
$('#extrafeevalue').val(0);
}
var cart_button_initial_status = $('.add-to-cart').attr("disabled");
if (cart_button_initial_status != "disabled") {
var available_quantity = JSON.parse($('#product-details').attr('data-product'))["quantity"];
var allow_oosp = JSON.parse($('#product-details').attr('data-product'))["allow_oosp"];
if ((product_total_price == 0) || ((qty_prod3 > available_quantity) && (allow_oosp == 0))) {
$('.add-to-cart').addClass('squaremeter_disablecart');
$('.add').addClass('squaremeter_disablecart_wrapper');
if ((qty_prod3 > available_quantity) && (allow_oosp == 0)) {
$("#squaremeter_availability").html("<span style='color:#f39d72;' class='material-icons'>remove_shopping_cart</span> {l s='Not enough stock is available.' mod='squaremeter'}");
}
} else {
if (($(".product-unavailable")[0]) && ($(".product-unavailable:visible").length > 0)){
} else {
$('.add-to-cart').removeClass('squaremeter_disablecart');
$('.add').removeClass('squaremeter_disablecart_wrapper');
$('#squaremeter_availability').html('');
}
}
}
if ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onevisible" || "{$admintab_dispquan|escape:'html':'UTF-8'}" == "oneinvisible") {
product_total_price = pricenumberval;
}
{if $admintab_unit_baseprice}
if(pricenumberval > product_total_price)
product_total_price = pricenumberval;
{/if}
{if $admintab_reserve}
if(Number("{$admintab_reserve|escape:'htmlall':'UTF-8'}")>product_total_price)
product_total_price = Number({$admintab_reserve|escape:'htmlall':'UTF-8'});
{/if}
product_total_price = Math.round((product_total_price + Number.EPSILON) * 100) / 100; //We convert the price to 2 decimals
if(!$("#product_total_price_calc").size())
$('<input type="hidden" name="product_total_price_calc" id="product_total_price_calc" value='+product_total_price+' />').appendTo('form#add-to-cart-or-refresh');
else
$("#product_total_price_calc").val(product_total_price);
if(("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok"))
totalprice = $('#product_total_price_calc').val();
totalpriceinfo.innerHTML = "{l s='Total Price' mod='squaremeter'} : <span>" + pricecurrencyval + " " + format( "{$format|escape:'htmlall':'UTF-8'}", $('#product_total_price_calc').val()) + "</span>";
{if $design_type == 'design1'}
if (waste_increase_percentage != 1) {
if((product_calc_quantity % 1 < 1) && (product_calc_quantity % 1 != 0))
document.getElementById('directinput').value = parseFloat(product_calc_quantity).toFixed(4);
else
document.getElementById('directinput').value = parseFloat(product_calc_quantity);
}
check_waste();
{if !$admintab_directinput}
var qty_el_alth = document.getElementById('quantity_wanted_alth');
var qty_alth = Number(qty_el_alth.value);
if((qty_alth % 1 < 1) && (qty_alth % 1 != 0))
document.getElementById('quantity_wanted_alth').value = parseFloat(qty_alth).toFixed(2);
else
document.getElementById('quantity_wanted_alth').value = parseFloat(qty_alth);
var qty_el_alt = document.getElementById('quantity_wanted_alt');
var qty_alt = Number(qty_el_alt.value);
if((qty_alt % 1 < 1) && (qty_alt % 1 != 0))
document.getElementById('quantity_wanted_alt').value = parseFloat(qty_alt).toFixed(2);
else
document.getElementById('quantity_wanted_alt').value = parseFloat(qty_alt);
if((product_calc_quantity % 1 < 1) && (product_calc_quantity % 1 != 0))
document.getElementById('directinput').value = parseFloat(product_calc_quantity).toFixed(4);
else
document.getElementById('directinput').value = parseFloat(product_calc_quantity);
{/if}
{/if}
}
</script>
{/if}
{/if}
<!-- Square Meter Calculation Module -->

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,291 @@
{*
* 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.1
* 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.
*}
{if ($page.page_name == 'product')}
<!-- Square Meter Calculation Module -->
<script>
if ($('#product_customization_id').size() > 0) {
$( "#product_customization_id" ).after( "<input type='hidden' id='dim' name='dim' value='' />" );
$( "#dim" ).after( "<input type='hidden' id='converted_ea' name='converted_ea' value='' />" );
$( "#converted_ea" ).after( "<input type='hidden' id='calculated_total' name='calculated_total' value='' />" );
$( "#calculated_total" ).after( "<input type='hidden' id='grand_calculated_total' name='grand_calculated_total' value='' />" );
$( "#grand_calculated_total" ).after( "<input type='hidden' id='extrafeevalue' name='extrafeevalue' value='' />" );
$( "#extrafeevalue" ).after( "<input type='hidden' id='wastevalue' name='wastevalue' value=''/>" );
}
</script>
{if $design_type == 'design1'} {*Design 1*}
<div id="switchx" style="display: {if $disableapplet}block{else}none{/if};">
<label class="switchx">
<input type="checkbox" name="discretion" id="discretion" value="on" checked>
<span class="sliderx roundx"></span>
</label>
<span class="close_calculator">{l s='Close the calculator' mod='squaremeter'}</span>
<span class="open_calculator">{l s='Use the calculator' mod='squaremeter'}</span>
</div>
<div id="squaremeter">
<h5>{l s='Calculator' mod='squaremeter'}
{if $admintab_picture}
{if (!$image_src)}{$image_src = $module_dir|cat:'views/img/preview_linear.jpg'}{/if}
<a href="{$image_src|escape:'html':'UTF-8'}" class="preview" onclick="return false;">
<img src="{$module_dir|escape:'html':'UTF-8'}views/img/hint.png" title="Hint" class="hint">
</a>
{/if}
</h5>
{if (($admintab_directinput) && ($admintab_dispquan != "decimalok"))} {* If direct input is allowed, step value should be one unless decimal quantity is not allowed *}
{$step = 1}
{/if}
{if !$admintab_directinput} {* If Not Allowed Direct Input*}
<div class="title_explanation">
{l s='Please enter the size in' mod='squaremeter'}&nbsp;<span><b>{$admintab_maxwidth_unit|escape:'html':'UTF-8'}</b></span>, {l s='the calculator will calculate the required number of' mod='squaremeter'}&nbsp;<span>{$admintab_conversion_unit|escape:'html':'UTF-8'}</span>&nbsp;{l s='and the total price.' mod='squaremeter'}
</div>
<div class="form-group row-group">
<div class="form-group row-item-group">
<label class="form-control-label explanation_label">{l s='Length' mod='squaremeter'}&nbsp;({$admintab_maxwidth_unit|escape:'html':'UTF-8'})</label>
{l s='Please enter the length required without quantity. We will add quantities for each product of ' mod='squaremeter'}{$admintab_conversion|escape:'html':'UTF-8'}&nbsp;{$admintab_conversion_unit|escape:'html':'UTF-8'}&nbsp;({l s='length' mod='squaremeter'})
</div>
<div class="form-group row-item-group">
<label class="form-control-label width_label" for="width">{l s='Length' mod='squaremeter'}&nbsp;({$admintab_maxwidth_unit|escape:'html':'UTF-8'})</label>
<div id="width">
{if !$admintab_widthcheck}
<div class="value-button decrease" onclick="decreaseValue('quantity_wanted_alt', {$step_width});check_width();" value="Decrease Value">-</div>
<input type="text" id="quantity_wanted_alt" value="{$admintab_minwidth|escape:'html':'UTF-8'}" name="qty_alt" onchange="check_width();"/>
<div class="value-button increase" onclick="increaseValue('quantity_wanted_alt', {$step_width});check_width();" value="Increase Value">+</div>
{else}
<select data-toggle="select2" id="quantity_wanted_alt" name="qty_alt" onchange="check_width();">
<option value="{$admintab_minwidth|escape:'html':'UTF-8'}" selected>{$admintab_minwidth|escape:'html':'UTF-8'}</option>
{$width_value = $admintab_minwidth}
{while $width_value lte $admintab_maxwidth - $step_width}
{$width_value = $width_value + $step_width}
<option value="{$width_value|escape:'html':'UTF-8'}">{$width_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
</div>
</div>
</div>
<hr>
{if $admintab_addquan}
<div class="form-group row-group">
<div class="form-group row-item-group">
<label class="form-control-label explanation_label">{l s='Quantity' mod='squaremeter'}</label>
{l s='Please enter the required quantity. We will the quantity entered by the calculated dimension to determine the amount needed.' mod='squaremeter'}
</div>
<div class="form-group row-item-group">
<label class="form-control-label quantity_label" for="quantitym">{l s='Quantity' mod='squaremeter'}</label>
<div id="quantitym">
<div class="value-button decrease" onclick="decreaseValue('quantity', 1);check_quantity();" value="Decrease Value">-</div>
<input type="number" id="quantity" value="1" name="quantity" onchange="check_quantity()"/>
<div class="value-button increase" onclick="increaseValue('quantity', 1);check_quantity();" value="Increase Value">+</div>
</div>
</div>
</div>
<hr>
{/if}
{else}
<input type="hidden" id="quantity_wanted_alt" value="" name="qty_alt"/>
{/if} {* If Not Allowed Direct Input*}
<div class="form-group row-group">
<div class="form-group row-item-group">
<label class="form-control-label explanation_label">{l s='Amount of product needed' mod='squaremeter'}</label>
{l s='The calculator calculates the amount of product needed based on the dimensions you entered.' mod='squaremeter'}
</div>
<div class="form-group row-item-group">
<label class="form-control-label quantity_calculated_label" for="quantity_calculated">{l s='Number of' mod='squaremeter'}&nbsp;{$admintab_conversion_unit|escape:'html':'UTF-8'}</label>
<div id="quantity_calculated">
{if $admintab_directinput}<div class="value-button decrease" onclick="decreaseValue('directinput', {$step});check_directinput();" value="Decrease Value">-</div>{/if}
<input type="text" id="directinput" name="directinput" onchange="check_directinput()" value="0"/>
{if $admintab_directinput}<div class="value-button increase" onclick="increaseValue('directinput', {$step});check_directinput();" value="Increase Value">+</div>{/if}
</div>
</div>
</div>
{if $admintab_extrafee_select}
<div style="clear:both" id="squaremeter_extrafee">
<label class="extrafee"><input type="checkbox" name="extrafee" id="extrafee" value="{$admintab_extrafee|escape:'htmlall':'UTF-8'}"/>{l s='Add Extra Fee' mod='squaremeter'}</label>
</div>
{/if}
{if $admintab_waste_select}
<div style="clear:both" id="squaremeter_waste">
<label class="waste"><input type="checkbox" name="waste" id="waste" value="{$admintab_waste|escape:'htmlall':'UTF-8'}"/> {l s='Add' mod='squaremeter'} {$admintab_waste|escape:'htmlall':'UTF-8'}% {l s='more for waste' mod='squaremeter'}</label>
</div>
{/if}
</div>
<div id="dimension"></div>
<div id="totalprice" style="{if $admintab_dispprice == 'pricenototalprice'}display:none{else}display:block{/if}">
<input {if ($admintab_dispprice == 'pricetotalprice') OR ($admintab_dispprice == 'nopricetotalprice')}style="display:none"{/if} type="button" name="submit" id="totalprice_product_button" onclick="totalpriceinfospecific();document.getElementById('totalprice_product_button').style.display = 'none';" value="{l s='See the Calculated Total' mod='squaremeter'}" class="button btn btn-secondary btn-sm"/>
<br />
<div id="totalpriceinfo" style="display:none;"></div>
</div>
<script type="text/javascript">
{if !$admintab_directinput}
check_width();
{else}
check_directinput();
{/if}
if (("{$admintab_dispquan|escape:'html':'UTF-8'}" == "oneinvisible")
|| ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "calcinvisible")
|| ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcinvisible")
|| ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok")) {
if (null != document.getElementById("quantity_wanted"))
{
$('.qty').hide();
$(".qty").prev("span").hide();
$('.product-quantity').prev().hide();
document.getElementById("quantity_wanted").readOnly=true;
}
}
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricebutton") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice"))
{
if (null != document.getElementById("our_price_display"))
document.getElementById("our_price_display").style.display='none';
if (null != document.getElementById("reduction_percent"))
document.getElementById("reduction_percent").style.display='none';
if (null != document.getElementById("reduction_amount"))
document.getElementById("reduction_amount").style.display='none';
if (null != document.getElementById("old_price"))
document.getElementById("old_price").style.display='none';
}
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "pricetotalprice") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice"))
document.getElementById('totalpriceinfo').style.display = 'block';
else
document.getElementById('totalpriceinfo').style.display = 'none';
</script>
{/if} {*Design 1 End*}
{if $design_type == 'design2'} {*Design 2*}
<div id="switchx" style="display: {if $disableapplet}block{else}none{/if};">
<label class="switchx">
<input type="checkbox" name="discretion" id="discretion" value="on" checked>
<span class="sliderx roundx"></span>
</label>
<span class="close_calculator">{l s='Close the calculator' mod='squaremeter'}</span>
<span class="open_calculator">{l s='Use the calculator' mod='squaremeter'}</span>
</div>
<fieldset id="squaremeter" >
{if $admintab_addquan}
<legend>
{if $admintab_picture}
{if (!$image_src)}{$image_src = $module_dir|cat:'views/img/preview_linear.jpg'}{/if}
<a href="{$image_src|escape:'html':'UTF-8'}" class="preview" onclick="return false;">
<img src="{$module_dir|escape:'html':'UTF-8'}views/img/hint.png" title="Hint" class="hint">
</a>
{/if}
&nbsp;{l s='Please enter length/quantity' mod='squaremeter'}&nbsp;
</legend>
{else}
<legend>
{if $admintab_picture}
{if (!$image_src)}{$image_src = $module_dir|cat:'views/img/preview_linear.jpg'}{/if}
<a href="{$image_src|escape:'html':'UTF-8'}" class="preview" onclick="return false;">
<img src="{$module_dir|escape:'html':'UTF-8'}views/img/hint.png" title="Hint" class="hint">
</a>
{/if}
&nbsp;{l s='Please enter length' mod='squaremeter'}&nbsp;
</legend>
{/if}
<div align="center">
<div class="labels">
<p>{l s='Length' mod='squaremeter'}&nbsp;({$admintab_maxwidth_unit|escape:'html':'UTF-8'})</p>
</div>
<div class="fields">
<p id="width">
{if !$admintab_widthcheck}
<input id="quantity_wanted_alt" type="text" value="{$admintab_minwidth|escape:'html':'UTF-8'}" name="qty_alt" onchange="check_width()"></input>
{else}
<select data-toggle="select2" id="quantity_wanted_alt" name="qty_alt" onchange="check_width()">
<option value="{$admintab_minwidth|escape:'html':'UTF-8'}" selected>{$admintab_minwidth|escape:'html':'UTF-8'}</option>
{$width_value = $admintab_minwidth}
{while $width_value lte $admintab_maxwidth - $step_width}
{$width_value = $width_value + $step_width}
<option value="{$width_value|escape:'html':'UTF-8'}">{$width_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
<input type="hidden" id="directinput" name="directinput" value="0"/>
</p>
</div>
<div class="labels">
{if $admintab_addquan}
<p>{l s='Piece(s)' mod='squaremeter'}</p>
{/if}
</div>
<div class="fields">
{if $admintab_addquan}
<p id="quantitym"><input id="quantity" type="text" value="1" name="quantity" onchange="check_quantity()"></input></p>
{/if}
</div>
</div>
{if $admintab_extrafee_select}
<div style="clear:both" id="squaremeter_extrafee">
<label class="extrafee"><input type="checkbox" name="extrafee" id="extrafee" value="{$admintab_extrafee|escape:'htmlall':'UTF-8'}"/>{l s='Add Extra Fee' mod='squaremeter'}</label>
</div>
{/if}
{if $admintab_waste_select}
<div style="clear:both" id="squaremeter_waste">
<label class="waste"><input type="checkbox" name="waste" id="waste" value="{$admintab_waste|escape:'htmlall':'UTF-8'}"/> {l s='Add' mod='squaremeter'} {$admintab_waste|escape:'htmlall':'UTF-8'}% {l s='more for waste' mod='squaremeter'}</label>
</div>
{/if}
</fieldset>
<div id="dimension" align="center"></div>
<div id="totalprice" align="left" style="{if $admintab_dispprice == 'pricenototalprice'}display:none{else}display:block{/if}">
<input style="{if ($admintab_dispprice == 'pricetotalprice') OR ($admintab_dispprice == 'nopricetotalprice')}display:none{else}display:block{/if}" type="button" name="submit" id="totalprice_product_button" onclick="totalpriceinfospecific()" value="{l s='See the Calculated Total' mod='squaremeter'}" class="button btn btn-secondary btn-sm"/><br /><div id="totalpriceinfo" style="display:none;"></div><br />
</div>
<script type="text/javascript">
check_width();
check_directinput();
if (("{$admintab_dispquan|escape:'html':'UTF-8'}" == "oneinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "calcinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok"))
{
if (null != document.getElementById("quantity_wanted"))
{
$('.qty').hide();
$(".qty").prev("span").hide();
$('.product-quantity').prev().hide();
}
}
else
{
//$('.product-add-to-cart>.control-label').html("{l s='Required Quantity:' mod='squaremeter'}");
document.getElementById("quantity_wanted").readOnly=true;
}
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricebutton") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice"))
{
if (null != document.getElementById("our_price_display"))
document.getElementById("our_price_display").style.display='none';
if (null != document.getElementById("reduction_percent"))
document.getElementById("reduction_percent").style.display='none';
if (null != document.getElementById("reduction_amount"))
document.getElementById("reduction_amount").style.display='none';
if (null != document.getElementById("old_price"))
document.getElementById("old_price").style.display='none';
}
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "pricetotalprice") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice"))
document.getElementById('totalpriceinfo').style.display = 'block';
else
document.getElementById('totalpriceinfo').style.display = 'none';
</script>
{/if} {*Design 2*}
<!-- Square Meter Calculation Module -->
{/if}

View File

@@ -0,0 +1,343 @@
{*
* 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.1
* 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.
*}
{if ($page.page_name == 'product')}
<!-- Square Meter Calculation Module -->
<script>
if ($('#product_customization_id').size() > 0) {
$( "#product_customization_id" ).after( "<input type='hidden' id='dim' name='dim' value='' />" );
$( "#dim" ).after( "<input type='hidden' id='converted_ea' name='converted_ea' value='' />" );
$( "#converted_ea" ).after( "<input type='hidden' id='calculated_total' name='calculated_total' value='' />" );
$( "#calculated_total" ).after( "<input type='hidden' id='grand_calculated_total' name='grand_calculated_total' value='' />" );
$( "#grand_calculated_total" ).after( "<input type='hidden' id='extrafeevalue' name='extrafeevalue' value='' />" );
$( "#extrafeevalue" ).after( "<input type='hidden' id='wastevalue' name='wastevalue' value='' />" );
}
</script>
{if $design_type == 'design1'} {*Design 1*}
<div id="switchx" style="display: {if $disableapplet}block{else}none{/if};">
<label class="switchx">
<input type="checkbox" name="discretion" id="discretion" value="on" checked>
<span class="sliderx roundx"></span>
</label>
<span class="close_calculator">{l s='Close the calculator' mod='squaremeter'}</span>
<span class="open_calculator">{l s='Use the calculator' mod='squaremeter'}</span>
</div>
<div id="squaremeter">
<h5>{l s='Calculator' mod='squaremeter'}
{if $admintab_picture}
{if (!$image_src)}{$image_src = $module_dir|cat:'views/img/preview_surface.jpg'}{/if}
<a href="{$image_src|escape:'html':'UTF-8'}" class="preview" onclick="return false;">
<img src="{$module_dir|escape:'html':'UTF-8'}views/img/hint.png" title="Hint" class="hint">
</a>
{/if}
</h5>
{if (($admintab_directinput) && ($admintab_dispquan != "decimalok"))} {* If direct input is allowed, step value should be one unless decimal quantity is not allowed *}
{$step = 1}
{/if}
{if !$admintab_directinput} {* If Not Allowed Direct Input*}
<div class="title_explanation">
{l s='Please enter the size in' mod='squaremeter'}&nbsp;<span><b>{$admintab_maxwidth_unit|escape:'html':'UTF-8'}</b></span>, {l s='the calculator will calculate the required number of' mod='squaremeter'}&nbsp;<span>{$admintab_conversion_unit|escape:'html':'UTF-8'}</span>&nbsp;{l s='and the total price.' mod='squaremeter'}
</div>
<div class="form-group row-group">
<div class="form-group row-item-group">
<label class="form-control-label explanation_label">{l s='Height' mod='squaremeter'}&nbsp;({$admintab_maxheight_unit|escape:'html':'UTF-8'})</label>
{l s='Please enter the height required without quantity. We will add quantities for each product of ' mod='squaremeter'}{$admintab_conversion|escape:'html':'UTF-8'}&nbsp;{$admintab_conversion_unit|escape:'html':'UTF-8'}&nbsp;({l s='height' mod='squaremeter'})
</div>
<div class="form-group row-item-group">
<label class="form-control-label height_label" for="height">{l s='Height' mod='squaremeter'}&nbsp;({$admintab_maxheight_unit|escape:'html':'UTF-8'})</label>
<div id="height">
{if !$admintab_heightcheck}
<div class="value-button decrease" onclick="decreaseValue('quantity_wanted_alth', {$step_height});check_height();check_width();" value="Decrease Value">-</div>
<input type="text" id="quantity_wanted_alth" value="{$admintab_minheight|escape:'html':'UTF-8'}" name="qty_alth" onchange="check_height();check_width();"/>
<div class="value-button increase" onclick="increaseValue('quantity_wanted_alth', {$step_height});check_height();check_width();" value="Increase Value">+</div>
{else}
<select data-toggle="select2" id="quantity_wanted_alth" name="qty_alth" onchange="check_height();check_width();">
<option value="{$admintab_minheight|escape:'html':'UTF-8'}" selected>{$admintab_minheight|escape:'html':'UTF-8'}</option>
{$height_value = $admintab_minheight}
{while $height_value lte $admintab_maxheight - $step_height}
{$height_value = $height_value + $step_height}
<option value="{$height_value|escape:'html':'UTF-8'}">{$height_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
</div>
</div>
</div>
<hr>
<div class="form-group row-group">
<div class="form-group row-item-group">
<label class="form-control-label explanation_label">{l s='Width' mod='squaremeter'}&nbsp;({$admintab_maxwidth_unit|escape:'html':'UTF-8'})</label>
{l s='Please enter the width required without quantity. We will add quantities for each product of ' mod='squaremeter'}{$admintab_conversion|escape:'html':'UTF-8'}&nbsp;{$admintab_conversion_unit|escape:'html':'UTF-8'}&nbsp;({l s='width' mod='squaremeter'})
</div>
<div class="form-group row-item-group">
<label class="form-control-label width_label" for="width">{l s='Width' mod='squaremeter'}&nbsp;({$admintab_maxwidth_unit|escape:'html':'UTF-8'})</label>
<div id="width">
{if !$admintab_widthcheck}
<div class="value-button decrease" onclick="decreaseValue('quantity_wanted_alt', {$step_width});check_width();check_height();" value="Decrease Value">-</div>
<input type="text" id="quantity_wanted_alt" value="{$admintab_minwidth|escape:'html':'UTF-8'}" name="qty_alt" onchange="check_width();check_height();"/>
<div class="value-button increase" onclick="increaseValue('quantity_wanted_alt', {$step_width});check_width();check_height();" value="Increase Value">+</div>
{else}
<select data-toggle="select2" id="quantity_wanted_alt" name="qty_alt" onchange="check_width();check_height();">
<option value="{$admintab_minwidth|escape:'html':'UTF-8'}" selected>{$admintab_minwidth|escape:'html':'UTF-8'}</option>
{$width_value = $admintab_minwidth}
{while $width_value lte $admintab_maxwidth - $step_width}
{$width_value = $width_value + $step_width}
<option value="{$width_value|escape:'html':'UTF-8'}">{$width_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
</div>
</div>
</div>
<hr>
{if $admintab_addquan}
<div class="form-group row-group">
<div class="form-group row-item-group">
<label class="form-control-label explanation_label">{l s='Quantity' mod='squaremeter'}</label>
{l s='Please enter the required quantity. We will the quantity entered by the calculated dimension to determine the amount needed.' mod='squaremeter'}
</div>
<div class="form-group row-item-group">
<label class="form-control-label quantity_label" for="quantitym">{l s='Quantity' mod='squaremeter'}</label>
<div id="quantitym">
<div class="value-button decrease" onclick="decreaseValue('quantity', 1);check_quantity();" value="Decrease Value">-</div>
<input type="number" id="quantity" value="1" name="quantity" onchange="check_quantity()"/>
<div class="value-button increase" onclick="increaseValue('quantity', 1);check_quantity();" value="Increase Value">+</div>
</div>
</div>
</div>
<hr>
{/if}
{else}
<input type="hidden" id="quantity_wanted_alt" value="" name="qty_alt"/>
<input type="hidden" id="quantity_wanted_alth" value="" name="qty_alth"/>
{/if} {* If Not Allowed Direct Input*}
<div class="form-group row-group">
<div class="form-group row-item-group">
<label class="form-control-label explanation_label">{l s='Amount of product needed' mod='squaremeter'}</label>
{l s='The calculator calculates the amount of product needed based on the dimensions you entered.' mod='squaremeter'}
</div>
<div class="form-group row-item-group">
<label class="form-control-label quantity_calculated_label" for="quantity_calculated">{l s='Number of' mod='squaremeter'}&nbsp;{$admintab_conversion_unit|escape:'html':'UTF-8'}</label>
<div id="quantity_calculated">
{if $admintab_directinput}<div class="value-button decrease" onclick="decreaseValue('directinput', {$step});check_directinput();" value="Decrease Value">-</div>{/if}
<input type="text" id="directinput" name="directinput" onchange="check_directinput()" value="0"/>
{if $admintab_directinput}<div class="value-button increase" onclick="increaseValue('directinput', {$step});check_directinput();" value="Increase Value">+</div>{/if}
</div>
</div>
</div>
{if $admintab_extrafee_select}
<div style="clear:both" id="squaremeter_extrafee">
<label class="extrafee"><input type="checkbox" name="extrafee" id="extrafee" value="{$admintab_extrafee|escape:'htmlall':'UTF-8'}"/>{l s='Add Extra Fee' mod='squaremeter'}</label>
</div>
{/if}
{if $admintab_waste_select}
<div style="clear:both" id="squaremeter_waste">
<label class="waste"><input type="checkbox" name="waste" id="waste" value="{$admintab_waste|escape:'htmlall':'UTF-8'}"/> {l s='Add' mod='squaremeter'} {$admintab_waste|escape:'htmlall':'UTF-8'}% {l s='more for waste' mod='squaremeter'}</label>
</div>
{/if}
</div>
<div id="dimension"></div>
<div id="totalprice" style="{if $admintab_dispprice == 'pricenototalprice'}display:none{else}display:block{/if}">
<input {if ($admintab_dispprice == 'pricetotalprice') OR ($admintab_dispprice == 'nopricetotalprice')}style="display:none"{/if} type="button" name="submit" id="totalprice_product_button" onclick="totalpriceinfospecific();document.getElementById('totalprice_product_button').style.display = 'none';" value="{l s='See the Calculated Total' mod='squaremeter'}" class="button btn btn-secondary btn-sm"/>
<br />
<div id="totalpriceinfo" style="display:none;"></div>
</div>
<script type="text/javascript">
{if !$admintab_directinput}
check_width();
check_height();
{/if}
if (("{$admintab_dispquan|escape:'html':'UTF-8'}" == "oneinvisible")
|| ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "calcinvisible")
|| ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcinvisible")
|| ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok")) {
if (null != document.getElementById("quantity_wanted"))
{
$('.qty').hide();
$(".qty").prev("span").hide();
$('.product-quantity').prev().hide();
document.getElementById("quantity_wanted").readOnly=true;
}
}
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricebutton") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice"))
{
if (null != document.getElementById("our_price_display"))
document.getElementById("our_price_display").style.display='none';
if (null != document.getElementById("reduction_percent"))
document.getElementById("reduction_percent").style.display='none';
if (null != document.getElementById("reduction_amount"))
document.getElementById("reduction_amount").style.display='none';
if (null != document.getElementById("old_price"))
document.getElementById("old_price").style.display='none';
}
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "pricetotalprice") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice"))
document.getElementById('totalpriceinfo').style.display = 'block';
else
document.getElementById('totalpriceinfo').style.display = 'none';
</script>
{/if} {*Design 1 End*}
{if $design_type == 'design2'} {*Design 2*}
<style type="text/css">
{if $admintab_directinput}
.fields{
clear:both;
}
{/if}
</style>
<div id="switchx" style="display: {if $disableapplet}block{else}none{/if};">
<label class="switchx">
<input type="checkbox" name="discretion" id="discretion" value="on" checked>
<span class="sliderx roundx"></span>
</label>
<span class="close_calculator">{l s='Close the calculator' mod='squaremeter'}</span>
<span class="open_calculator">{l s='Use the calculator' mod='squaremeter'}</span>
</div>
<fieldset id="squaremeter">
<legend>
{if $admintab_picture}
{if (!$image_src)}{$image_src = $module_dir|cat:'views/img/preview_perimeter.jpg'}{/if}
<a href="{$image_src|escape:'html':'UTF-8'}" class="preview" onclick="return false;">
<img src="{$module_dir|escape:'html':'UTF-8'}views/img/hint.png" title="Hint" class="hint">
</a>
{/if}
&nbsp;{l s='Please enter dimensions' mod='squaremeter'}&nbsp;
</legend>
<div align="center">
<div class="labels">
{if $admintab_directinput}
<p>{l s='Perimeter' mod='squaremeter'}&nbsp;({$admintab_conversion_unit|escape:'html':'UTF-8'})</p>
{else}
<p style="padding-left:9px;">{l s='Length' mod='squaremeter'}&nbsp;({$admintab_maxwidth_unit|escape:'html':'UTF-8'})</p>
<p style="width:45px;">&nbsp;</p>
<p>{l s='Width' mod='squaremeter'}&nbsp;({$admintab_maxheight_unit|escape:'html':'UTF-8'})</p>
{/if}
</div>
<div class="fields">
{if $admintab_directinput}
<p id="directinput_p">
{if !$admintab_widthcheck}
<input id="directinput" type="text" value="{$admintab_minwidth|escape:'html':'UTF-8'}" name="directinput" onchange="check_directinput()"></input>
{else}
<select data-toggle="select2" id="directinput" name="directinput" onchange="check_directinput()">
<option value="{$admintab_minwidth|escape:'html':'UTF-8'}" selected>{$admintab_minwidth|escape:'html':'UTF-8'}</option>
{$width_value = $admintab_minwidth}
{while $width_value lte $admintab_maxwidth - $step_width}
{$width_value = $width_value + $step_width}
<option value="{$width_value|escape:'html':'UTF-8'}">{$width_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
</p>
<input type="hidden" id="quantity_wanted_alt" value="" name="qty_alt"/>
<input type="hidden" id="quantity_wanted_alth" value="" name="qty_alth"/>
{else}
<p style="clear:left;margin-top: 10px;"><font face="Verdana, Geneva, sans-serif" size="+2">(</font></p>
<p id="width">
{if !$admintab_widthcheck}
<input id="quantity_wanted_alt" type="text" value="{$admintab_minwidth|escape:'html':'UTF-8'}" name="qty_alt" onchange="check_height();check_width();"></input>
{else}
<select data-toggle="select2" id="quantity_wanted_alt" name="qty_alt" onchange="check_height();check_width();">
<option value="{$admintab_minwidth|escape:'html':'UTF-8'}" selected>{$admintab_minwidth|escape:'html':'UTF-8'}</option>
{$width_value = $admintab_minwidth}
{while $width_value lte $admintab_maxwidth - $step_width}
{$width_value = $width_value + $step_width}
<option value="{$width_value|escape:'html':'UTF-8'}">{$width_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
</p>
<p id="multiplicationsign"><font face="Verdana, Geneva, sans-serif" size="+2">{l s='+' mod='squaremeter'}&nbsp;&nbsp;</font></p>
<p id="height">
{if !$admintab_heightcheck}
<input id="quantity_wanted_alth" type="text" value="{$admintab_minheight|escape:'html':'UTF-8'}" name="qty_alth" onchange="check_height();check_width();"></input>
{else}
<select data-toggle="select2" id="quantity_wanted_alth" name="qty_alth" onchange="check_height();check_width();">
<option value="{$admintab_minheight|escape:'html':'UTF-8'}" selected>{$admintab_minheight|escape:'html':'UTF-8'}</option>
{$height_value = $admintab_minheight}
{while $height_value lte $admintab_maxheight - $step_height}
{$height_value = $height_value + $step_height}
<option value="{$height_value|escape:'html':'UTF-8'}">{$height_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
</p>
<p style="margin-top: 10px;"><font face="Verdana, Geneva, sans-serif" size="+2">)x2</font></p>
{/if}
</div>
</div>
{if $admintab_extrafee_select}
<div style="clear:both" id="squaremeter_extrafee">
<label class="extrafee"><input type="checkbox" name="extrafee" id="extrafee" value="{$admintab_extrafee|escape:'htmlall':'UTF-8'}"/>{l s='Add Extra Fee' mod='squaremeter'}</label>
</div>
{/if}
{if $admintab_waste_select}
<div style="clear:both" id="squaremeter_waste">
<label class="waste"><input type="checkbox" name="waste" id="waste" value="{$admintab_waste|escape:'htmlall':'UTF-8'}"/> {l s='Add' mod='squaremeter'} {$admintab_waste|escape:'htmlall':'UTF-8'}% {l s='more for waste' mod='squaremeter'}</label>
</div>
{/if}
</fieldset>
<div id="dimension" align="left"></div>
<div align="left" id="totalprice" style="{if $admintab_dispprice == 'pricenototalprice'}display:none{else}display:block{/if}">
<input {if ($admintab_dispprice == 'pricetotalprice') OR ($admintab_dispprice == 'nopricetotalprice')}style="display:none"{/if} type="button" name="submit" id="totalprice_product_button" onclick="totalpriceinfospecific()" value="{l s='See the Calculated Total' mod='squaremeter'}" class="button btn btn-secondary btn-sm"/><br /><div id="totalpriceinfo" style="display:none;"></div><br />
</div>
<script type="text/javascript">
check_width();
check_height();
if (("{$admintab_dispquan|escape:'html':'UTF-8'}" == "oneinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "calcinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok"))
{
if (null != document.getElementById("quantity_wanted"))
{
$('.qty').hide();
$(".qty").prev("span").hide();
$('.product-quantity').prev().hide();
}
}
else
{
//$('.product-add-to-cart>.control-label').html("{l s='Required Quantity:' mod='squaremeter'}");
document.getElementById("quantity_wanted").readOnly=true;
}
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricebutton") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice"))
{
if (null != document.getElementById("our_price_display"))
document.getElementById("our_price_display").style.display='none';
if (null != document.getElementById("reduction_percent"))
document.getElementById("reduction_percent").style.display='none';
if (null != document.getElementById("reduction_amount"))
document.getElementById("reduction_amount").style.display='none';
if (null != document.getElementById("old_price"))
document.getElementById("old_price").style.display='none';
}
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "pricetotalprice") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice"))
document.getElementById('totalpriceinfo').style.display = 'block';
else
document.getElementById('totalpriceinfo').style.display = 'none';
</script>
{/if} {*Design 2*}
<!-- Square Meter Calculation Module -->
{/if}

View File

@@ -0,0 +1,387 @@
{*
* 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.1
* 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.
*}
{if ($page.page_name == 'product')}
<!-- Square Meter Calculation Module -->
<script>
if ($('#product_customization_id').size() > 0) {
$( "#product_customization_id" ).after( "<input type='hidden' id='dim' name='dim' value='' />" );
$( "#dim" ).after( "<input type='hidden' id='converted_ea' name='converted_ea' value='' />" );
$( "#converted_ea" ).after( "<input type='hidden' id='calculated_total' name='calculated_total' value='' />" );
$( "#calculated_total" ).after( "<input type='hidden' id='grand_calculated_total' name='grand_calculated_total' value='' />" );
$( "#grand_calculated_total" ).after( "<input type='hidden' id='extrafeevalue' name='extrafeevalue' value='' />" );
$( "#extrafeevalue" ).after( "<input type='hidden' id='wastevalue' name='wastevalue' value=''/>" );
}
</script>
{if $design_type == 'design1'} {*Design 1*}
<div id="switchx" style="display: {if $disableapplet}block{else}none{/if};">
<label class="switchx">
<input type="checkbox" name="discretion" id="discretion" value="on" checked>
<span class="sliderx roundx"></span>
</label>
<span class="close_calculator">{l s='Close the calculator' mod='squaremeter'}</span>
<span class="open_calculator">{l s='Use the calculator' mod='squaremeter'}</span>
</div>
<div id="squaremeter">
<h5>{l s='Calculator' mod='squaremeter'}
{if $admintab_picture}
{if (!$image_src)}{$image_src = $module_dir|cat:'views/img/preview_surface.jpg'}{/if}
<a href="{$image_src|escape:'html':'UTF-8'}" class="preview" onclick="return false;">
<img src="{$module_dir|escape:'html':'UTF-8'}views/img/hint.png" title="Hint" class="hint">
</a>
{/if}
</h5>
{if (($admintab_directinput) && ($admintab_dispquan != "decimalok"))} {* If direct input is allowed, step value should be one unless decimal quantity is not allowed *}
{$step = 1}
{/if}
{if !$admintab_directinput} {* If Not Allowed Direct Input*}
<div class="title_explanation">
{l s='Please enter the size in' mod='squaremeter'}&nbsp;<span><b>{$admintab_maxwidth_unit|escape:'html':'UTF-8'}</b></span>, {l s='the calculator will calculate the required number of' mod='squaremeter'}&nbsp;<span>{$admintab_conversion_unit|escape:'html':'UTF-8'}</span>&nbsp;{l s='and the total price.' mod='squaremeter'}
</div>
<div class="form-group row-group">
<div class="form-group row-item-group">
<label class="form-control-label explanation_label">{l s='Height' mod='squaremeter'}&nbsp;({$admintab_maxheight_unit|escape:'html':'UTF-8'})</label>
{l s='Please enter the height required without quantity. We will add quantities for each product of ' mod='squaremeter'}{$admintab_conversion|escape:'html':'UTF-8'}&nbsp;{$admintab_conversion_unit|escape:'html':'UTF-8'}&nbsp;({l s='height' mod='squaremeter'})
</div>
<div class="form-group row-item-group">
<label class="form-control-label height_label" for="height">{l s='Height' mod='squaremeter'}&nbsp;({$admintab_maxheight_unit|escape:'html':'UTF-8'})</label>
<div id="height">
{if !$admintab_heightcheck}
<div class="value-button decrease" onclick="decreaseValue('quantity_wanted_alth', {$step_height});check_height();check_width();" value="Decrease Value">-</div>
<input type="text" id="quantity_wanted_alth" value="{$admintab_minheight|escape:'html':'UTF-8'}" name="qty_alth" onchange="check_height();check_width();"/>
<div class="value-button increase" onclick="increaseValue('quantity_wanted_alth', {$step_height});check_height();check_width();" value="Increase Value">+</div>
{else}
<select data-toggle="select2" id="quantity_wanted_alth" name="qty_alth" onchange="check_height();check_width();">
<option value="{$admintab_minheight|escape:'html':'UTF-8'}" selected>{$admintab_minheight|escape:'html':'UTF-8'}</option>
{$height_value = $admintab_minheight}
{while $height_value lte $admintab_maxheight - $step_height}
{$height_value = $height_value + $step_height}
<option value="{$height_value|escape:'html':'UTF-8'}">{$height_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
</div>
</div>
</div>
<hr>
<div class="form-group row-group">
<div class="form-group row-item-group">
<label class="form-control-label explanation_label">{l s='Width' mod='squaremeter'}&nbsp;({$admintab_maxwidth_unit|escape:'html':'UTF-8'})</label>
{l s='Please enter the width required without quantity. We will add quantities for each product of ' mod='squaremeter'}{$admintab_conversion|escape:'html':'UTF-8'}&nbsp;{$admintab_conversion_unit|escape:'html':'UTF-8'}&nbsp;({l s='width' mod='squaremeter'})
</div>
<div class="form-group row-item-group">
<label class="form-control-label width_label" for="width">{l s='Width' mod='squaremeter'}&nbsp;({$admintab_maxwidth_unit|escape:'html':'UTF-8'})</label>
<div id="width">
{if !$admintab_widthcheck}
<div class="value-button decrease" onclick="decreaseValue('quantity_wanted_alt', {$step_width});check_width();check_height();" value="Decrease Value">-</div>
<input type="text" id="quantity_wanted_alt" value="{$admintab_minwidth|escape:'html':'UTF-8'}" name="qty_alt" onchange="check_width();check_height();"/>
<div class="value-button increase" onclick="increaseValue('quantity_wanted_alt', {$step_width});check_width();check_height();" value="Increase Value">+</div>
{else}
<select data-toggle="select2" id="quantity_wanted_alt" name="qty_alt" onchange="check_width();check_height();">
<option value="{$admintab_minwidth|escape:'html':'UTF-8'}" selected>{$admintab_minwidth|escape:'html':'UTF-8'}</option>
{$width_value = $admintab_minwidth}
{while $width_value lte $admintab_maxwidth - $step_width}
{$width_value = $width_value + $step_width}
<option value="{$width_value|escape:'html':'UTF-8'}">{$width_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
</div>
</div>
</div>
<hr>
{if $admintab_addquan}
<div class="form-group row-group">
<div class="form-group row-item-group">
<label class="form-control-label explanation_label">{l s='Quantity' mod='squaremeter'}</label>
{l s='Please enter the required quantity. We will the quantity entered by the calculated dimension to determine the amount needed.' mod='squaremeter'}
</div>
<div class="form-group row-item-group">
<label class="form-control-label quantity_label" for="quantitym">{l s='Quantity' mod='squaremeter'}</label>
<div id="quantitym">
<div class="value-button decrease" onclick="decreaseValue('quantity', 1);check_quantity();" value="Decrease Value">-</div>
<input type="number" id="quantity" value="1" name="quantity" onchange="check_quantity()"/>
<div class="value-button increase" onclick="increaseValue('quantity', 1);check_quantity();" value="Increase Value">+</div>
</div>
</div>
</div>
<hr>
{/if}
{else}
<input type="hidden" id="quantity_wanted_alt" value="" name="qty_alt"/>
<input type="hidden" id="quantity_wanted_alth" value="" name="qty_alth"/>
{/if} {* If Not Allowed Direct Input*}
<div class="form-group row-group">
<div class="form-group row-item-group">
<label class="form-control-label explanation_label">{l s='Amount of product needed' mod='squaremeter'}</label>
{l s='The calculator calculates the amount of product needed based on the dimensions you entered.' mod='squaremeter'}
</div>
<div class="form-group row-item-group">
<label class="form-control-label quantity_calculated_label" for="quantity_calculated">{l s='Number of' mod='squaremeter'}&nbsp;{$admintab_conversion_unit|escape:'html':'UTF-8'}</label>
<div id="quantity_calculated">
{if $admintab_directinput}<div class="value-button decrease" onclick="decreaseValue('directinput', {$step});check_directinput();" value="Decrease Value">-</div>{/if}
<input type="text" id="directinput" name="directinput" onchange="check_directinput()" value="0"/>
{if $admintab_directinput}<div class="value-button increase" onclick="increaseValue('directinput', {$step});check_directinput();" value="Increase Value">+</div>{/if}
</div>
</div>
</div>
{if $admintab_extrafee_select}
<div style="clear:both" id="squaremeter_extrafee">
<label class="extrafee"><input type="checkbox" name="extrafee" id="extrafee" value="{$admintab_extrafee|escape:'htmlall':'UTF-8'}"/>{l s='Add Extra Fee' mod='squaremeter'}</label>
</div>
{/if}
{if $admintab_waste_select}
<div style="clear:both" id="squaremeter_waste">
<label class="waste"><input type="checkbox" name="waste" id="waste" value="{$admintab_waste|escape:'htmlall':'UTF-8'}"/> {l s='Add' mod='squaremeter'} {$admintab_waste|escape:'htmlall':'UTF-8'}% {l s='more for waste' mod='squaremeter'}</label>
</div>
{/if}
</div>
<div id="dimension"></div>
<div id="totalprice" style="{if $admintab_dispprice == 'pricenototalprice'}display:none{else}display:block{/if}">
<input {if ($admintab_dispprice == 'pricetotalprice') OR ($admintab_dispprice == 'nopricetotalprice')}style="display:none"{/if} type="button" name="submit" id="totalprice_product_button" onclick="totalpriceinfospecific();document.getElementById('totalprice_product_button').style.display = 'none';" value="{l s='See the Calculated Total' mod='squaremeter'}" class="button btn btn-secondary btn-sm"/>
<br />
<div id="totalpriceinfo" style="display:none;"></div>
</div>
<script type="text/javascript">
{if !$admintab_directinput}
check_width();
check_height();
{/if}
if (("{$admintab_dispquan|escape:'html':'UTF-8'}" == "oneinvisible")
|| ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "calcinvisible")
|| ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcinvisible")
|| ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok")) {
if (null != document.getElementById("quantity_wanted"))
{
$('.qty').hide();
$(".qty").prev("span").hide();
$('.product-quantity').prev().hide();
document.getElementById("quantity_wanted").readOnly=true;
}
}
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricebutton") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice"))
{
if (null != document.getElementById("our_price_display"))
document.getElementById("our_price_display").style.display='none';
if (null != document.getElementById("reduction_percent"))
document.getElementById("reduction_percent").style.display='none';
if (null != document.getElementById("reduction_amount"))
document.getElementById("reduction_amount").style.display='none';
if (null != document.getElementById("old_price"))
document.getElementById("old_price").style.display='none';
}
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "pricetotalprice") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice"))
document.getElementById('totalpriceinfo').style.display = 'block';
else
document.getElementById('totalpriceinfo').style.display = 'none';
</script>
{/if} {*Design 1 End*}
{if $design_type == 'design2'} {*Design 2*}
{if $admintab_addquan}
<style type="text/css">
.labels {
font-size: .9375rem;
font-weight: 400;
}
#squaremeter, #squaremeter_extrafee, #dimension {
width:60%;
}
</style>
{else}
<style type="text/css">
.labels p {
float:left;
width:30%;
text-align: left;
}
#dimension, #squaremeter_extrafee {
width:40%;
}
</style>
{/if}
<div id="switchx" style="display: {if $disableapplet}block{else}none{/if};">
<label class="switchx">
<input type="checkbox" name="discretion" id="discretion" value="on" checked>
<span class="sliderx roundx"></span>
</label>
<span class="close_calculator">{l s='Close the calculator' mod='squaremeter'}</span>
<span class="open_calculator">{l s='Use the calculator' mod='squaremeter'}</span>
</div>
<fieldset id="squaremeter" >
{if $admintab_addquan}
<legend>
{if $admintab_picture}
{if (!$image_src)}{$image_src = $module_dir|cat:'views/img/preview_surface.jpg'}{/if}
<a href="{$image_src|escape:'html':'UTF-8'}" class="preview" onclick="return false;">
<img src="{$module_dir|escape:'html':'UTF-8'}views/img/hint.png" title="Hint" class="hint">
</a>
{/if}
&nbsp;{l s='Please enter surface/quantity' mod='squaremeter'}&nbsp;
</legend>
{else}
<legend>
{if $admintab_picture}
{if (!$image_src)}{$image_src = $module_dir|cat:'views/img/preview_surface.jpg'}{/if}
<a href="{$image_src|escape:'html':'UTF-8'}" class="preview" onclick="return false;">
<img src="{$module_dir|escape:'html':'UTF-8'}views/img/hint.png" title="Hint" class="hint">
</a>
{/if}
&nbsp;{l s='Please enter surface' mod='squaremeter'}&nbsp;
</legend>
{/if}
<div>
<table>
<head>
{if $admintab_directinput}
<th>{l s='Surface' mod='squaremeter'}&nbsp;({$admintab_conversion_unit|escape:'html':'UTF-8'})</th>
{else}
<th>{l s='Width' mod='squaremeter'}&nbsp;({$admintab_maxwidth_unit|escape:'html':'UTF-8'})</th>
<th style="width:20px;"></th>
<th>{l s='Height' mod='squaremeter'}&nbsp;({$admintab_maxheight_unit|escape:'html':'UTF-8'})</th>
{/if}
{if $admintab_addquan}
<th style="width:20px;"></th>
<th>{l s='Piece(s)' mod='squaremeter'}</th>
{/if}
</head>
<tbody>
<tr>
{if $admintab_directinput}
<td>
<p id="directinput_p">
{if !$admintab_widthcheck}
<input id="directinput" type="text" value="{$admintab_minwidth|escape:'html':'UTF-8'}" name="directinput" onchange="check_directinput()"></input>
{else}
<select data-toggle="select2" id="directinput" name="directinput" onchange="check_directinput()">
<option value="{$admintab_minwidth|escape:'html':'UTF-8'}" selected>{$admintab_minwidth|escape:'html':'UTF-8'}</option>
{$width_value = $admintab_minwidth}
{while $width_value lte $admintab_maxwidth - $step_width}
{$width_value = $width_value + $step_width}
<option value="{$width_value|escape:'html':'UTF-8'}">{$width_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
</p>
<input type="hidden" id="quantity_wanted_alt" value="" name="qty_alt"/>
<input type="hidden" id="quantity_wanted_alth" value="" name="qty_alth"/>
</td>
{else}
<td style="{if !$admintab_addquan}width:20%;{/if}">
<p id="width">
{if !$admintab_widthcheck}
<input id="quantity_wanted_alt" type="text" value="{$admintab_minwidth|escape:'html':'UTF-8'}" name="qty_alt" onchange="check_height();check_width();"></input>
{else}
<select data-toggle="select2" id="quantity_wanted_alt" name="qty_alt" onchange="check_height();check_width();">
<option value="{$admintab_minwidth|escape:'html':'UTF-8'}" selected>{$admintab_minwidth|escape:'html':'UTF-8'}</option>
{$width_value = $admintab_minwidth}
{while $width_value lte $admintab_maxwidth - $step_width}
{$width_value = $width_value + $step_width}
<option value="{$width_value|escape:'html':'UTF-8'}">{$width_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
</p>
</td>
<td> <p id="multiplicationsign"><font face="Verdana, Geneva, sans-serif" size="+1">{l s='X' mod='squaremeter'}&nbsp;&nbsp;</font></p></td>
<td>
<p id="height">
{if !$admintab_heightcheck}
<input id="quantity_wanted_alth" type="text" value="{$admintab_minheight|escape:'html':'UTF-8'}" name="qty_alth" onchange="check_height();check_width();"></input>
{else}
<select data-toggle="select2" id="quantity_wanted_alth" name="qty_alth" onchange="check_height();check_width();">
<option value="{$admintab_minheight|escape:'html':'UTF-8'}" selected>{$admintab_minheight|escape:'html':'UTF-8'}</option>
{$height_value = $admintab_minheight}
{while $height_value lte $admintab_maxheight - $step_height}
{$height_value = $height_value + $step_height}
<option value="{$height_value|escape:'html':'UTF-8'}">{$height_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
</p>
</td>
{/if}
{if $admintab_addquan}
<td><p id="multiplicationsign"><font face="Verdana, Geneva, sans-serif" size="+1">{l s='X' mod='squaremeter'}&nbsp;&nbsp;</font></p></td>
<td><p id="quantitym"><input id="quantity" type="text" value="1" name="quantity" onchange="check_quantity()"></input></p><td>
{/if}
</tr>
</tbody>
</table>
</div>
{if $admintab_extrafee_select}
<div style="clear:both" id="squaremeter_extrafee">
<label class="extrafee"><input type="checkbox" name="extrafee" id="extrafee" value="{$admintab_extrafee|escape:'htmlall':'UTF-8'}"/>{l s='Add Extra Fee' mod='squaremeter'}</label>
</div>
{/if}
{if $admintab_waste_select}
<div style="clear:both" id="squaremeter_waste">
<label class="waste"><input type="checkbox" name="waste" id="waste" value="{$admintab_waste|escape:'htmlall':'UTF-8'}"/> {l s='Add' mod='squaremeter'} {$admintab_waste|escape:'htmlall':'UTF-8'}% {l s='more for waste' mod='squaremeter'}</label>
</div>
{/if}
</fieldset>
<div id="dimension"></div>
<div id="totalprice" style="{if $admintab_dispprice == 'pricenototalprice'}display:none{else}display:block{/if}">
<input {if ($admintab_dispprice == 'pricetotalprice') OR ($admintab_dispprice == 'nopricetotalprice')}style="display:none"{/if} type="button" name="submit" id="totalprice_product_button" onclick="totalpriceinfospecific()" value="{l s='See the Calculated Total' mod='squaremeter'}" class="button btn btn-secondary btn-sm"/><br /><div id="totalpriceinfo" style="display:none;"></div><br />
</div>
<script type="text/javascript">
check_width();
check_height();
if (("{$admintab_dispquan|escape:'html':'UTF-8'}" == "oneinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "calcinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok"))
{
if (null != document.getElementById("quantity_wanted"))
{
$('.qty').hide();
$(".qty").prev("span").hide();
$('.product-quantity').prev().hide();
}
}
else
{
//$('.product-add-to-cart>.control-label').html("{l s='Required Quantity:' mod='squaremeter'}");
document.getElementById("quantity_wanted").readOnly=true;
}
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricebutton") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice"))
{
if (null != document.getElementById("our_price_display"))
document.getElementById("our_price_display").style.display='none';
if (null != document.getElementById("reduction_percent"))
document.getElementById("reduction_percent").style.display='none';
if (null != document.getElementById("reduction_amount"))
document.getElementById("reduction_amount").style.display='none';
if (null != document.getElementById("old_price"))
document.getElementById("old_price").style.display='none';
}
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "pricetotalprice") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice"))
document.getElementById('totalpriceinfo').style.display = 'block';
else
document.getElementById('totalpriceinfo').style.display = 'none';
</script>
{/if} {*Design 2*}
<!-- Square Meter Calculation Module -->
{/if}

View File

@@ -0,0 +1,436 @@
{*
* 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.1
* 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.
*}
{if ($page.page_name == 'product')}
<!-- Square Meter Calculation Module -->
<script>
if ($('#product_customization_id').size() > 0) {
$( "#product_customization_id" ).after( "<input type='hidden' id='dim' name='dim' value='' />" );
$( "#dim" ).after( "<input type='hidden' id='converted_ea' name='converted_ea' value='' />" );
$( "#converted_ea" ).after( "<input type='hidden' id='calculated_total' name='calculated_total' value='' />" );
$( "#calculated_total" ).after( "<input type='hidden' id='grand_calculated_total' name='grand_calculated_total' value='' />" );
$( "#grand_calculated_total" ).after( "<input type='hidden' id='extrafeevalue' name='extrafeevalue' value='' />" );
$( "#extrafeevalue" ).after( "<input type='hidden' id='wastevalue' name='wastevalue' value='' />" );
}
</script>
{if $design_type == 'design1'} {*Design 1*}
<div id="switchx" style="display: {if $disableapplet}block{else}none{/if};">
<label class="switchx">
<input type="checkbox" name="discretion" id="discretion" value="on" checked>
<span class="sliderx roundx"></span>
</label>
<span class="close_calculator">{l s='Close the calculator' mod='squaremeter'}</span>
<span class="open_calculator">{l s='Use the calculator' mod='squaremeter'}</span>
</div>
<div id="squaremeter">
<h5>{l s='Calculator' mod='squaremeter'}
{if $admintab_picture}
{if (!$image_src)}{$image_src = $module_dir|cat:'views/img/preview_volume.jpg'}{/if}
<a href="{$image_src|escape:'html':'UTF-8'}" class="preview" onclick="return false;">
<img src="{$module_dir|escape:'html':'UTF-8'}views/img/hint.png" title="Hint" class="hint">
</a>
{/if}
</h5>
{if (($admintab_directinput) && ($admintab_dispquan != "decimalok"))} {* If direct input is allowed, step value should be one unless decimal quantity is not allowed *}
{$step = 1}
{/if}
{if !$admintab_directinput} {* If Not Allowed Direct Input*}
<div class="title_explanation">
{l s='Please enter the size in' mod='squaremeter'}&nbsp;<span><b>{$admintab_maxwidth_unit|escape:'html':'UTF-8'}</b></span>, {l s='the calculator will calculate the required number of' mod='squaremeter'}&nbsp;<span>{$admintab_conversion_unit|escape:'html':'UTF-8'}</span>&nbsp;{l s='and the total price.' mod='squaremeter'}
</div>
<div class="form-group row-group">
<div class="form-group row-item-group">
<label class="form-control-label explanation_label">{l s='Height' mod='squaremeter'}&nbsp;({$admintab_maxheight_unit|escape:'html':'UTF-8'})</label>
{l s='Please enter the height required without quantity. We will add quantities for each product of ' mod='squaremeter'}{$admintab_conversion|escape:'html':'UTF-8'}&nbsp;{$admintab_conversion_unit|escape:'html':'UTF-8'}&nbsp;({l s='height' mod='squaremeter'})
</div>
<div class="form-group row-item-group">
<label class="form-control-label height_label" for="height">{l s='Height' mod='squaremeter'}&nbsp;({$admintab_maxheight_unit|escape:'html':'UTF-8'})</label>
<div id="height">
{if !$admintab_heightcheck}
<div class="value-button decrease" onclick="decreaseValue('quantity_wanted_alth', {$step_height});check_width();check_height();check_depth();" value="Decrease Value">-</div>
<input type="text" id="quantity_wanted_alth" value="{$admintab_minheight|escape:'html':'UTF-8'}" name="qty_alth" onchange="check_width();check_height();check_depth();"/>
<div class="value-button increase" onclick="increaseValue('quantity_wanted_alth', {$step_height});check_width();check_height();check_depth();" value="Increase Value">+</div>
{else}
<select data-toggle="select2" id="quantity_wanted_alth" name="qty_alth" onchange="check_width();check_height();check_depth();">
<option value="{$admintab_minheight|escape:'html':'UTF-8'}" selected>{$admintab_minheight|escape:'html':'UTF-8'}</option>
{$height_value = $admintab_minheight}
{while $height_value lte $admintab_maxheight - $step_height}
{$height_value = $height_value + $step_height}
<option value="{$height_value|escape:'html':'UTF-8'}">{$height_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
</div>
</div>
</div>
<hr>
<div class="form-group row-group">
<div class="form-group row-item-group">
<label class="form-control-label explanation_label">{l s='Width' mod='squaremeter'}&nbsp;({$admintab_maxwidth_unit|escape:'html':'UTF-8'})</label>
{l s='Please enter the width required without quantity. We will add quantities for each product of ' mod='squaremeter'}{$admintab_conversion|escape:'html':'UTF-8'}&nbsp;{$admintab_conversion_unit|escape:'html':'UTF-8'}&nbsp;({l s='width' mod='squaremeter'})
</div>
<div class="form-group row-item-group">
<label class="form-control-label width_label" for="width">{l s='Width' mod='squaremeter'}&nbsp;({$admintab_maxwidth_unit|escape:'html':'UTF-8'})</label>
<div id="width">
{if !$admintab_widthcheck}
<div class="value-button decrease" onclick="decreaseValue('quantity_wanted_alt', {$step_width});check_width();check_height();check_depth();" value="Decrease Value">-</div>
<input type="text" id="quantity_wanted_alt" value="{$admintab_minwidth|escape:'html':'UTF-8'}" name="qty_alt" onchange="check_width();check_height();check_depth();"/>
<div class="value-button increase" onclick="increaseValue('quantity_wanted_alt', {$step_width});check_width();check_height();check_depth();" value="Increase Value">+</div>
{else}
<select data-toggle="select2" id="quantity_wanted_alt" name="qty_alt" onchange="check_width();check_height();check_depth();">
<option value="{$admintab_minwidth|escape:'html':'UTF-8'}" selected>{$admintab_minwidth|escape:'html':'UTF-8'}</option>
{$width_value = $admintab_minwidth}
{while $width_value lte $admintab_maxwidth - $step_width}
{$width_value = $width_value + $step_width}
<option value="{$width_value|escape:'html':'UTF-8'}">{$width_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
</div>
</div>
</div>
<hr>
<div class="form-group row-group">
<div class="form-group row-item-group">
<label class="form-control-label explanation_label">{l s='Depth' mod='squaremeter'}&nbsp;({$admintab_maxdepth_unit|escape:'html':'UTF-8'})</label>
{l s='Please enter the depth required without quantity. We will add quantities for each product of ' mod='squaremeter'}{$admintab_conversion|escape:'html':'UTF-8'}&nbsp;{$admintab_conversion_unit|escape:'html':'UTF-8'}&nbsp;({l s='depth' mod='squaremeter'})
</div>
<div class="form-group row-item-group">
<label class="form-control-label depth_label" for="depth">{l s='Depth' mod='squaremeter'}&nbsp;({$admintab_maxdepth_unit|escape:'html':'UTF-8'})</label>
<div id="depth">
{if !$admintab_depthcheck}
<div class="value-button decrease" onclick="decreaseValue('quantity_wanted_altd', {$step_depth});check_width();check_height();check_depth();" value="Decrease Value">-</div>
<input type="text" id="quantity_wanted_altd" value="{$admintab_mindepth|escape:'html':'UTF-8'}" name="qty_altd" onchange="check_width();check_height();check_depth();"/>
<div class="value-button increase" onclick="increaseValue('quantity_wanted_altd', {$step_depth});check_width();check_height();check_depth();" value="Increase Value">+</div>
{else}
<select data-toggle="select2" id="quantity_wanted_altd" name="qty_altd" onchange="check_width();check_height();check_depth();">
<option value="{$admintab_mindepth|escape:'html':'UTF-8'}" selected>{$admintab_mindepth|escape:'html':'UTF-8'}</option>
{$depth_value = $admintab_mindepth}
{while $depth_value lte $admintab_maxdepth - $step_depth}
{$depth_value = $depth_value + $step_depth}
<option value="{$depth_value|escape:'html':'UTF-8'}">{$depth_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
</div>
</div>
</div>
<hr>
{if $admintab_addquan}
<div class="form-group row-group">
<div class="form-group row-item-group">
<label class="form-control-label explanation_label">{l s='Quantity' mod='squaremeter'}</label>
{l s='Please enter the required quantity. We will the quantity entered by the calculated dimension to determine the amount needed.' mod='squaremeter'}
</div>
<div class="form-group row-item-group">
<label class="form-control-label quantity_label" for="quantitym">{l s='Quantity' mod='squaremeter'}</label>
<div id="quantitym">
<div class="value-button decrease" onclick="decreaseValue('quantity', 1);check_quantity();" value="Decrease Value">-</div>
<input type="number" id="quantity" value="1" name="quantity" onchange="check_quantity()"/>
<div class="value-button increase" onclick="increaseValue('quantity', 1);check_quantity();" value="Increase Value">+</div>
</div>
</div>
</div>
<hr>
{/if}
{else}
<input type="hidden" id="quantity_wanted_alt" value="" name="qty_alt"/>
<input type="hidden" id="quantity_wanted_alth" value="" name="qty_alth"/>
<input type="hidden" id="quantity_wanted_altd" value="" name="qty_altd"/>
{/if} {* If Not Allowed Direct Input*}
<div class="form-group row-group">
<div class="form-group row-item-group">
<label class="form-control-label explanation_label">{l s='Amount of product needed' mod='squaremeter'}</label>
{l s='The calculator calculates the amount of product needed based on the dimensions you entered.' mod='squaremeter'}
</div>
<div class="form-group row-item-group">
<label class="form-control-label quantity_calculated_label" for="quantity_calculated">{l s='Number of' mod='squaremeter'}&nbsp;{$admintab_conversion_unit|escape:'html':'UTF-8'}</label>
<div id="quantity_calculated">
{if $admintab_directinput}<div class="value-button decrease" onclick="decreaseValue('directinput', {$step});check_directinput();" value="Decrease Value">-</div>{/if}
<input type="text" id="directinput" name="directinput" onchange="check_directinput()" value="0"/>
{if $admintab_directinput}<div class="value-button increase" onclick="increaseValue('directinput', {$step});check_directinput();" value="Increase Value">+</div>{/if}
</div>
</div>
</div>
{if $admintab_extrafee_select}
<div style="clear:both" id="squaremeter_extrafee">
<label class="extrafee"><input type="checkbox" name="extrafee" id="extrafee" value="{$admintab_extrafee|escape:'htmlall':'UTF-8'}"/>{l s='Add Extra Fee' mod='squaremeter'}</label>
</div>
{/if}
{if $admintab_waste_select}
<div style="clear:both" id="squaremeter_waste">
<label class="waste"><input type="checkbox" name="waste" id="waste" value="{$admintab_waste|escape:'htmlall':'UTF-8'}"/> {l s='Add' mod='squaremeter'} {$admintab_waste|escape:'htmlall':'UTF-8'}% {l s='more for waste' mod='squaremeter'}</label>
</div>
{/if}
</div>
<div id="dimension"></div>
<div id="totalprice" style="{if $admintab_dispprice == 'pricenototalprice'}display:none{else}display:block{/if}">
<input {if ($admintab_dispprice == 'pricetotalprice') OR ($admintab_dispprice == 'nopricetotalprice')}style="display:none"{/if} type="button" name="submit" id="totalprice_product_button" onclick="totalpriceinfospecific();document.getElementById('totalprice_product_button').style.display = 'none';" value="{l s='See the Calculated Total' mod='squaremeter'}" class="button btn btn-secondary btn-sm"/>
<br />
<div id="totalpriceinfo" style="display:none;"></div>
</div>
<script type="text/javascript">
{if !$admintab_directinput}
check_width();
check_height();
check_depth();
{/if}
if (("{$admintab_dispquan|escape:'html':'UTF-8'}" == "oneinvisible")
|| ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "calcinvisible")
|| ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcinvisible")
|| ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok")) {
if (null != document.getElementById("quantity_wanted"))
{
$('.qty').hide();
$(".qty").prev("span").hide();
$('.product-quantity').prev().hide();
document.getElementById("quantity_wanted").readOnly=true;
}
}
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricebutton") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice"))
{
if (null != document.getElementById("our_price_display"))
document.getElementById("our_price_display").style.display='none';
if (null != document.getElementById("reduction_percent"))
document.getElementById("reduction_percent").style.display='none';
if (null != document.getElementById("reduction_amount"))
document.getElementById("reduction_amount").style.display='none';
if (null != document.getElementById("old_price"))
document.getElementById("old_price").style.display='none';
}
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "pricetotalprice") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice"))
document.getElementById('totalpriceinfo').style.display = 'block';
else
document.getElementById('totalpriceinfo').style.display = 'none';
</script>
{/if} {*Design 1 End*}
{if $design_type == 'design2'} {*Design 2*}
{if $admintab_directinput}
<style type="text/css">
.fields{
clear:both;
}
</style>
{/if}
{if $admintab_addquan}
<style type="text/css">
.labels p {
float:left;
width:12%;
}
#squaremeter, #squaremeter_extrafee {
width:75%;
}
</style>
{else}
<style type="text/css">
.labels p {
float:left;
{if $admintab_directinput}
width:100%;
{else}
width:17%;
{/if}
}
#squaremeter, #squaremeter_extrafee {
margin-left:0px;
width:55%;
}
</style>
{/if}
<div id="switchx" style="display: {if $disableapplet}block{else}none{/if};">
<label class="switchx">
<input type="checkbox" name="discretion" id="discretion" value="on" checked>
<span class="sliderx roundx"></span>
</label>
<span class="close_calculator">{l s='Close the calculator' mod='squaremeter'}</span>
<span class="open_calculator">{l s='Use the calculator' mod='squaremeter'}</span>
</div>
<fieldset id="squaremeter" >
{if $admintab_addquan}
<legend>
{if $admintab_picture}
{if (!$image_src)}{$image_src = $module_dir|cat:'views/img/preview_volume.jpg'}{/if}
<a href="{$image_src|escape:'html':'UTF-8'}" class="preview" onclick="return false;">
<img src="{$module_dir|escape:'html':'UTF-8'}views/img/hint.png" title="Hint" class="hint">
</a>
{/if}
&nbsp;{l s='Please enter volume/quantity' mod='squaremeter'}&nbsp;
</legend>
{else}
<legend>
{if $admintab_picture}
{if (!$image_src)}{$image_src = $module_dir|cat:'views/img/preview_volume.jpg'}{/if}
<a href="{$image_src|escape:'html':'UTF-8'}" class="preview" onclick="return false;">
<img src="{$module_dir|escape:'html':'UTF-8'}views/img/hint.png" title="Hint" class="hint">
</a>
{/if}
&nbsp;{l s='Please enter volume' mod='squaremeter'}&nbsp;
</legend>
{/if}
<div>
<div class="labels">
{if $admintab_directinput}
<p>{l s='Volume' mod='squaremeter'}&nbsp;({$admintab_conversion_unit|escape:'html':'UTF-8'})</p>
{else}
<p>{l s='Width' mod='squaremeter'}&nbsp;({$admintab_maxwidth_unit|escape:'html':'UTF-8'})</p>
<p>&nbsp;</p>
<p>{l s='Height' mod='squaremeter'}&nbsp;({$admintab_maxheight_unit|escape:'html':'UTF-8'})</p>
<p>&nbsp;</p>
<p>{l s='Depth' mod='squaremeter'}&nbsp;({$admintab_maxdepth_unit|escape:'html':'UTF-8'})</p>
{/if}
{if $admintab_addquan}
<p>&nbsp;</p>
<p>{l s='Piece(s)' mod='squaremeter'}</p>
{/if}
</div>
<div class="fields">
{if $admintab_directinput}
<p id="directinput_p">
{if !$admintab_widthcheck}
<input id="directinput" type="text" value="{$admintab_minwidth|escape:'html':'UTF-8'}" name="directinput" onchange="check_directinput()"></input>
{else}
<select data-toggle="select2" id="directinput" name="directinput" onchange="check_directinput()">
<option value="{$admintab_minwidth|escape:'html':'UTF-8'}" selected>{$admintab_minwidth|escape:'html':'UTF-8'}</option>
{$width_value = $admintab_minwidth}
{while $width_value lte $admintab_maxwidth - $step_width}
{$width_value = $width_value + $step_width}
<option value="{$width_value|escape:'html':'UTF-8'}">{$width_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
</p>
<input type="hidden" id="quantity_wanted_alt" value="" name="qty_alt"/>
<input type="hidden" id="quantity_wanted_alth" value="" name="qty_alth"/>
<input type="hidden" id="quantity_wanted_altd" value="" name="qty_altd"/>
{else}
<p id="width">
{if !$admintab_widthcheck}
<input id="quantity_wanted_alt" type="text" value="{$admintab_minwidth|escape:'html':'UTF-8'}" name="qty_alt" onchange="check_width();check_height();check_depth();"></input>
{else}
<select data-toggle="select2" id="quantity_wanted_alt" name="qty_alt" onchange="check_width();check_height();check_depth();">
<option value="{$admintab_minwidth|escape:'html':'UTF-8'}" selected>{$admintab_minwidth|escape:'html':'UTF-8'}</option>
{$width_value = $admintab_minwidth}
{while $width_value lte $admintab_maxwidth - $step_width}
{$width_value = $width_value + $step_width}
<option value="{$width_value|escape:'html':'UTF-8'}">{$width_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
</p>
<p id="multiplicationsign">{l s='X' mod='squaremeter'}&nbsp;</p>
<p id="height">
{if !$admintab_heightcheck}
<input id="quantity_wanted_alth" type="text" value="{$admintab_minheight|escape:'html':'UTF-8'}" name="qty_alth" onchange="check_width();check_height();check_depth();"></input>
{else}
<select data-toggle="select2" id="quantity_wanted_alth" name="qty_alth" onchange="check_width();check_height();check_depth();">
<option value="{$admintab_minheight|escape:'html':'UTF-8'}" selected>{$admintab_minheight|escape:'html':'UTF-8'}</option>
{$height_value = $admintab_minheight}
{while $height_value lte $admintab_maxheight - $step_height}
{$height_value = $height_value + $step_height}
<option value="{$height_value|escape:'html':'UTF-8'}">{$height_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
</p>
<p id="multiplicationsign">{l s='X' mod='squaremeter'}&nbsp;</p>
<p id="depth">
{if !$admintab_depthcheck}
<input id="quantity_wanted_altd" type="text" value="{$admintab_mindepth|escape:'html':'UTF-8'}" name="qty_altd" onchange="check_width();check_height();check_depth();"></input>
{else}
<select data-toggle="select2" id="quantity_wanted_altd" name="qty_altd" onchange="check_width();check_height();check_depth();">
<option value="{$admintab_mindepth|escape:'html':'UTF-8'}" selected>{$admintab_mindepth|escape:'html':'UTF-8'}</option>
{$depth_value = $admintab_mindepth}
{while $depth_value lte $admintab_maxdepth - $step_depth}
{$depth_value = $depth_value + $step_depth}
<option value="{$depth_value|escape:'html':'UTF-8'}">{$depth_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
</p>
{/if}
{if $admintab_addquan}
<p id="multiplicationsign">{l s='X' mod='squaremeter'}&nbsp;</p>
<p id="quantitym"><input id="quantity" type="text" value="1" name="quantity" onchange="check_quantity()"></input></p>
{/if}
</div>
</div>
{if $admintab_extrafee_select}
<div style="clear:both" id="squaremeter_extrafee">
<label class="extrafee"><input type="checkbox" name="extrafee" id="extrafee" value="{$admintab_extrafee|escape:'htmlall':'UTF-8'}"/>{l s='Add Extra Fee' mod='squaremeter'}</label>
</div>
{/if}
{if $admintab_waste_select}
<div style="clear:both" id="squaremeter_waste">
<label class="waste"><input type="checkbox" name="waste" id="waste" value="{$admintab_waste|escape:'htmlall':'UTF-8'}"/> {l s='Add' mod='squaremeter'} {$admintab_waste|escape:'htmlall':'UTF-8'}% {l s='more for waste' mod='squaremeter'}</label>
</div>
{/if}
</fieldset>
<div id="dimension"></div>
<div id="totalprice" style="{if $admintab_dispprice == 'pricenototalprice'}display:none{else}display:block{/if}">
<input {if ($admintab_dispprice == 'pricetotalprice') OR ($admintab_dispprice == 'nopricetotalprice')}style="display:none"{/if} type="button" name="submit" id="totalprice_product_button" onclick="totalpriceinfospecific()" value="{l s='See the Calculated Total' mod='squaremeter'}" class="button btn btn-secondary btn-sm"/><br /><div id="totalpriceinfo" style="display:none;"></div><br />
</div>
<script type="text/javascript">
check_width();
check_height();
check_depth();
if (("{$admintab_dispquan|escape:'html':'UTF-8'}" == "oneinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "calcinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok"))
{
if (null != document.getElementById("quantity_wanted"))
{
$('.qty').hide();
$(".qty").prev("span").hide();
$('.product-quantity').prev().hide();
}
}
else
{
//$('.product-add-to-cart>.control-label').html("{l s='Required Quantity:' mod='squaremeter'}");
document.getElementById("quantity_wanted").readOnly=true;
}
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricebutton") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice"))
{
if (null != document.getElementById("our_price_display"))
document.getElementById("our_price_display").style.display='none';
if (null != document.getElementById("reduction_percent"))
document.getElementById("reduction_percent").style.display='none';
if (null != document.getElementById("reduction_amount"))
document.getElementById("reduction_amount").style.display='none';
if (null != document.getElementById("old_price"))
document.getElementById("old_price").style.display='none';
}
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "pricetotalprice") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice"))
document.getElementById('totalpriceinfo').style.display = 'block';
else
document.getElementById('totalpriceinfo').style.display = 'none';
</script>
{/if} {*Design 2*}
<!-- Square Meter Calculation Module -->
{/if}

View File

@@ -0,0 +1,288 @@
{*
* 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.1
* 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.
*}
{if ($page.page_name == 'product')}
<!-- Square Meter Calculation Module -->
<script>
if ($('#product_customization_id').size() > 0) {
$( "#product_customization_id" ).after( "<input type='hidden' id='dim' name='dim' value='' />" );
$( "#dim" ).after( "<input type='hidden' id='converted_ea' name='converted_ea' value='' />" );
$( "#converted_ea" ).after( "<input type='hidden' id='calculated_total' name='calculated_total' value='' />" );
$( "#calculated_total" ).after( "<input type='hidden' id='grand_calculated_total' name='grand_calculated_total' value='' />" );
$( "#grand_calculated_total" ).after( "<input type='hidden' id='extrafeevalue' name='extrafeevalue' value='' />" );
$( "#extrafeevalue" ).after( "<input type='hidden' id='wastevalue' name='wastevalue' value='' />" );
}
</script>
{if $design_type == 'design1'} {*Design 1*}
<div id="switchx" style="display: {if $disableapplet}block{else}none{/if};">
<label class="switchx">
<input type="checkbox" name="discretion" id="discretion" value="on" checked>
<span class="sliderx roundx"></span>
</label>
<span class="close_calculator">{l s='Close the calculator' mod='squaremeter'}</span>
<span class="open_calculator">{l s='Use the calculator' mod='squaremeter'}</span>
</div>
<div id="squaremeter">
<h5>{l s='Calculator' mod='squaremeter'}
{if $admintab_picture}
{if (!$image_src)}{$image_src = $module_dir|cat:'views/img/preview_weight.jpg'}{/if}
<a href="{$image_src|escape:'html':'UTF-8'}" class="preview" onclick="return false;">
<img src="{$module_dir|escape:'html':'UTF-8'}views/img/hint.png" title="Hint" class="hint">
</a>
{/if}
</h5>
{if (($admintab_directinput) && ($admintab_dispquan != "decimalok"))} {* If direct input is allowed, step value should be one unless decimal quantity is not allowed *}
{$step = 1}
{/if}
{if !$admintab_directinput} {* If Not Allowed Direct Input*}
<div class="title_explanation">
{l s='Please enter the size in' mod='squaremeter'}&nbsp;<span><b>{$admintab_maxweight_unit|escape:'html':'UTF-8'}</b></span>, {l s='the calculator will calculate the required number of' mod='squaremeter'}&nbsp;<span>{$admintab_conversion_unit|escape:'html':'UTF-8'}</span>&nbsp;{l s='and the total price.' mod='squaremeter'}
</div>
<div class="form-group row-group">
<div class="form-group row-item-group">
<label class="form-control-label explanation_label">{l s='Weight' mod='squaremeter'}&nbsp;({$admintab_maxweight_unit|escape:'html':'UTF-8'})</label>
{l s='Please enter the weight required without quantity. We will add quantities for each product of ' mod='squaremeter'}{$admintab_conversion|escape:'html':'UTF-8'}&nbsp;{$admintab_conversion_unit|escape:'html':'UTF-8'}&nbsp;({l s='weight' mod='squaremeter'})
</div>
<div class="form-group row-item-group">
<label class="form-control-label weight_label" for="weight">{l s='Weight' mod='squaremeter'}&nbsp;({$admintab_maxweight_unit|escape:'html':'UTF-8'})</label>
<div id="weight">
{if !$admintab_weightcheck}
<div class="value-button decrease" onclick="decreaseValue('quantity_wanted_alt', {$step});check_weight();" value="Decrease Value">-</div>
<input type="text" id="quantity_wanted_alt" value="{$admintab_minweight|escape:'html':'UTF-8'}" name="qty_alt" onchange="check_weight();"/>
<div class="value-button increase" onclick="increaseValue('quantity_wanted_alt', {$step});check_weight();" value="Increase Value">+</div>
{else}
<select data-toggle="select2" id="quantity_wanted_alt" name="qty_alt" onchange="check_weight();">
<option value="{$admintab_minweight|escape:'html':'UTF-8'}" selected>{$admintab_minweight|escape:'html':'UTF-8'}</option>
{$weight_value = $admintab_minweight}
{while $weight_value lte $admintab_maxweight - $step}
{$weight_value = $weight_value + $step}
<option value="{$weight_value|escape:'html':'UTF-8'}">{$weight_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
</div>
</div>
</div>
<hr>
{if $admintab_addquan}
<div class="form-group row-group">
<div class="form-group row-item-group">
<label class="form-control-label explanation_label">{l s='Quantity' mod='squaremeter'}</label>
{l s='Please enter the required quantity. We will the quantity entered by the calculated dimension to determine the amount needed.' mod='squaremeter'}
</div>
<div class="form-group row-item-group">
<label class="form-control-label quantity_label" for="quantitym">{l s='Quantity' mod='squaremeter'}</label>
<div id="quantitym">
<div class="value-button decrease" onclick="decreaseValue('quantity', 1);check_quantity();" value="Decrease Value">-</div>
<input type="number" id="quantity" value="1" name="quantity" onchange="check_quantity()"/>
<div class="value-button increase" onclick="increaseValue('quantity', 1);check_quantity();" value="Increase Value">+</div>
</div>
</div>
</div>
<hr>
{/if}
{else}
<input type="hidden" id="quantity_wanted_alt" value="" name="qty_alt"/>
{/if} {* If Not Allowed Direct Input*}
<div class="form-group row-group">
<div class="form-group row-item-group">
<label class="form-control-label explanation_label">{l s='Amount of product needed' mod='squaremeter'}</label>
{l s='The calculator calculates the amount of product needed based on the dimensions you entered.' mod='squaremeter'}
</div>
<div class="form-group row-item-group">
<label class="form-control-label quantity_calculated_label" for="quantity_calculated">{l s='Number of' mod='squaremeter'}&nbsp;{$admintab_conversion_unit|escape:'html':'UTF-8'}</label>
<div id="quantity_calculated">
{if $admintab_directinput}<div class="value-button decrease" onclick="decreaseValue('directinput', {$step});check_directinput();" value="Decrease Value">-</div>{/if}
<input type="text" id="directinput" name="directinput" onchange="check_directinput()" value="0"/>
{if $admintab_directinput}<div class="value-button increase" onclick="increaseValue('directinput', {$step});check_directinput();" value="Increase Value">+</div>{/if}
</div>
</div>
</div>
{if $admintab_extrafee_select}
<div style="clear:both" id="squaremeter_extrafee">
<label class="extrafee"><input type="checkbox" name="extrafee" id="extrafee" value="{$admintab_extrafee|escape:'htmlall':'UTF-8'}"/>{l s='Add Extra Fee' mod='squaremeter'}</label>
</div>
{/if}
{if $admintab_waste_select}
<div style="clear:both" id="squaremeter_waste">
<label class="waste"><input type="checkbox" name="waste" id="waste" value="{$admintab_waste|escape:'htmlall':'UTF-8'}"/> {l s='Add' mod='squaremeter'} {$admintab_waste|escape:'htmlall':'UTF-8'}% {l s='more for waste' mod='squaremeter'}</label>
</div>
{/if}
</div>
<div id="dimension"></div>
<div id="totalprice" style="{if $admintab_dispprice == 'pricenototalprice'}display:none{else}display:block{/if}">
<input {if ($admintab_dispprice == 'pricetotalprice') OR ($admintab_dispprice == 'nopricetotalprice')}style="display:none"{/if} type="button" name="submit" id="totalprice_product_button" onclick="totalpriceinfospecific();document.getElementById('totalprice_product_button').style.display = 'none';" value="{l s='See the Calculated Total' mod='squaremeter'}" class="button btn btn-secondary btn-sm"/>
<br />
<div id="totalpriceinfo" style="display:none;"></div>
</div>
<script type="text/javascript">
{if !$admintab_directinput}
check_weight();
{/if}
if (("{$admintab_dispquan|escape:'html':'UTF-8'}" == "oneinvisible")
|| ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "calcinvisible")
|| ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcinvisible")
|| ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok")) {
if (null != document.getElementById("quantity_wanted"))
{
$('.qty').hide();
$(".qty").prev("span").hide();
$('.product-quantity').prev().hide();
document.getElementById("quantity_wanted").readOnly=true;
}
}
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricebutton") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice"))
{
if (null != document.getElementById("our_price_display"))
document.getElementById("our_price_display").style.display='none';
if (null != document.getElementById("reduction_percent"))
document.getElementById("reduction_percent").style.display='none';
if (null != document.getElementById("reduction_amount"))
document.getElementById("reduction_amount").style.display='none';
if (null != document.getElementById("old_price"))
document.getElementById("old_price").style.display='none';
}
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "pricetotalprice") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice"))
document.getElementById('totalpriceinfo').style.display = 'block';
else
document.getElementById('totalpriceinfo').style.display = 'none';
</script>
{/if} {*Design 1 End*}
{if $design_type == 'design2'} {*Design 2*}
<div id="switchx" style="display: {if $disableapplet}block{else}none{/if};">
<label class="switchx">
<input type="checkbox" name="discretion" id="discretion" value="on" checked>
<span class="sliderx roundx"></span>
</label>
<span class="close_calculator">{l s='Close the calculator' mod='squaremeter'}</span>
<span class="open_calculator">{l s='Use the calculator' mod='squaremeter'}</span>
</div>
<fieldset id="squaremeter" >
{if $admintab_addquan}
<legend>
{if $admintab_picture}
{if (!$image_src)}{$image_src = $module_dir|cat:'views/img/preview_weight.jpg'}{/if}
<a href="{$image_src|escape:'html':'UTF-8'}" class="preview" onclick="return false;">
<img src="{$module_dir|escape:'html':'UTF-8'}views/img/hint.png" title="Hint" class="hint">
</a>
{/if}
&nbsp;{l s='Please enter weight/quantity' mod='squaremeter'}&nbsp;
</legend>
{else}
<legend>
{if $admintab_picture}
{if (!$image_src)}{$image_src = $module_dir|cat:'views/img/preview_weight.jpg'}{/if}
<a href="{$image_src|escape:'html':'UTF-8'}" class="preview" onclick="return false;">
<img src="{$module_dir|escape:'html':'UTF-8'}views/img/hint.png" title="Hint" class="hint">
</a>
{/if}
&nbsp;{l s='Please enter weight' mod='squaremeter'}&nbsp;
</legend>
{/if}
<div align="center">
<div class="labels">
<p>{l s='Weight' mod='squaremeter'}&nbsp;({$admintab_maxweight_unit|escape:'html':'UTF-8'})</p>
</div>
<div class="fields">
<p id="weight">
{if !$admintab_weightcheck}
<input id="quantity_wanted_alt" type="text" value="{$admintab_minweight|escape:'html':'UTF-8'}" name="qty_alt" onchange="check_weight()"></input>
{else}
<select data-toggle="select2" id="quantity_wanted_alt" name="qty_alt" onchange="check_weight()">
<option value="{$admintab_minweight|escape:'html':'UTF-8'}" selected>{$admintab_minweight|escape:'html':'UTF-8'}</option>
{$weight_value = $admintab_minweight}
{while $weight_value lte $admintab_maxweight - $step}
{$weight_value = $weight_value + $step}
<option value="{$weight_value|escape:'html':'UTF-8'}">{$weight_value|escape:'html':'UTF-8'}</option>
{/while}
</select>
{/if}
</p>
</div>
<div class="labels">
{if $admintab_addquan}
<p>{l s='Piece(s)' mod='squaremeter'}</p>
{/if}
</div>
<div class="fields">
{if $admintab_addquan}
<p id="quantitym"><input id="quantity" type="text" value="1" name="quantity" onchange="check_quantity()"></input></p>
{/if}
</div>
</div>
{if $admintab_extrafee_select}
<div style="clear:both" id="squaremeter_extrafee">
<label class="extrafee"><input type="checkbox" name="extrafee" id="extrafee" value="{$admintab_extrafee|escape:'htmlall':'UTF-8'}"/>{l s='Add Extra Fee' mod='squaremeter'}</label>
</div>
{/if}
{if $admintab_waste_select}
<div style="clear:both" id="squaremeter_waste">
<label class="waste"><input type="checkbox" name="waste" id="waste" value="{$admintab_waste|escape:'htmlall':'UTF-8'}"/> {l s='Add' mod='squaremeter'} {$admintab_waste|escape:'htmlall':'UTF-8'}% {l s='more for waste' mod='squaremeter'}</label>
</div>
{/if}
</fieldset>
<div id="dimension" align="center"></div>
<div id="totalprice" align="left" style="{if $admintab_dispprice == 'pricenototalprice'}display:none{else}display:block{/if}">
<input style="{if ($admintab_dispprice == 'pricetotalprice') OR ($admintab_dispprice == 'nopricetotalprice')}display:none{else}display:block{/if}" type="button" name="submit" id="totalprice_product_button" onclick="totalpriceinfospecific()" value="{l s='See the Calculated Total' mod='squaremeter'}" class="button btn btn-secondary btn-sm"/><br /><div id="totalpriceinfo" style="display:none;"></div><br />
</div>
<script type="text/javascript">
check_weight();
if (("{$admintab_dispquan|escape:'html':'UTF-8'}" == "oneinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "calcinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcinvisible") || ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok"))
{
if (null != document.getElementById("quantity_wanted"))
{
$('.qty').hide();
$(".qty").prev("span").hide();
$('.product-quantity').prev().hide();
$('.product-quantity>.control-label').hide();
}
}
else
{
//$('.product-add-to-cart>.control-label').html("{l s='Required Quantity:' mod='squaremeter'}");
document.getElementById("quantity_wanted").readOnly=true;
}
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricebutton") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice"))
{
if (null != document.getElementById("our_price_display"))
document.getElementById("our_price_display").style.display='none';
if (null != document.getElementById("reduction_percent"))
document.getElementById("reduction_percent").style.display='none';
if (null != document.getElementById("reduction_amount"))
document.getElementById("reduction_amount").style.display='none';
if (null != document.getElementById("old_price"))
document.getElementById("old_price").style.display='none';
}
if (("{$admintab_dispprice|escape:'html':'UTF-8'}" == "pricetotalprice") || ("{$admintab_dispprice|escape:'html':'UTF-8'}" == "nopricetotalprice"))
document.getElementById('totalpriceinfo').style.display = 'block';
else
document.getElementById('totalpriceinfo').style.display = 'none';
</script>
{/if} {*Design 2*}
<!-- Square Meter Calculation Module -->
{/if}

View File

@@ -0,0 +1,7 @@
Warehouse 4.4.2
Nova Fashion Store Version 2.0.11
Marcus Furniture & Home Decor Version 2.1.1
jms_yanka Version 1
Ayon Version 2.6.0
Ecolife Cosmetic 2
Leo Vegan Versión 1.0.0

View File

@@ -0,0 +1,311 @@
{**
* PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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 PrestaShop SA
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if isset($dimension_data)}
{foreach from=$dimension_data item="ddata"}
{foreach from=$customization_added_to_cart item="cdata"}
{if $cdata.0.id_customization == $product.id_customization}
{if $ddata.0.displayquantity == 'decimalok'}
{$dimension_text = $cdata.0.value}
{$dimension_quantity = $cdata.0.total_dimension}
{$dimension_unit = $cdata.0.unittype_module}
{$product_price = $product.price|regex_replace:'/[^0-9,.]+/':''}
{$currency = $product.price|regex_replace:'/[A-Za-z0-9.,]+/':''}
{$unit_price = $product_price|floatval / $dimension_quantity|floatval}
{/if}
{/if}
{/foreach}
{/foreach}
{/if}
<div class="product-line-grid row">
<!-- product line left content: image-->
<div class="product-line-grid-left col-md-3 col-xs-4">
<span class="product-image media-middle">
{if $product.cover}
<img src="{$product.cover.bySize.cart_default.url}" alt="{$product.name|escape:'quotes'}">
{else}
<img src="{$urls.no_picture_image.bySize.cart_default.url}" />
{/if}
</span>
</div>
<!-- product line body: label, discounts, price, attributes, customizations -->
<div class="product-line-grid-body col-md-4 col-xs-8">
<div class="product-line-info">
<a class="label" href="{$product.url}" data-id_customization="{$product.id_customization|intval}">{$product.name}</a>
</div>
<div class="product-line-info product-price h5 {if $product.has_discount}has-discount{/if}">
{if $product.has_discount}
<div class="product-discount">
{* <span class="regular-price">{$product.regular_price}</span> *}
{if $product.discount_type === 'percentage'}
<span class="discount discount-percentage">
-{$product.discount_percentage_absolute}
</span>
{else}
<span class="discount discount-amount">
-{$product.discount_to_display}
</span>
{/if}
</div>
{/if}
<div class="current-price">
<span class="price">{$product.price}</span>
{if $product.unit_price_full}
{if $dimension_text}
<div class="unit-price-cart">{$currency}{$unit_price|string_format:"%.2f"} per {$dimension_unit|escape:'htmlall':'UTF-8'}</div>
{else}
<div class="unit-price-cart">{$product.unit_price_full}</div>
{/if}
{* <div class="unit-price-cart">{$product.unit_price_full}</div> *}
{/if}
</div>
</div>
<br/>
{foreach from=$product.attributes key="attribute" item="value"}
<div class="product-line-info">
<span class="label">{$attribute}:</span>
<span class="value">{$value}</span>
</div>
{/foreach}
{* {if is_array($product.customizations) && $product.customizations|count}
<br>
{block name='cart_detailed_product_line_customization'}
{foreach from=$product.customizations item="customization"}
<a href="#" data-toggle="modal" data-target="#product-customizations-modal-{$customization.id_customization}">{l s='Product customization' d='Shop.Theme.Catalog'}</a>
<div class="modal fade customization-modal" id="product-customizations-modal-{$customization.id_customization}" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="{l s='Close' d='Shop.Theme.Global'}">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">{l s='Product customization' d='Shop.Theme.Catalog'}</h4>
</div>
<div class="modal-body">
{foreach from=$customization.fields item="field"}
<div class="product-customization-line row">
<div class="col-sm-3 col-xs-4 label">
{$field.label}
</div>
<div class="col-sm-9 col-xs-8 value">
{if $field.type == 'text'}
{if (int)$field.id_module}
{$field.text nofilter}
{else}
{$field.text}
{/if}
{elseif $field.type == 'image'}
<img src="{$field.image.small.url}">
{/if}
</div>
</div>
{/foreach}
</div>
</div>
</div>
</div>
{/foreach}
{/block}
{/if} *}
</div>
<!-- product line right content: actions (quantity, delete), price -->
<div class="product-line-grid-right product-line-actions col-md-5 col-xs-12">
<div class="row">
<div class="col-xs-4 hidden-md-up"></div>
<div class="col-md-10 col-xs-5">
<div class="row">
<div class="col-md-6 col-xs-6 col-sp-12 qty">
{if isset($product.is_gift) && $product.is_gift}
<span class="gift-quantity">{$product.quantity}</span>
{else}
<input
class="js-cart-line-product-quantity"
style="font-size: 14px;padding:0;"
data-down-url="{$product.down_quantity_url}"
data-up-url="{$product.up_quantity_url}"
data-update-url="{$product.update_quantity_url}"
data-product-id="{$product.id_product}"
unique-product-id="{$product.id_product|escape:'javascript':'UTF-8'}-{$product.id_product_attribute|escape:'javascript':'UTF-8'}-{$product.id_customization|escape:'javascript':'UTF-8'}"
type="number"
value="{if isset($dimension_text)}{$dimension_quantity|escape:'htmlall':'UTF-8'}{else}{$product.quantity}{/if}"
name="product-quantity-spin"
min="{$product.minimal_quantity}"
/>
{if isset($dimension_text)}
<div class="input-group-append" style="height: 40px;line-height: 40px;float:right;">
<span class="input-group-text small-text text-muted">{$dimension_unit|escape:'htmlall':'UTF-8'}</span>
</div>
{/if}
{/if}
</div>
<div class="col-md-6 col-xs-2 col-sp-12 price">
<span class="product-price">
<strong>
{if isset($product.is_gift) && $product.is_gift}
<span class="gift">{l s='Gift' d='Shop.Theme.Checkout'}</span>
{else}
{$product.total}
{/if}
</strong>
</span>
</div>
</div>
</div>
<div class="col-md-2 col-xs-3">
<div class="cart-line-product-actions ">
<a
class = "remove-from-cart"
rel = "nofollow"
href = "{$product.remove_from_cart_url}"
data-link-action = "delete-from-cart"
data-id-product = "{$product.id_product|escape:'javascript'}"
data-id-product-attribute = "{$product.id_product_attribute|escape:'javascript'}"
data-id-customization = "{$product.id_customization|escape:'javascript'}"
>
{if !isset($product.is_gift) || !$product.is_gift}
<i class="material-icons float-xs-left">delete</i>
{/if}
</a>
{block name='hook_cart_extra_product_actions'}
{hook h='displayCartExtraProductActions' product=$product}
{/block}
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
{if is_array($product.customizations) && $product.customizations|count}
<br>
{block name='cart_detailed_product_line_customization'}
{foreach from=$product.customizations item="customization"}
{foreach from=$customization.fields item="field"}
{assign var="dimension_text" value=" "|explode:$field.text}
<div class="alert medium-alert alert-info" style="width: 100%;">
<p style="float:left;">{$field.label}&nbsp;</p>
<div class="value">
{if $field.type == 'text'}
{if (int)$field.id_module}
{$field.text nofilter}
{else}
{$field.text}
{/if}
{elseif $field.type == 'image'}
<img src="{$field.image.small.url}">
{/if}
</div>
</div>
{/foreach}
{/foreach}
{/block}
{/if}
</div>
<div class="clearfix"></div>
</div>
{if isset($dimension_text)}
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
var id_product = {$product.id_product|intval};
$.ajax({
type: "POST",
data: {
id_product:id_product
},
url: "index.php?fc=module&module=squaremeter&controller=getdimensiondata",
dataType: "json",
async: false,
success: function(data) {
results = data;
id_product=id_product;
//console.table(results);
},
error: function (jqXHR, exception) {
console.log(jqXHR);
}
});
if (typeof results !== 'undefined' && results.length > 0) {
var displayquantity = results[0]['displayquantity'];
if ((results[0]) && (displayquantity == 'decimalok')) {
if (results[0]['step_width'])
stepvalue = results[0]['step_width'];
else
stepvalue = results[0]['step'];
if(!stepvalue)
stepvalue = 1;
switch(results[0]['calculationtype']) {
case "weight":
if (results[0]['minweight'])
minvalue = results[0]['minweight'];
else
minvalue = '';
if (results[0]['maxweight'])
maxvalue = results[0]['maxweight'];
else
maxvalue = '';
break;
default:
if (results[0]['minwidth'])
minvalue = results[0]['minwidth'];
else
minvalue = '';
if (results[0]['maxwidth'])
maxvalue = results[0]['maxwidth'];
else
maxvalue = '';
break;
}
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('min', parseFloat(minvalue));
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('max', parseFloat(maxvalue));
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('step', parseFloat(stepvalue));
}
}
if (displayquantity == "decimalok") {
window["q" + "{$product.id_product|intval}-" + "{$product.id_product_attribute|intval}-" + "{$product.id_customization|intval}"] = $("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").val();
setInterval(function(){
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").val(parseFloat(window["q" + "{$product.id_product|intval}-" + "{$product.id_product_attribute|intval}-" + "{$product.id_customization|intval}"]).toFixed(4));
}, 100);
}
</script>
{/if}
<style>
.cart-item .bootstrap-touchspin {
float:left;
}
</style>

View File

@@ -0,0 +1,46 @@
{**
* PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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 PrestaShop SA
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{block name='cart_detailed_product'}
<div class="cart-overview js-cart" data-refresh-url="{url entity='cart' params=['ajax' => true, 'action' => 'refresh']}">
{if $cart.products}
<ul class="cart-items">
{foreach from=$cart.products item=product}
<li class="cart-item">
{block name='cart_detailed_product_line'}
{if (Configuration::get('squaremeter_cartupdate') == 'on')}
{include file='checkout/_partials/cart-detailed-product-line-override.tpl' product=$product}
{else}
{include file='checkout/_partials/cart-detailed-product-line.tpl' product=$product}
{/if}
{/block}
</li>
{if is_array($product.customizations) && $product.customizations|count >1}<hr>{/if}
{/foreach}
</ul>
{else}
<span class="no-items">{l s='There are no more items in your cart' d='Shop.Theme.Checkout'}</span>
{/if}
</div>
{/block}

View File

@@ -0,0 +1,60 @@
{**
* PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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 PrestaShop SA
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{block name='cart_summary_product_line'}
<div class="media-left">
<a href="{$product.url}" title="{$product.name}">
<img class="media-object" src="{$product.cover.small.url}" alt="{$product.name}">
</a>
</div>
<div class="media-body">
<span class="product-name">{$product.name}</span>
{* <span class="product-quantity">x{$product.quantity}</span> *}
{* MEG Venture *}
{if isset($dimension_data)}
{foreach from=$dimension_data item="ddata"}
{foreach from=$customization_added_to_cart item="cdata"}
{if $cdata.0.id_customization == $product.id_customization}
{if $ddata.0.displayquantity == 'decimalok'}
{$dimension_text = $cdata.0.value}
{$dimension_quantity = $cdata.0.total_dimension}
{$dimension_unit = $cdata.0.unittype_module}
{/if}
{/if}
{/foreach}
{/foreach}
{/if}
<span class="product-quantity">x{if isset($dimension_text)}{$dimension_quantity|string_format:"%.2f"} {$dimension_unit|escape:'htmlall':'UTF-8'}{else}{$product.quantity}{/if}</span>
{* MEG Venture *}
<span class="product-price float-xs-right">{$product.price}</span>
{hook h='displayProductPriceBlock' product=$product type="unit_price"}
{foreach from=$product.attributes key="attribute" item="value"}
<div class="product-line-info product-line-info-secondary text-muted">
<span class="label">{$attribute}:</span>
<span class="value">{$value}</span>
</div>
{/foreach}
<br/>
</div>
{/block}

View File

@@ -0,0 +1,73 @@
{**
* PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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 PrestaShop SA
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<section id="js-checkout-summary" class="card js-cart" data-refresh-url="{$urls.pages.cart}?ajax=1&action=refresh">
<div class="card-block">
{block name='hook_checkout_summary_top'}
{hook h='displayCheckoutSummaryTop'}
{/block}
{block name='cart_summary_products'}
<div class="cart-summary-products">
<p>{$cart.summary_string}</p>
<p>
<a href="#" data-toggle="collapse" data-target="#cart-summary-product-list" class="btn btn-outline">
{l s='show details' d='Shop.Theme.Actions'}
<i class="material-icons">expand_more</i>
</a>
</p>
{block name='cart_summary_product_list'}
<div class="collapse" id="cart-summary-product-list">
<ul class="media-list">
{foreach from=$cart.products item=product}
{if (Configuration::get('squaremeter_cartupdate') == 'on')}
<li class="media">{include file='checkout/_partials/cart-summary-product-line-override.tpl' product=$product}</li>
{else}
<li class="media">{include file='checkout/_partials/cart-summary-product-line.tpl' product=$product}</li>
{/if}
{/foreach}
</ul>
</div>
{/block}
</div>
{/block}
{block name='cart_summary_subtotals'}
{include file='checkout/_partials/cart-summary-subtotals.tpl' cart=$cart}
{/block}
</div>
{block name='cart_summary_totals'}
{include file='checkout/_partials/cart-summary-totals.tpl' cart=$cart}
{/block}
{block name='cart_summary_voucher'}
{include file='checkout/_partials/cart-voucher.tpl'}
{/block}
</section>

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,307 @@
{**
* PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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 PrestaShop SA
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if isset($dimension_data)}
{foreach from=$dimension_data item="ddata"}
{foreach from=$customization_added_to_cart item="cdata"}
{if $cdata.0.id_customization == $product.id_customization}
{if $ddata.0.displayquantity == 'decimalok'}
{$dimension_text = $cdata.0.value}
{$dimension_quantity = $cdata.0.total_dimension}
{$dimension_unit = $cdata.0.unittype_module}
{$product_price = $product.price|regex_replace:'/[^0-9,.]+/':''}
{$currency = $product.price|regex_replace:'/[A-Za-z0-9.,]+/':''}
{$unit_price = $product_price|floatval / $dimension_quantity|floatval}
{/if}
{/if}
{/foreach}
{/foreach}
{/if}
<div class="product-line-grid row">
<!-- product left content: image-->
<div class="product-line-grid-left col-md-3 col-xs-4">
<span class="product-image media-middle">
<img src="{$product.cover.bySize.cart_default.url}" alt="{$product.name|escape:'quotes'}">
</span>
</div>
<!-- product left body: description -->
<div class="product-line-grid-body col-md-4 col-xs-8">
<div class="product-line-info">
<a class="label" href="{$product.url}" data-id_customization="{$product.id_customization|intval}">{$product.name}</a>
</div>
<div class="product-line-info product-price h5 {if $product.has_discount}has-discount{/if}">
{if $product.has_discount}
<div class="product-discount">
{* <span class="regular-price">{$product.regular_price}</span> *}
{if $product.discount_type === 'percentage'}
<span class="discount discount-percentage">
-{$product.discount_percentage_absolute}
</span>
{else}
<span class="discount discount-amount">
-{$product.discount_to_display}
</span>
{/if}
</div>
{/if}
<div class="current-price">
<span class="price">{$product.price}</span>
{if $product.unit_price_full}
{if $dimension_text}
<div class="unit-price-cart">{$currency}{$unit_price|string_format:"%.2f"} per {$dimension_unit|escape:'htmlall':'UTF-8'}</div>
{else}
<div class="unit-price-cart">{$product.unit_price_full}</div>
{/if}
{* <div class="unit-price-cart">{$product.unit_price_full}</div> *}
{/if}
</div>
</div>
<br/>
{foreach from=$product.attributes key="attribute" item="value"}
<div class="product-line-info">
<span class="label">{$attribute}:</span>
<span class="value">{$value}</span>
</div>
{/foreach}
{* {if is_array($product.customizations) && $product.customizations|count}
<br>
{block name='cart_detailed_product_line_customization'}
{foreach from=$product.customizations item="customization"}
<a href="#" data-toggle="modal" data-target="#product-customizations-modal-{$customization.id_customization}">{l s='Product customization' d='Shop.Theme.Catalog'}</a>
<div class="modal fade customization-modal" id="product-customizations-modal-{$customization.id_customization}" tabindex="-1" role="dialog" aria-hidden="true">
<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">&times;</span>
</button>
<h4 class="modal-title">{l s='Product customization' d='Shop.Theme.Catalog'}</h4>
</div>
<div class="modal-body">
{foreach from=$customization.fields item="field"}
<div class="product-customization-line row">
<div class="col-sm-3 col-xs-4 label">
{$field.label}
</div>
<div class="col-sm-9 col-xs-8 value">
{if $field.type == 'text'}
{if (int)$field.id_module}
{$field.text nofilter}
{else}
{$field.text}
{/if}
{elseif $field.type == 'image'}
<img src="{$field.image.small.url}">
{/if}
</div>
</div>
{/foreach}
</div>
</div>
</div>
</div>
{/foreach}
{/block}
{/if} *}
</div>
<!-- product left body: description -->
<div class="product-line-grid-right product-line-actions col-md-5 col-xs-12">
<div class="row">
<div class="col-xs-4 hidden-md-up"></div>
<div class="col-md-10 col-xs-5">
<div class="row">
<div class="col-md-6 col-xs-6 col-sp-12 qty">
{if isset($product.is_gift) && $product.is_gift}
<span class="gift-quantity">{$product.quantity}</span>
{else}
<input
class="js-cart-line-product-quantity"
style="font-size: 14px;padding:0;"
data-down-url="{$product.down_quantity_url}"
data-up-url="{$product.up_quantity_url}"
data-update-url="{$product.update_quantity_url}"
data-product-id="{$product.id_product}"
unique-product-id="{$product.id_product|escape:'javascript':'UTF-8'}-{$product.id_product_attribute|escape:'javascript':'UTF-8'}-{$product.id_customization|escape:'javascript':'UTF-8'}"
type="number"
value="{if isset($dimension_text)}{$dimension_quantity|escape:'htmlall':'UTF-8'}{else}{$product.quantity}{/if}"
name="product-quantity-spin"
min="{$product.minimal_quantity}"
/>
{if isset($dimension_text)}
<div class="input-group-append" style="height: 40px;line-height: 40px;float:right;">
<span class="input-group-text small-text text-muted">{$dimension_unit|escape:'htmlall':'UTF-8'}</span>
</div>
{/if}
{/if}
</div>
<div class="col-md-6 col-xs-2 col-sp-12 price">
<span class="product-price">
<strong>
{if isset($product.is_gift) && $product.is_gift}
<span class="gift">{l s='Gift' d='Shop.Theme.Checkout'}</span>
{else}
{$product.total}
{/if}
</strong>
</span>
</div>
</div>
</div>
<div class="col-md-2 col-xs-3">
<div class="cart-line-product-actions ">
<a
class = "remove-from-cart"
rel = "nofollow"
href = "{$product.remove_from_cart_url}"
data-link-action = "delete-from-cart"
data-id-product = "{$product.id_product|escape:'javascript'}"
data-id-product-attribute = "{$product.id_product_attribute|escape:'javascript'}"
data-id-customization = "{$product.id_customization|escape:'javascript'}"
>
{if !isset($product.is_gift) || !$product.is_gift}
<i class="material-icons float-xs-left">delete</i>
{/if}
</a>
{block name='hook_cart_extra_product_actions'}
{hook h='displayCartExtraProductActions' product=$product}
{/block}
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
{if is_array($product.customizations) && $product.customizations|count}
<br>
{block name='cart_detailed_product_line_customization'}
{foreach from=$product.customizations item="customization"}
{foreach from=$customization.fields item="field"}
{assign var="dimension_text" value=" "|explode:$field.text}
<div class="alert medium-alert alert-info" style="width: 100%;">
<p style="float:left;">{$field.label}&nbsp;</p>
<div class="value">
{if $field.type == 'text'}
{if (int)$field.id_module}
{$field.text nofilter}
{else}
{$field.text}
{/if}
{elseif $field.type == 'image'}
<img src="{$field.image.small.url}">
{/if}
</div>
</div>
{/foreach}
{/foreach}
{/block}
{/if}
</div>
<div class="clearfix"></div>
</div>
{if isset($dimension_text)}
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
var id_product = {$product.id_product|intval};
$.ajax({
type: "POST",
data: {
id_product:id_product
},
url: "index.php?fc=module&module=squaremeter&controller=getdimensiondata",
dataType: "json",
async: false,
success: function(data) {
results = data;
id_product=id_product;
//console.table(results);
},
error: function (jqXHR, exception) {
console.log(jqXHR);
}
});
if (typeof results !== 'undefined' && results.length > 0) {
var displayquantity = results[0]['displayquantity'];
if ((results[0]) && (displayquantity == 'decimalok')) {
if (results[0]['step_width'])
stepvalue = results[0]['step_width'];
else
stepvalue = results[0]['step'];
if(!stepvalue)
stepvalue = 1;
switch(results[0]['calculationtype']) {
case "weight":
if (results[0]['minweight'])
minvalue = results[0]['minweight'];
else
minvalue = '';
if (results[0]['maxweight'])
maxvalue = results[0]['maxweight'];
else
maxvalue = '';
break;
default:
if (results[0]['minwidth'])
minvalue = results[0]['minwidth'];
else
minvalue = '';
if (results[0]['maxwidth'])
maxvalue = results[0]['maxwidth'];
else
maxvalue = '';
break;
}
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('min', parseFloat(minvalue));
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('max', parseFloat(maxvalue));
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('step', parseFloat(stepvalue));
}
}
if (displayquantity == "decimalok") {
window["q" + "{$product.id_product|intval}-" + "{$product.id_product_attribute|intval}-" + "{$product.id_customization|intval}"] = $("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").val();
setInterval(function(){
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").val(parseFloat(window["q" + "{$product.id_product|intval}-" + "{$product.id_product_attribute|intval}-" + "{$product.id_customization|intval}"]).toFixed(4));
}, 100);
}
</script>
{/if}
<style>
.cart-item .bootstrap-touchspin {
float:left;
}
</style>

View File

@@ -0,0 +1,48 @@
{**
* PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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 PrestaShop SA
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{block name='cart_detailed_product'}
<div class="cart-overview js-cart" data-refresh-url="{url entity='cart' params=['ajax' => true, 'action' => 'refresh']}">
{if $cart.products}
<ul class="cart-items">
{foreach from=$cart.products item=product}
<li class="cart-item">
{block name='cart_detailed_product_line'}
{*MEG Venture*}
{if (Configuration::get('squaremeter_cartupdate') == 'on')}
{include file='checkout/_partials/cart-detailed-product-line-override.tpl' product=$product}
{else}
{include file='checkout/_partials/cart-detailed-product-line.tpl' product=$product}
{/if}
{*MEG Venture*}
{/block}
</li>
{if is_array($product.customizations) && $product.customizations|count >1}<hr>{/if}
{/foreach}
</ul>
{else}
<span class="no-items">{l s='There are no more items in your cart' d='Shop.Theme.Checkout'}</span>
{/if}
</div>
{/block}

View File

@@ -0,0 +1,60 @@
{**
* PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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 PrestaShop SA
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{block name='cart_summary_product_line'}
<div class="media-left">
<a href="{$product.url}" title="{$product.name}">
<img class="media-object" src="{$product.cover.small.url}" alt="{$product.name}">
</a>
</div>
<div class="media-body">
<span class="product-name">{$product.name}</span>
{* <span class="product-quantity">x{$product.quantity}</span> *}
{* MEG Venture *}
{if isset($dimension_data)}
{foreach from=$dimension_data item="ddata"}
{foreach from=$customization_added_to_cart item="cdata"}
{if $cdata.0.id_customization == $product.id_customization}
{if $ddata.0.displayquantity == 'decimalok'}
{$dimension_text = $cdata.0.value}
{$dimension_quantity = $cdata.0.total_dimension}
{$dimension_unit = $cdata.0.unittype_module}
{/if}
{/if}
{/foreach}
{/foreach}
{/if}
<span class="product-quantity">x{if isset($dimension_text)}{$dimension_quantity|string_format:"%.2f"} {$dimension_unit|escape:'htmlall':'UTF-8'}{else}{$product.quantity}{/if}</span>
{* MEG Venture *}
<span class="product-price float-xs-right">{$product.price}</span>
{hook h='displayProductPriceBlock' product=$product type="unit_price"}
{foreach from=$product.attributes key="attribute" item="value"}
<div class="product-line-info product-line-info-secondary text-muted">
<span class="label">{$attribute}:</span>
<span class="value">{$value}</span>
</div>
{/foreach}
<br/>
</div>
{/block}

View File

@@ -0,0 +1,75 @@
{**
* PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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 PrestaShop SA
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<section id="js-checkout-summary" class="card js-cart" data-refresh-url="{$urls.pages.cart}?ajax=1&action=refresh">
<div class="card-block">
{block name='hook_checkout_summary_top'}
{hook h='displayCheckoutSummaryTop'}
{/block}
{block name='cart_summary_products'}
<div class="cart-summary-products">
<p>{$cart.summary_string}</p>
<p>
<a href="#" data-toggle="collapse" data-target="#cart-summary-product-list" class="btn btn-outline">
{l s='show details' d='Shop.Theme.Actions'}
<i class="material-icons">expand_more</i>
</a>
</p>
{block name='cart_summary_product_list'}
<div class="collapse" id="cart-summary-product-list">
<ul class="media-list">
{foreach from=$cart.products item=product}
{*MEG Venture*}
{if (Configuration::get('squaremeter_cartupdate') == 'on')}
<li class="media">{include file='checkout/_partials/cart-summary-product-line-override.tpl' product=$product}</li>
{else}
<li class="media">{include file='checkout/_partials/cart-summary-product-line.tpl' product=$product}</li>
{/if}
{*MEG Venture*}
{/foreach}
</ul>
</div>
{/block}
</div>
{/block}
{block name='cart_summary_subtotals'}
{include file='checkout/_partials/cart-summary-subtotals.tpl' cart=$cart}
{/block}
</div>
{block name='cart_summary_totals'}
{include file='checkout/_partials/cart-summary-totals.tpl' cart=$cart}
{/block}
{block name='cart_summary_voucher'}
{include file='checkout/_partials/cart-voucher.tpl'}
{/block}
</section>

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,26 @@
squaremeter_surface.css
to the end add below:
/* Ayon Theme CSS Fix */
.product-bar-container{
margin-bottom: 650px !important;
}
#height, #width, #quantitym, #quantity_calculated {
width:190px;
}
#totalprice {
width: 100%;
text-align: center;
}
#totalpriceinfo span {
color: #fff;
}
input#quantity_wanted_alt, input#quantity_wanted_alth, input#quantity, input#directinput, #width select, #height select, #depth select, #weight select, #direct_input_p select, #directinput_p select {
width: 105px;
}
/* Ayon Theme CSS Fix */

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,275 @@
{if isset($dimension_data)}
{foreach from=$dimension_data item="ddata"}
{foreach from=$customization_added_to_cart item="cdata"}
{if $cdata.0.id_customization == $product.id_customization}
{if $ddata.0.displayquantity == 'decimalok'}
{$dimension_text = $cdata.0.value}
{$dimension_quantity = $cdata.0.total_dimension}
{$dimension_unit = $cdata.0.unittype_module}
{$product_price = $product.price|regex_replace:'/[^0-9,.]+/':''}
{$currency = $product.price|regex_replace:'/[A-Za-z0-9.,]+/':''}
{$unit_price = $product_price|floatval / $dimension_quantity|floatval}
{/if}
{/if}
{/foreach}
{/foreach}
{/if}
<div class="product-line-grid">
<!-- product left content: image-->
<div class="product-line-grid-thumb">
<span class="product-image media-middle">
<img src="{$product.cover.bySize.cart_default.url}" alt="{$product.name|escape:'quotes'}">
</span>
</div>
<div class="product-line-grid-body">
<!-- first line -->
<div class="product-line-name">
<div class="product-line-info">
<a class="product-name" href="{$product.url}" data-id_customization="{$product.id_customization|intval}">{$product.name}</a>
</div>
{foreach from=$product.attributes key="attribute" item="value"}
<p class="product-line-info atts">
<span class="label">{$attribute}:</span>
<span class="value">{$value}</span>
</p>
{/foreach}
{* {if $product.customizations|count}
<br>
{block name='cart_detailed_product_line_customization'}
{foreach from=$product.customizations item="customization"}
<a href="#" data-toggle="modal" data-target="#product-customizations-modal-{$customization.id_customization}">{l s='Product customization' d='Shop.Theme.Catalog'}</a>
<div class="modal fade customization-modal" id="product-customizations-modal-{$customization.id_customization}" tabindex="-1" role="dialog" aria-hidden="true">
<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">&times;</span>
</button>
<h4 class="modal-title">{l s='Product customization' d='Shop.Theme.Catalog'}</h4>
</div>
<div class="modal-body">
<div class="power" style="width: 500px; height: 300px; background: url({$product.cover.bySize.cart_view.url}) 500px 300px; margin: auto; background-position: 0px 0px;"></div>
{foreach from=$customization.fields item="field"}
<div class="product-customization-line row">
<div class="col-sm-3 col-xs-4 label">
{$field.label}
</div>
<div class="col-sm-9 col-xs-8 value">
{if $field.type == 'text'}
{if (int)$field.id_module}
{$field.text nofilter}
{else}
{$field.text}
{/if}
{elseif $field.type == 'image'}
<img src="{$field.image.small.url}">
{/if}
</div>
</div>
{/foreach}
</div>
</div>
</div>
</div>
{/foreach}
{/block}
{/if} *}
<div class="cart-line-product-actions">
<a
class = "remove-from-cart remove"
rel = "nofollow"
href = "{$product.remove_from_cart_url}"
data-link-action = "delete-from-cart"
data-id-product = "{$product.id_product|escape:'javascript'}"
data-id-product-attribute = "{$product.id_product_attribute|escape:'javascript'}"
data-id-customization = "{$product.id_customization|escape:'javascript'}"
>
{if !isset($product.is_gift) || !$product.is_gift}
<i><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></i>
{/if}
</a>
{block name='hook_cart_extra_product_actions'}
{hook h='displayCartExtraProductActions' product=$product}
{/block}
</div>
</div>
<!-- second line -->
<div class="product-line-prices">
<div class="product-line-grid-price">
<div class="product-line-info product-price h5 {if $product.has_discount}has-discount{/if}">
<div class="current-price">
<span class="price">{$product.price}</span>
{if $product.has_discount}
<span class="regular-price old-price">{$product.regular_price}</span>
{if $product.discount_type === 'percentage'}
<span class="discount discount-percentage">
-{$product.discount_percentage_absolute}
</span>
{else}
<span class="discount discount-amount">
-{$product.discount_to_display}
</span>
{/if}
{/if}
{if $product.unit_price_full}
{if $dimension_text}
<div class="unit-price-cart">{$currency}{$unit_price|string_format:"%.2f"} per {$dimension_unit|escape:'htmlall':'UTF-8'}</div>
{else}
<div class="unit-price-cart">{$product.unit_price_full}</div>
{/if}
{* <div class="unit-price-cart">{$product.unit_price_full}</div> *}
{/if}
</div>
</div>
</div>
<div class="product-line-grid-right product-line-actions">
<div class="qty">
{if isset($product.is_gift) && $product.is_gift}
<span class="gift-quantity">{$product.quantity}</span>
{else}
<input
class="js-cart-line-product-quantity"
data-down-url="{$product.down_quantity_url}"
data-up-url="{$product.up_quantity_url}"
data-update-url="{$product.update_quantity_url}"
data-product-id="{$product.id_product}"
unique-product-id="{$product.id_product|escape:'javascript':'UTF-8'}-{$product.id_product_attribute|escape:'javascript':'UTF-8'}-{$product.id_customization|escape:'javascript':'UTF-8'}"
type="text"
value="{if isset($dimension_text)}{$dimension_quantity|escape:'htmlall':'UTF-8'}{else}{$product.quantity}{/if}"
name="product-quantity-spin"
min="{$product.minimal_quantity}"
/>
{if isset($dimension_text)}
<div class="input-group-append" style="height: 40px;line-height: 59px;float:right;">
<span class="input-group-text small-text text-muted">{$dimension_unit|escape:'htmlall':'UTF-8'}</span>
</div>
{/if}
{/if}
</div>
<div class="price">
<span class="product-price">
{if isset($product.is_gift) && $product.is_gift}
<span class="gift">{l s='Gift' d='Shop.Theme.Checkout'}</span>
{else}
{$product.total}
{/if}
</span>
</div>
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
{if is_array($product.customizations) && $product.customizations|count}
<br>
{block name='cart_detailed_product_line_customization'}
{foreach from=$product.customizations item="customization"}
{foreach from=$customization.fields item="field"}
{assign var="dimension_text" value=" "|explode:$field.text}
<div class="alert medium-alert alert-info" style="width: 100%;">
<p style="float:left;">{$field.label}&nbsp;</p>
<div class="value">
{if $field.type == 'text'}
{if (int)$field.id_module}
{$field.text nofilter}
{else}
{$field.text}
{/if}
{elseif $field.type == 'image'}
<img src="{$field.image.small.url}">
{/if}
</div>
</div>
{/foreach}
{/foreach}
{/block}
{/if}
{if isset($dimension_text)}
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
var id_product = {$product.id_product|intval};
$.ajax({
type: "POST",
data: {
id_product:id_product
},
url: "index.php?fc=module&module=squaremeter&controller=getdimensiondata",
dataType: "json",
async: false,
success: function(data) {
results = data;
id_product=id_product;
//console.table(results);
},
error: function (jqXHR, exception) {
console.log(jqXHR);
}
});
if (typeof results !== 'undefined' && results.length > 0) {
var displayquantity = results[0]['displayquantity'];
if ((results[0]) && (displayquantity == 'decimalok')) {
if (results[0]['step_width'])
stepvalue = results[0]['step_width'];
else
stepvalue = results[0]['step'];
if(!stepvalue)
stepvalue = 1;
switch(results[0]['calculationtype']) {
case "weight":
if (results[0]['minweight'])
minvalue = results[0]['minweight'];
else
minvalue = '';
if (results[0]['maxweight'])
maxvalue = results[0]['maxweight'];
else
maxvalue = '';
break;
default:
if (results[0]['minwidth'])
minvalue = results[0]['minwidth'];
else
minvalue = '';
if (results[0]['maxwidth'])
maxvalue = results[0]['maxwidth'];
else
maxvalue = '';
break;
}
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('min', parseFloat(minvalue));
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('max', parseFloat(maxvalue));
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('step', parseFloat(stepvalue));
}
}
if (displayquantity == "decimalok") {
window["q" + "{$product.id_product|intval}-" + "{$product.id_product_attribute|intval}-" + "{$product.id_customization|intval}"] = $("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").val();
setInterval(function(){
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").val(parseFloat(window["q" + "{$product.id_product|intval}-" + "{$product.id_product_attribute|intval}-" + "{$product.id_customization|intval}"]).toFixed(4));
}, 100);
}
</script>
{/if}

View File

@@ -0,0 +1,48 @@
{**
* 2007-2017 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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 https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{block name='cart_detailed_product'}
<div class="cart-overview js-cart" data-refresh-url="{url entity='cart' params=['ajax' => true, 'action' => 'refresh']}">
{if $cart.products}
<ul class="cart-items">
{foreach from=$cart.products item=product}
<li class="cart-item">
{block name='cart_detailed_product_line'}
{*MEG Venture*}
{if (Configuration::get('squaremeter_cartupdate') == 'on')}
{include file='checkout/_partials/cart-detailed-product-line-override.tpl' product=$product}
{else}
{include file='checkout/_partials/cart-detailed-product-line.tpl' product=$product}
{/if}
{*MEG Venture*}
{/block}
</li>
{if $product.customizations|count >1}<hr>{/if}
{/foreach}
</ul>
{else}
<span class="no-items">{l s='There are no more items in your cart' d='Shop.Theme.Checkout'}</span>
{/if}
</div>
{/block}

View File

@@ -0,0 +1,53 @@
{**
* 2007-2017 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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 https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{block name='cart_summary_product_line'}
<div class="media-left">
<a href="{$product.url}" title="{$product.name}">
<img class="media-object" src="{$product.cover.small.url}" alt="{$product.name}">
</a>
</div>
<div class="media-body">
<span class="product-name">{$product.name}</span>
{* <span class="product-quantity">x{$product.quantity}</span> *}
{* MEG Venture *}
{if isset($dimension_data)}
{foreach from=$dimension_data item="ddata"}
{foreach from=$customization_added_to_cart item="cdata"}
{if $cdata.0.id_customization == $product.id_customization}
{if $ddata.0.displayquantity == 'decimalok'}
{$dimension_text = $cdata.0.value}
{$dimension_quantity = $cdata.0.total_dimension}
{$dimension_unit = $cdata.0.unittype_module}
{/if}
{/if}
{/foreach}
{/foreach}
{/if}
<span class="product-quantity">x{if isset($dimension_text)}{$dimension_quantity|string_format:"%.2f"} {$dimension_unit|escape:'htmlall':'UTF-8'}{else}{$product.quantity}{/if}</span>
{* MEG Venture *}
<span class="product-price float-xs-right">{$product.price}</span>
{hook h='displayProductPriceBlock' product=$product type="unit_price"}
</div>
{/block}

View File

@@ -0,0 +1,84 @@
{**
* 2007-2017 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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 https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<section id="js-checkout-summary" class="card js-cart cart-summary" data-refresh-url="{$urls.pages.cart}?ajax=1&action=refresh">
<div class="cart-detailed-totals">
<h4>{l s='Subtotal' d='Shop.Theme.Checkout'} - {$cart.summary_string}</h4>
{block name='cart_summary_products'}
<div class="cart-summary-products">
<p>
<a href="#" data-toggle="collapse" class="collapsed noeffect" data-target="#cart-summary-product-list">
{l s='Show details' d='Shop.Theme.Actions'}
</a>
</p>
{block name='cart_summary_product_list'}
<div class="collapse" id="cart-summary-product-list">
<ul class="media-list">
{foreach from=$cart.products item=product}
{*MEG Venture*}
{if (Configuration::get('squaremeter_cartupdate') == 'on')}
<li class="media">{include file='checkout/_partials/cart-summary-product-line-override.tpl' product=$product}</li>
{else}
<li class="media">{include file='checkout/_partials/cart-summary-product-line.tpl' product=$product}</li>
{/if}
{*MEG Venture*}
{/foreach}
</ul>
</div>
{/block}
</div>
{/block}
<div class="card-block">
{block name='hook_checkout_summary_top'}
{hook h='displayCheckoutSummaryTop'}
{/block}
{block name='cart_summary_subtotals'}
{foreach from=$cart.subtotals item="subtotal"}
{if $subtotal && $subtotal.type !== 'tax'}
<div class="cart-summary-line cart-summary-subtotals" id="cart-subtotal-{$subtotal.type}">
<span class="label">{$subtotal.label}</span>
<span class="value">{$subtotal.value}</span>
</div>
{/if}
{/foreach}
{/block}
</div>
{block name='cart_summary_voucher'}
{include file='checkout/_partials/cart-voucher.tpl'}
{/block}
<hr class="separator">
{block name='cart_summary_totals'}
{include file='checkout/_partials/cart-summary-totals.tpl' cart=$cart}
{/block}
</div>
</section>

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,261 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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 https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
{if isset($dimension_data)}
{foreach from=$dimension_data item="ddata"}
{foreach from=$customization_added_to_cart item="cdata"}
{if $cdata.0.id_customization == $product.id_customization}
{if $ddata.0.displayquantity == 'decimalok'}
{$dimension_text = $cdata.0.value}
{$dimension_quantity = $cdata.0.total_dimension}
{$dimension_unit = $cdata.0.unittype_module}
{$product_price = $product.price|regex_replace:'/[^0-9,.]+/':''}
{$currency = $product.price|regex_replace:'/[A-Za-z0-9.,]+/':''}
{$unit_price = $product_price|floatval / $dimension_quantity|floatval}
{/if}
{/if}
{/foreach}
{/foreach}
{/if}
<div class="product-line-grid">
<!-- product line left content: image-->
<div class="product-line-grid-left col-md-3 col-xs-4">
<span class="product-image media-middle">
{if $product.cover}
<img src="{$product.cover.bySize.cart_default.url|escape:'quotes':'UTF-8'}" alt="{$product.name|escape:'quotes':'UTF-8'}">
{else}
<img src="{$urls.no_picture_image.bySize.cart_default.url}" />
{/if}
</span>
</div>
<!-- product line body: label, discounts, price, attributes, customizations -->
<div class="product-line-grid-body col-md-4 col-xs-8">
<div class="product-line-info">
<a class="label" href="{$product.url}" data-id_customization="{$product.id_customization|intval}">{$product.name}</a>
</div>
<div class="product-line-info product-price h5 {if $product.has_discount}has-discount{/if}">
{if $product.has_discount}
<div class="product-discount">
<span class="regular-price">{$product.regular_price}</span>
{if $product.discount_type === 'percentage'}
<span class="discount discount-percentage">
-{$product.discount_percentage_absolute}
</span>
{else}
<span class="discount discount-amount">
-{$product.discount_to_display}
</span>
{/if}
</div>
{/if}
<div class="current-price">
<span class="price">{$product.price}</span>
{if $product.unit_price_full}
{if $dimension_text}
<div class="unit-price-cart">{$currency}{$unit_price|string_format:"%.2f"} per {$dimension_unit|escape:'htmlall':'UTF-8'}</div>
{else}
<div class="unit-price-cart">{$product.unit_price_full}</div>
{/if}
{/if}
</div>
</div>
<br/>
{foreach from=$product.attributes key="attribute" item="value"}
<div class="product-line-info {$attribute|lower}">
<span class="label">{$attribute}:</span>
<span class="value">{$value}</span>
</div>
{/foreach}
</div>
<!-- product line right content: actions (quantity, delete), price -->
<div class="product-line-grid-right product-line-actions col-md-5 col-xs-12">
<div class="row">
<div class="col-xs-4 hidden-md-up"></div>
<div class="col-md-10 col-xs-6">
<div class="row">
<div class="col-md-6 col-xs-6 qty">
{if isset($product.is_gift) && $product.is_gift}
<span class="gift-quantity">{$product.quantity}</span>
{else}
<input
class="js-cart-line-product-quantity"
style="font-size: 14px;padding:0;"
data-down-url="{$product.down_quantity_url}"
data-up-url="{$product.up_quantity_url}"
data-update-url="{$product.update_quantity_url}"
data-product-id="{$product.id_product|intval}"
unique-product-id="{$product.id_product|escape:'javascript':'UTF-8'}-{$product.id_product_attribute|escape:'javascript':'UTF-8'}-{$product.id_customization|escape:'javascript':'UTF-8'}"
type="number"
value="{if isset($dimension_text)}{$dimension_quantity|escape:'htmlall':'UTF-8'}{else}{$product.quantity}{/if}"
name="product-quantity-spin"
/>
{if isset($dimension_text)}
<div class="input-group-append" style="height: 40px;line-height: 40px;">
<span class="input-group-text small-text text-muted">{$dimension_unit|escape:'htmlall':'UTF-8'}</span>
</div>
{/if}
{/if}
</div>
<div class="col-md-6 col-xs-2 price">
<span class="product-price">
<strong>
{if isset($product.is_gift) && $product.is_gift}
<span class="gift">{l s='Gift' d='Shop.Theme.Checkout'}</span>
{else}
{$product.total}
{/if}
</strong>
</span>
</div>
</div>
</div>
<div class="col-md-2 col-xs-2 text-xs-right">
<div class="cart-line-product-actions">
<a
class = "remove-from-cart"
rel = "nofollow"
href = "{$product.remove_from_cart_url}"
data-link-action = "delete-from-cart"
data-id-product = "{$product.id_product|escape:'javascript':'UTF-8'}"
data-id-product-attribute = "{$product.id_product_attribute|escape:'javascript':'UTF-8'}"
data-id-customization = "{$product.id_customization|escape:'javascript':'UTF-8'}"
>
{if !isset($product.is_gift) || !$product.is_gift}
<i class="material-icons float-xs-left">delete</i>
{/if}
</a>
{block name='hook_cart_extra_product_actions'}
{hook h='displayCartExtraProductActions' product=$product}
{/block}
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
{if is_array($product.customizations) && $product.customizations|count}
<br>
{block name='cart_detailed_product_line_customization'}
{foreach from=$product.customizations item="customization"}
{foreach from=$customization.fields item="field"}
{assign var="dimension_text" value=" "|explode:$field.text}
<div class="alert medium-alert alert-info">
<p style="float:left;">{$field.label}&nbsp;</p>
<div class="value">
{if $field.type == 'text'}
{if (int)$field.id_module}
{$field.text nofilter}
{else}
{$field.text}
{/if}
{elseif $field.type == 'image'}
<img src="{$field.image.small.url}">
{/if}
</div>
</div>
{/foreach}
{/foreach}
{/block}
{/if}
</div>
{if isset($dimension_text)}
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
var id_product = {$product.id_product|intval};
$.ajax({
type: "POST",
data: {
id_product:id_product
},
url: "index.php?fc=module&module=squaremeter&controller=getdimensiondata",
dataType: "json",
async: false,
success: function(data) {
results = data;
id_product=id_product;
//console.table(results);
},
error: function (jqXHR, exception) {
console.log(jqXHR);
}
});
if (typeof results !== 'undefined' && results.length > 0) {
var displayquantity = results[0]['displayquantity'];
if ((results[0]) && (displayquantity == 'decimalok')) {
if (results[0]['step_width'])
stepvalue = results[0]['step_width'];
else
stepvalue = results[0]['step'];
if(!stepvalue)
stepvalue = 1;
switch(results[0]['calculationtype']) {
case "weight":
if (results[0]['minweight'])
minvalue = results[0]['minweight'];
else
minvalue = '';
if (results[0]['maxweight'])
maxvalue = results[0]['maxweight'];
else
maxvalue = '';
break;
default:
if (results[0]['minwidth'])
minvalue = results[0]['minwidth'];
else
minvalue = '';
if (results[0]['maxwidth'])
maxvalue = results[0]['maxwidth'];
else
maxvalue = '';
break;
}
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('min', parseFloat(minvalue));
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('max', parseFloat(maxvalue));
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('step', parseFloat(stepvalue));
}
}
if (displayquantity == "decimalok") {
window["q" + "{$product.id_product|intval}-" + "{$product.id_product_attribute|intval}-" + "{$product.id_customization|intval}"] = $("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").val();
setInterval(function(){
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").val(parseFloat(window["q" + "{$product.id_product|intval}-" + "{$product.id_product_attribute|intval}-" + "{$product.id_customization|intval}"]).toFixed(4));
}, 100);
}
</script>
{/if}

View File

@@ -0,0 +1,48 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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 https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
{block name='cart_detailed_product'}
<div class="cart-overview js-cart" data-refresh-url="{url entity='cart' params=['ajax' => true, 'action' => 'refresh']}">
{if $cart.products}
<ul class="cart-items">
{foreach from=$cart.products item=product}
<li class="cart-item">
{block name='cart_detailed_product_line'}
{*MEG Venture*}
{if (Configuration::get('squaremeter_cartupdate') == 'on')}
{include file=$module_dir|cat:'views/templates/front/cart-detailed-product-line-override.tpl' product=$product}
{else}
{include file='checkout/_partials/cart-detailed-product-line.tpl' product=$product}
{/if}
{*MEG Venture*}
{/block}
</li>
{if is_array($product.customizations) && $product.customizations|count >1}<hr>{/if}
{/foreach}
</ul>
{else}
<span class="no-items">{l s='There are no more items in your cart' d='Shop.Theme.Checkout'}</span>
{/if}
</div>
{/block}

View File

@@ -0,0 +1,60 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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 https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
{block name='cart_summary_product_line'}
<div class="media-left">
<a href="{$product.url}" title="{$product.name}">
<img class="media-object" src="{$product.cover.small.url}" alt="{$product.name}">
</a>
</div>
<div class="media-body">
<span class="product-name">{$product.name}</span>
{* <span class="product-quantity">x{$product.quantity}</span> *}
{* MEG Venture *}
{if isset($dimension_data)}
{foreach from=$dimension_data item="ddata"}
{foreach from=$customization_added_to_cart item="cdata"}
{if $cdata.0.id_customization == $product.id_customization}
{if $ddata.0.displayquantity == 'decimalok'}
{$dimension_text = $cdata.0.value}
{$dimension_quantity = $cdata.0.total_dimension}
{$dimension_unit = $cdata.0.unittype_module}
{/if}
{/if}
{/foreach}
{/foreach}
{/if}
<span class="product-quantity">x{if isset($dimension_text)}{$dimension_quantity|string_format:"%.2f"} {$dimension_unit|escape:'htmlall':'UTF-8'}{else}{$product.quantity}{/if}</span>
{* MEG Venture *}
<span class="product-price float-xs-right">{$product.price}</span>
{hook h='displayProductPriceBlock' product=$product type="unit_price"}
{foreach from=$product.attributes key="attribute" item="value"}
<div class="product-line-info product-line-info-secondary text-muted">
<span class="label">{$attribute}:</span>
<span class="value">{$value}</span>
</div>
{/foreach}
<br/>
</div>
{/block}

View File

@@ -0,0 +1,75 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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 https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
<section id="js-checkout-summary" class="card js-cart" data-refresh-url="{$urls.pages.cart}?ajax=1&action=refresh">
<div class="card-block">
{block name='hook_checkout_summary_top'}
{hook h='displayCheckoutSummaryTop'}
{/block}
{block name='cart_summary_products'}
<div class="cart-summary-products">
<p>{$cart.summary_string}</p>
<p>
<a href="#" data-toggle="collapse" data-target="#cart-summary-product-list">
{l s='show details' d='Shop.Theme.Actions'}
<i class="material-icons">expand_more</i>
</a>
</p>
{block name='cart_summary_product_list'}
<div class="collapse" id="cart-summary-product-list">
<ul class="media-list">
{foreach from=$cart.products item=product}
{*MEG Venture*}
{if (Configuration::get('squaremeter_cartupdate') == 'on')}
<li class="media">{include file=$module_dir|cat:'views/templates/front/cart-summary-product-line-override.tpl' product=$product}</li>
{else}
<li class="media">{include file='checkout/_partials/cart-summary-product-line.tpl' product=$product}</li>
{/if}
{*MEG Venture*}
{/foreach}
</ul>
</div>
{/block}
</div>
{/block}
{block name='cart_summary_subtotals'}
{include file='checkout/_partials/cart-summary-subtotals.tpl' cart=$cart}
{/block}
</div>
{block name='cart_summary_totals'}
{include file='checkout/_partials/cart-summary-totals.tpl' cart=$cart}
{/block}
{block name='cart_summary_voucher'}
{include file='checkout/_partials/cart-voucher.tpl'}
{/block}
</section>

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,412 @@
{**
* 2007-2016 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-2016 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{extends file=$layout}
{block name='head_seo' prepend}
<link rel="canonical" href="{$product.canonical_url}">
{/block}
{block name='head' append}
<meta property="og:type" content="product">
<meta property="og:url" content="{$urls.current_url}">
<meta property="og:title" content="{$page.meta.title}">
<meta property="og:site_name" content="{$shop.name}">
<meta property="og:description" content="{$page.meta.description}">
<meta property="og:image" content="{$product.cover.large.url}">
<meta property="product:pretax_price:amount" content="{$product.price_tax_exc}">
<meta property="product:pretax_price:currency" content="{$currency.iso_code}">
<meta property="product:price:amount" content="{$product.price_amount}">
<meta property="product:price:currency" content="{$currency.iso_code}">
{if isset($product.weight) && ($product.weight != 0)}
<meta property="product:weight:value" content="{$product.weight}">
<meta property="product:weight:units" content="{$product.weight_unit}">
{/if}
{/block}
{block name='content'}
<section id="main" itemscope itemtype="https://schema.org/Product">
<meta itemprop="url" content="{$product.url}">
<div class="row product-detail sticky-image default">
<div class="pb-left-column col-lg-7 col-md-7 col-sm-6 col-xs-12">
<div class="pd-left-content">
{block name='page_content_container'}
<section class="page-content" id="content">
{block name='page_content'}
<div class="image-wrapper">
{block name='product_cover_tumbnails'}
{include file='catalog/_partials/product-cover-thumbnails.tpl'}
{/block}
<div class="scroll-box-arrows">
<i class="fa fa-angle-left left"></i>
<i class="fa fa-angle-right right"></i>
</div>
</div>
{/block}
</section>
{/block}
</div>
</div>
<div class="pb-right-column col-lg-5 col-md-5 col-sm-6 col-xs-12">
<div class="container-flex">
{block name='product_flags'}
{if $product.flags}
<ul class="product-flags">
{foreach from=$product.flags item=flag}
<li class="product-flag {$flag.type}">{$flag.label}</li>
{/foreach}
</ul>
{/if}
{/block}
{block name='product_availability'}
{if $product.show_availability && $product.availability_message}
{if $product.availability == 'unavailable'}
<div class="not-enough-product">
<span id="product-availability">
{$product.availability_message}
</span>
</div>
{/if}
{/if}
{/block}
{block name='product_cover'}
<div class="product-cover">
<img class="zoom_01 js-qv-product-cover" src="{$product.cover.bySize.small_default.url}" alt="{$product.cover.legend}" title="{$product.cover.legend}" style="width:100%;" itemprop="image">
</div>
{/block}
<div class="block-info">
{block name='page_header_container'}
{block name='page_header'}
<h2 itemprop="name" class="pd-name">{block name='page_title'}{$product.name}{/block}</h2>
{/block}
{/block}
{block name='product_prices'}
{include file='catalog/_partials/product-prices.tpl'}
{/block}
</div>
{block name='product_additional_info'}
{include file='catalog/_partials/product-additional-info.tpl'}
{/block}
<div class="product-information">
<ul class="other-info">
{if $product.reference}
<li id="product_reference">
<label>{l s='Product Code:' d='Shop.Theme.Catalog'}</label>
<span class="editable">{$product.reference}</span>
</li>
{/if}
<li>
{block name='product_availability'}
{if $product.show_availability && $product.availability_message}
<li>
<label>{l s='Availability:' d='Shop.Theme.Catalog'}</label>
<span class="editable">
{if $product.availability == 'available'}
{$product.availability_message}
{elseif $product.availability == 'last_remaining_items'}
<i class="material-icons product-last-items">&#xE002;</i>
{else}
{$product.availability_message}
{/if}
</span>
</li>
{/if}
{/block}
</li>
{if $product.id_manufacturer}
<li id="product_vendor">
<label>{l s='Vendor:' d='Shop.Theme.Catalog'}</label>
<span class="editable">{Manufacturer::getnamebyid($product.id_manufacturer)}</span>
</li>
{/if}
<li class="product-category">
<label>{l s='Product Type: '}</label>
<a class="editable" href="{url entity='category' id=$product.id_category_default}">
{$product.category|escape:'html':'UTF-8'}
</a
</li>
</ul>
{block name='product_description_short'}
<div id="product-description-short-{$product.id}" class="product-desc">{$product.description_short nofilter}</div>
{/block}
{if isset($product.specific_prices.to) && $product.specific_prices.to > 0}
<div class="specific_prices">
<div class="countdown-box">
<div class="countdown">{$product.specific_prices.to}</div>
</div>
</div>
{/if}
{if $product.is_customizable && count($product.customizations.fields)}
{block name='product_customization'}
{include file="catalog/_partials/product-customization.tpl" customizations=$product.customizations}
{/block}
{/if}
<div class="product-actions">
{block name='product_buy'}
<form action="{$urls.pages.cart}" method="post" id="add-to-cart-or-refresh">
<input type="hidden" name="token" value="{$static_token}">
<input type="hidden" name="id_product" value="{$product.id}" id="product_page_product_id">
<input type="hidden" name="id_customization" value="{$product.id_customization}" id="product_customization_id">
{block name='product_pack'}
{if $packItems}
<section class="product-pack">
<h3 class="h4">{l s='This pack contains' d='Shop.Theme.Catalog'}</h3>
<article>
<div class="card">
<div class="pack-product-container">
<table class="table">
<thead>
<tr>
<th>Products</th>
<th>Price</th>
<th>Quantity</th>
</tr>
</thead>
{foreach from=$packItems item="product_pack"}
{block name='product_miniature'}
{include file='catalog/_partials/miniatures/pack-product.tpl' product=$product_pack}
{/block}
{/foreach}
</table>
</div>
</div>
</article>
</section>
{/if}
{/block}
{block name='product_discounts'}
{include file='catalog/_partials/product-discounts.tpl'}
{/block}
{block name='product_variants'}
{include file='catalog/_partials/product-variants.tpl'}
{/block}
{block name='hook_display_reassurance'}
{hook h='displayReassurance'}
{/block}
{block name='product_add_to_cart'}
{include file='catalog/_partials/product-add-to-cart.tpl'}
{/block}
{hook h='displayProductButtons' product=$product}
{block name='product_refresh'}
<input class="product-refresh ps-hidden-by-js" name="refresh" type="submit" value="{l s='Refresh' d='Shop.Theme.Actions'}">
{/block}
</form>
{/block}
</div>
</div>
<div class="guaranteed text-center p-relative">
<span>{l s='Guaranteed safe checkout' d='Shop.Theme.Catalog'}</span>
<img class="img-responsive mg-auto px-15" src="{$urls.base_url}themes/jms_yanka/assets/img/payments.png" alt="">
</div>
<div id="more_info_block" class="tabs">
{block name='product_tabs'}
<div class="panel-group" id="accordion">
{if $product.description}
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a class="" data-toggle="collapse" data-parent="#accordion" href="#descriptionn">
{l s='Description' d='Shop.Theme.Catalog'}
<span class="pt-icon">
<svg viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 0.992188L6 5.98947L11 0.992187" stroke="#D0D0D0" stroke-width="1.1"></path>
</svg>
</span>
</a>
</h4>
</div>
<div id="descriptionn" class="panel-collapse collapse in">
<div class="panel-body">
{block name='product_description'}
<div class="product-description">{$product.description nofilter}</div>
{/block}
</div>
</div>
</div>
{/if}
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#product-detailss">
{l s='Additional information' d='Shop.Theme.Catalog'}
<span class="pt-icon">
<svg viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 0.992188L6 5.98947L11 0.992187" stroke="#D0D0D0" stroke-width="1.1"></path>
</svg>
</span>
</a>
</h4>
</div>
<div id="product-detailss" class="panel-collapse collapse">
<div class="panel-body">
{block name='product_details'}
{include file='catalog/_partials/product-details.tpl'}
{/block}
</div>
</div>
</div>
{if $product.attachments}
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#attachmentss">
{l s='Attachments' d='Shop.Theme.Catalog'}
<span class="pt-icon">
<svg viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 0.992188L6 5.98947L11 0.992187" stroke="#D0D0D0" stroke-width="1.1"></path>
</svg>
</span>
</a>
</h4>
</div>
<div id="attachmentss" class="panel-collapse collapse">
<div class="panel-body">
{block name='product_attachments'}
{if $product.attachments}
<div class="tab-pane fade in" id="attachments" role="tabpanel">
<section class="product-attachments">
<h3 class="h5 text-uppercase">{l s='Download' d='Shop.Theme.Actions'}</h3>
{foreach from=$product.attachments item=attachment}
<div class="attachment">
<h4><a href="{url entity='attachment' params=['id_attachment' => $attachment.id_attachment]}">{$attachment.name}</a></h4>
<p>{$attachment.description}</p
<a href="{url entity='attachment' params=['id_attachment' => $attachment.id_attachment]}">
{l s='Download' d='Shop.Theme.Actions'} ({$attachment.file_size_formatted})
</a>
</div>
{/foreach}
</section>
</div>
{/if}
{/block}
</div>
</div>
</div>
{/if}
{foreach from=$product.extraContent item=extra key=extraKey}
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#extra-{$extraKey}">
{$extra.title}
<span class="pt-icon">
<svg viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 0.992188L6 5.98947L11 0.992187" stroke="#D0D0D0" stroke-width="1.1"></path>
</svg>
</span>
</a>
</h4>
</div>
<div id="extra-{$extraKey}" class="panel-collapse collapse">
<div class="panel-body">
{foreach from=$product.extraContent item=extra key=extraKey}
<div class="tab-pane fade in {$extra.attr.class}" id="extra-{$extraKey}" role="tabpanel" {foreach $extra.attr as $key => $val} {$key}="{$val}"{/foreach}>
{$extra.content nofilter}
</div>
{/foreach}
</div>
</div>
</div>
{/foreach}
<div class="panel panel-default reviews">
<div class="panel-heading">
<h4 class="panel-title">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#review">
{l s='Reviews' d='Shop.Theme.Catalog'}
<span class="pt-icon">
<svg viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 0.992188L6 5.98947L11 0.992187" stroke="#D0D0D0" stroke-width="1.1"></path>
</svg>
</span>
</a>
</h4>
</div>
<div id="review" class="panel-collapse collapse">
<div class="panel-body">
{block name='product_footer'}
{hook h='displayFooterProduct' product=$product category=$category}
{/block}
</div>
</div>
</div>
</div>
{/block}
</div>
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<div class="addthis_inline_share_toolbox_lvar"></div>
</div>
</div>
</div>
<div id="stickyBottom"></div>
{block name='product_accessories'}
{if $accessories}
<section class="product-accessories clearfix">
<div class="addon-title">
<h3>{l s='Accessories' d='Shop.Theme.Catalog'}</h3>
</div>
<div class="products accessories-carousel customs-product-carousel">
{foreach from=$accessories item="product_accessory"}
<div class="item ajax_block_product">
{block name='product_miniature'}
{include file='catalog/_partials/miniatures/product.tpl' product=$product_accessory}
{/block}
</div>
{/foreach}
</div>
</section>
{/if}
{/block}
{block name='product_images_modal'}
{include file='catalog/_partials/product-images-modal.tpl'}
{/block}
{block name='page_footer_container'}
{/block}
</section>
{/block}

View File

@@ -0,0 +1,284 @@
{**
* 2007-2020 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-2020 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if isset($dimension_data)}
{foreach from=$dimension_data item="ddata"}
{foreach from=$customization_added_to_cart item="cdata"}
{if $cdata.0.id_customization == $product.id_customization}
{if $ddata.0.displayquantity == 'decimalok'}
{$dimension_text = $cdata.0.value}
{$dimension_quantity = $cdata.0.total_dimension}
{$dimension_unit = $cdata.0.unittype_module}
{$product_price = $product.price|regex_replace:'/[^0-9,.]+/':''}
{$currency = $product.price|regex_replace:'/[A-Za-z0-9.,]+/':''}
{$unit_price = $product_price|floatval / $dimension_quantity|floatval}
{/if}
{/if}
{/foreach}
{/foreach}
{/if}
<div class="product-line-grid">
<!-- products -->
<div class="row_cs product-info col-lg-2 col-md-2 col-sm-6 col-xs-6">
<div class="product-image media-middle">
<div class="cart-line-product-actions ">
<a
class = "remove-from-cart"
rel = "nofollow"
href = "{$product.remove_from_cart_url}"
data-link-action = "delete-from-cart"
data-id-product = "{$product.id_product|escape:'javascript'}"
data-id-product-attribute = "{$product.id_product_attribute|escape:'javascript'}"
data-id-customization = "{$product.id_customization|escape:'javascript'}"
>
{if !isset($product.is_gift) || !$product.is_gift}
<i>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<g>
<path fill="currentColor" d="M5,24h14l1-17H4L5,24z M18.3,8.6l-0.8,13.8h-11L5.7,8.6H18.3z"></path>
<rect x="2" y="3.2" fill="currentColor" width="20" height="1.6"></rect>
<rect x="10" y="0.2" fill="currentColor" width="4" height="1.6"></rect>
</g>
</svg>
</i>
{/if}
</a>
{hook h='displayCartExtraProductActions' product=$product}
</div>
<div class="info">
<img src="{$product.cover.bySize.home_default.url}" alt="{$product.name|escape:'quotes'}">
</div>
</div>
</div>
<div class="row_cs product-right col-lg-10 col-md-10 col-sm-6 col-xs-6">
<div class="row_cs info col-lg-5 col-sm-12 col-xs-12">
<div class="product-line-info">
<a class="product-link" href="{$product.url}" data-id_customization="{$product.id_customization|intval}">{$product.name}</a>
{foreach from=$product.attributes item="property_value" key="property"}
<span>{l s='%label%:' sprintf=['%label%' => $property] d='Shop.Theme.Global'}<strong> {$property_value}</strong></span>
{/foreach}
</div>
</div>
{* {if $product.customizations|count}
{foreach from=$product.customizations item="customization"}
<a href="#" data-toggle="modal" data-target="#product-customizations-modal-{$customization.id_customization}">{l s='Product customization' d='Shop.Theme.Catalog'}</a>
<div class="modal fade customization-modal" id="product-customizations-modal-{$customization.id_customization}" tabindex="-1" role="dialog" aria-hidden="true">
<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">
</button>
<h4 class="modal-title">{l s='Product customization' d='Shop.Theme.Catalog'}</h4>
</div>
<div class="modal-body">
{foreach from=$customization.fields item="field"}
<div class="product-customization-line row">
<div class="col-sm-3 col-xs-4 label">
{$field.label}
</div>
<div class="col-sm-9 col-xs-8 value">
{if $field.type == 'text'}
{if (int)$field.id_module}
{$field.text nofilter}
{else}
{$field.text}
{/if}
{elseif $field.type == 'image'}
<img src="{$field.image.small.url}">
{/if}
</div>
</div>
{/foreach}
</div>
</div>
</div>
</div>
{/foreach}
{/if} *}
<!-- price -->
<div class="row_cs product-price col-lg-3 col-md-4 col-sm-12 col-xs-12">
<div class="product-line-info">
<span class="value">{$product.price}</span>
{if $product.unit_price_full}
{if $dimension_text}
<div class="unit-price-cart">{$currency}{$unit_price|string_format:"%.2f"} per {$dimension_unit|escape:'htmlall':'UTF-8'}</div>
{else}
<div class="unit-price-cart">{$product.unit_price_full}</div>
{/if}
{* <div class="unit-price-cart">{$product.unit_price_full}</div> *}
{/if}
</div>
</div>
<!-- qty -->
<div class="row_cs product-qty product-quantity col-lg-2 col-md-4 col-sm-12 col-xs-12">
{if isset($product.is_gift) && $product.is_gift}
<span class="gift-quantity">{$product.quantity}</span>
{else}
<input
class="js-cart-line-product-quantity"
style="font-size: 14px;padding:0;"
data-down-url="{$product.down_quantity_url}"
data-up-url="{$product.up_quantity_url}"
data-update-url="{$product.update_quantity_url}"
data-product-id="{$product.id_product}"
unique-product-id="{$product.id_product|escape:'javascript':'UTF-8'}-{$product.id_product_attribute|escape:'javascript':'UTF-8'}-{$product.id_customization|escape:'javascript':'UTF-8'}"
type="text"
value="{if isset($dimension_text)}{$dimension_quantity|escape:'htmlall':'UTF-8'}{else}{$product.quantity}{/if}"
name="product-quantity-spin"
min="{$product.minimal_quantity}"
/>
{if isset($dimension_text)}
<div class="input-group-append" style="height: 40px;line-height: 40px;float:right;">
<span class="input-group-text small-text text-muted">{$dimension_unit|escape:'htmlall':'UTF-8'}</span>
</div>
{/if}
{/if}
</div>
<!-- total -->
<div class="row_cs product-total col-lg-2 col-md-4 col-sm-12 col-xs-12">
<span class="price">
<span class="value">
{if isset($product.is_gift) && $product.is_gift}
<span class="gift">{l s='Gift' d='Shop.Theme.Checkout'}</span>
{else}
{$product.total}
{/if}
</span>
<span class="value"> </span>
</span>
</div>
<div class="clearfix"></div>
</div>
<div class="clearfix"></div>
{if is_array($product.customizations) && $product.customizations|count}
<br>
{block name='cart_detailed_product_line_customization'}
{foreach from=$product.customizations item="customization"}
{foreach from=$customization.fields item="field"}
{assign var="dimension_text" value=" "|explode:$field.text}
<div class="alert medium-alert alert-info" style="width: 100%;">
<p style="float:left;">{$field.label}&nbsp;</p>
<div class="value">
{if $field.type == 'text'}
{if (int)$field.id_module}
{$field.text nofilter}
{else}
{$field.text}
{/if}
{elseif $field.type == 'image'}
<img src="{$field.image.small.url}">
{/if}
</div>
</div>
{/foreach}
{/foreach}
{/block}
{/if}
</div>
{if isset($dimension_text)}
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
var id_product = {$product.id_product|intval};
$.ajax({
type: "POST",
data: {
id_product:id_product
},
url: "index.php?fc=module&module=squaremeter&controller=getdimensiondata",
dataType: "json",
async: false,
success: function(data) {
results = data;
id_product=id_product;
//console.table(results);
},
error: function (jqXHR, exception) {
console.log(jqXHR);
}
});
if (typeof results !== 'undefined' && results.length > 0) {
var displayquantity = results[0]['displayquantity'];
if ((results[0]) && (displayquantity == 'decimalok')) {
if (results[0]['step_width'])
stepvalue = results[0]['step_width'];
else
stepvalue = results[0]['step'];
if(!stepvalue)
stepvalue = 1;
switch(results[0]['calculationtype']) {
case "weight":
if (results[0]['minweight'])
minvalue = results[0]['minweight'];
else
minvalue = '';
if (results[0]['maxweight'])
maxvalue = results[0]['maxweight'];
else
maxvalue = '';
break;
default:
if (results[0]['minwidth'])
minvalue = results[0]['minwidth'];
else
minvalue = '';
if (results[0]['maxwidth'])
maxvalue = results[0]['maxwidth'];
else
maxvalue = '';
break;
}
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('min', parseFloat(minvalue));
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('max', parseFloat(maxvalue));
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('step', parseFloat(stepvalue));
}
}
if (displayquantity == "decimalok") {
window["q" + "{$product.id_product|intval}-" + "{$product.id_product_attribute|intval}-" + "{$product.id_customization|intval}"] = $("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").val();
setInterval(function(){
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").val(parseFloat(window["q" + "{$product.id_product|intval}-" + "{$product.id_product_attribute|intval}-" + "{$product.id_customization|intval}"]).toFixed(4));
}, 100);
}
</script>
{/if}
<style>
.cart-item .bootstrap-touchspin {
max-width:80px;
float:left;
}
</style>

View File

@@ -0,0 +1,66 @@
{**
* 2007-2020 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-2020 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div class="cart-overview js-cart" data-refresh-url="{url entity='cart' params=['ajax' => true, 'action' => 'refresh']}">
<div class="label-title hidden-xs">
<div class="col-lg-6 col-md-7 col-sm-7 col-xs-12">{l s='Products' d='Shop.Theme.Checkout'}</div>
<div class="col-lg-6 col-md-5 col-sm-5 col-xs-12">
<div class="pd-0 col-lg-4 col-md-4 col-sm-4 col-xs-12">{l s='Price' d='Shop.Theme.Checkout'}</div>
<div class="pd-0 col-lg-4 col-md-4 col-sm-4 col-xs-12 text-center">{l s='Quantity' d='Shop.Theme.Checkout'}</div>
<div class="pd-0 col-lg-4 col-md-4 col-sm-4 col-xs-12 text-right">{l s='Total' d='Shop.Theme.Checkout'}</div>
</div>
</div>
{if $cart.products}
<ul class="cart-items">
{foreach from=$cart.products item=product}
{*MEG Venture*}
{if (Configuration::get('squaremeter_cartupdate') == 'on')}
<li class="cart-item">{include file='checkout/_partials/cart-detailed-product-line-override.tpl' product=$product}</li>
{else}
<li class="cart-item">{include file='checkout/_partials/cart-detailed-product-line.tpl' product=$product}</li>
{/if}
{*MEG Venture*}
{if $product.customizations|count >1}
<hr>
{/if}
{/foreach}
</ul>
{else}
<div class="no-items text-center">
<svg width="119" height="119" viewBox="0 0 119 119" fill="none">
<use xlink:href="#icon-empty_shopping_bag">
<symbol id="icon-empty_shopping_bag" fill="none" viewBox="0 0 100 119">
<path d="M5.86 119h88.28a5.865 5.865 0 0 0 5.86-5.859V21.484a1.953 1.953 0 0 0-1.953-1.953H84.375C84.375 8.761 75.613 0 64.844 0 54.05 0 45.313 8.73 45.313 19.531H30.468a1.953 1.953 0 0 0-1.953 1.953v32.657H1.953A1.953 1.953 0 0 0 0 56.094v57.047A5.865 5.865 0 0 0 5.86 119zm-1.954-5.859V97.109H49.22v16.032a1.955 1.955 0 0 1-1.953 1.953H5.859a1.955 1.955 0 0 1-1.953-1.953zm90.235 1.953H52.789a5.83 5.83 0 0 0 .336-1.953V97.109h42.969v16.032a1.955 1.955 0 0 1-1.953 1.953zM64.844 3.906c8.616 0 15.625 7.01 15.625 15.625h-31.25c0-8.635 6.984-15.625 15.625-15.625zM32.422 23.438h12.89v8.984H43.36a1.953 1.953 0 1 0 0 3.906h7.813a1.953 1.953 0 1 0 0-3.906H49.22v-8.984h31.25v8.984h-1.953a1.953 1.953 0 1 0 0 3.906h7.812a1.953 1.953 0 1 0 0-3.906h-1.953v-8.984h11.719v69.765h-42.97v-37.11a1.953 1.953 0 0 0-1.953-1.952h-18.75V23.438zm16.797 34.609v35.156H3.906V58.047H49.22z" fill="currentColor"></path>
<path d="M14.844 69.766v3.906c0 6.474 5.244 11.719 11.719 11.719 6.462 0 11.718-5.257 11.718-11.72v-3.905a1.953 1.953 0 1 0 0-3.907h-3.906a1.953 1.953 0 1 0 0 3.907v3.906c0 4.307-3.505 7.812-7.813 7.812a7.812 7.812 0 0 1-7.812-7.812v-3.906a1.953 1.953 0 1 0 0-3.907h-3.906a1.953 1.953 0 1 0 0 3.907z" fill="currentColor"></path>
</symbol>
</use>
</svg>
<h3>{l s='Shopping Bag is Empty' d='Shop.Theme.Checkout'}</h3>
<span>{l s='Your shopping bag is empty.' d='Shop.Theme.Checkout'}</span>
<a class="btn-border" href="{$urls.pages.index}">
{l s='Continue shopping' d='Shop.Theme.Actions'}
</a>
</div>
{/if}
</div>

View File

@@ -0,0 +1,53 @@
{**
* 2007-2020 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-2020 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{block name='cart_summary_product_line'}
<div class="media-left">
<a href="{$product.url}" title="{$product.name}">
<img class="media-object" src="{$product.cover.small.url}" alt="{$product.name}">
</a>
</div>
<div class="media-body">
<span class="product-link">{$product.name}</span>
{* MEG Venture *}
{if isset($dimension_data)}
{foreach from=$dimension_data item="ddata"}
{foreach from=$customization_added_to_cart item="cdata"}
{if $cdata.0.id_customization == $product.id_customization}
{if $ddata.0.displayquantity == 'decimalok'}
{$dimension_text = $cdata.0.value}
{$dimension_quantity = $cdata.0.total_dimension}
{$dimension_unit = $cdata.0.unittype_module}
{/if}
{/if}
{/foreach}
{/foreach}
{/if}
<span class="product-quantity">x{if isset($dimension_text)}{$dimension_quantity|string_format:"%.2f"} {$dimension_unit|escape:'htmlall':'UTF-8'}{else}{$product.quantity}{/if}</span>
{* <span class="product-quantity">x{$product.quantity}</span> *}
{* MEG Venture *}
<span class="product-price float-xs-right">{$product.price}</span>
{hook h='displayProductPriceBlock' product=$product type="unit_price"}
</div>
{/block}

View File

@@ -0,0 +1,80 @@
{**
* 2007-2020 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-2020 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<section id="js-checkout-summary" class="card js-cart" data-refresh-url="{$urls.pages.cart}?ajax=1">
<div class="card-block">
{hook h='displayCheckoutSummaryTop'}
{block name='cart_summary_products'}
<div class="cart-summary-products">
<b>{$cart.summary_string}</b>
<p>
<a id="show-detail" href="#" data-toggle="collapse" data-target="#cart-summary-product-list">
{l s='show details' d='Shop.Theme.Actions'}
</a>
</p>
{block name='cart_summary_product_list'}
<div class="collapse" id="cart-summary-product-list">
<ul class="media-list">
{foreach from=$cart.products item=product}
{*MEG Venture*}
{if (Configuration::get('squaremeter_cartupdate') == 'on')}
<li class="media">{include file='checkout/_partials/cart-summary-product-line-override.tpl' product=$product}</li>
{else}
<li class="media">{include file='checkout/_partials/cart-summary-product-line.tpl' product=$product}</li>
{/if}
{*MEG Venture*}
{/foreach}
</ul>
</div>
{/block}
</div>
{/block}
{block name='cart_summary_subtotals'}
{foreach from=$cart.subtotals item="subtotal"}
{if $subtotal && $subtotal.type !== 'tax'}
<div class="cart-summary-line cart-summary-subtotals" id="cart-subtotal-{$subtotal.type}">
<span class="label">{$subtotal.label}</span>
<span class="value pull-right">{$subtotal.value}</span>
</div>
{/if}
{/foreach}
{/block}
</div>
{block name='cart_summary_voucher'}
{include file='checkout/_partials/cart-voucher.tpl'}
{/block}
<hr>
{block name='cart_summary_totals'}
{include file='checkout/_partials/cart-summary-totals.tpl' cart=$cart}
{/block}
</section>

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,271 @@
{**
* 2007-2017 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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 PrestaShop SA
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if isset($dimension_data)}
{foreach from=$dimension_data item="ddata"}
{foreach from=$customization_added_to_cart item="cdata"}
{if $cdata.0.id_customization == $product.id_customization}
{if $ddata.0.displayquantity == 'decimalok'}
{$dimension_text = $cdata.0.value}
{$dimension_quantity = $cdata.0.total_dimension}
{$dimension_unit = $cdata.0.unittype_module}
{$product_price = $product.price|regex_replace:'/[^0-9,.]+/':''}
{$currency = $product.price|regex_replace:'/[A-Za-z0-9.,]+/':''}
{$unit_price = $product_price|floatval / $dimension_quantity|floatval}
{/if}
{/if}
{/foreach}
{/foreach}
{/if}
<div class="product-line-grid row">
<!-- product left content: image-->
<div class="product-line-grid-left col-md-3 col-xs-4">
<span class="product-image media-middle">
{if $product.cover}
<img src="{$product.cover.bySize.cart_default.url}" alt="{$product.name|escape:'quotes'}">
{else}
<img src="{$urls.no_picture_image.bySize.cart_default.url}" />
{/if}
</span>
</div>
<!-- product left body: description -->
<div class="product-line-grid-body col-md-4 col-xs-8">
<div class="product-line-info">
<a class="label" href="{$product.url}" data-id_customization="{$product.id_customization|intval}">{$product.name}</a>
</div>
<div class="product-line-info product-price h5 {if $product.has_discount}has-discount{/if}">
{if $product.has_discount}
<div class="product-discount">
<span class="regular-price">{$product.regular_price}</span>
{if $product.discount_type === 'percentage'}
<span class="discount discount-percentage">
-{$product.discount_percentage_absolute}
</span>
{else}
<span class="discount discount-amount">
-{$product.discount_to_display}
</span>
{/if}
</div>
{/if}
<div class="current-price">
<span class="price">{$product.price}</span>
{if $product.unit_price_full}
{if $dimension_text}
<div class="unit-price-cart">{$currency}{$unit_price|string_format:"%.2f"} per {$dimension_unit|escape:'htmlall':'UTF-8'}</div>
{else}
<div class="unit-price-cart">{$product.unit_price_full}</div>
{/if}
{* <div class="unit-price-cart">{$product.unit_price_full}</div> *}
{/if}
</div>
</div>
<br/>
{foreach from=$product.attributes key="attribute" item="value"}
<div class="product-line-info">
<span class="label">{$attribute}:</span>
<span class="value">{$value}</span>
</div>
{/foreach}
</div>
<!-- product left body: description -->
<div class="product-line-grid-right product-line-actions col-md-5 col-xs-12">
<div class="row">
<div class="col-xs-4 hidden-md-up"></div>
<div class="col-md-10 col-xs-6">
<div class="row">
<div class="col-md-5 col-xs-6 col-sp-12 qty">
{if isset($product.is_gift) && $product.is_gift}
<span class="gift-quantity">{$product.quantity}</span>
{else}
<input
style="font-size: 14px;padding:0;"
class="js-cart-line-product-quantity"
data-down-url="{$product.down_quantity_url}"
data-up-url="{$product.up_quantity_url}"
data-update-url="{$product.update_quantity_url}"
data-product-id="{$product.id_product}"
unique-product-id="{$product.id_product|escape:'javascript':'UTF-8'}-{$product.id_product_attribute|escape:'javascript':'UTF-8'}-{$product.id_customization|escape:'javascript':'UTF-8'}"
type="number"
value="{if isset($dimension_text)}{$dimension_quantity|escape:'htmlall':'UTF-8'}{else}{$product.quantity}{/if}"
name="product-quantity-spin"
/>
{if isset($dimension_text)}
<div class="input-group-append" style="height: 40px;line-height: 40px;float:right;">
<span class="input-group-text small-text text-muted">{$dimension_unit|escape:'htmlall':'UTF-8'}</span>
</div>
{/if}
{/if}
</div>
<div class="col-md-7 col-xs-2 col-sp-12 price">
<span class="product-price">
<strong>
{if isset($product.is_gift) && $product.is_gift}
<span class="gift">{l s='Gift' d='Shop.Theme.Checkout'}</span>
{else}
{$product.total}
{/if}
</strong>
</span>
</div>
</div>
</div>
<div class="col-md-2 col-xs-2 text-xs-right">
<div class="cart-line-product-actions">
<a
class = "remove-from-cart"
rel = "nofollow"
href = "{$product.remove_from_cart_url}"
data-link-action = "delete-from-cart"
data-id-product = "{$product.id_product|escape:'javascript'}"
data-id-product-attribute = "{$product.id_product_attribute|escape:'javascript'}"
data-id-customization = "{$product.id_customization|escape:'javascript'}"
>
{if !isset($product.is_gift) || !$product.is_gift}
<i class="material-icons float-xs-left">delete</i>
{/if}
</a>
{block name='hook_cart_extra_product_actions'}
{hook h='displayCartExtraProductActions' product=$product}
{/block}
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
{if is_array($product.customizations) && $product.customizations|count}
<br>
{block name='cart_detailed_product_line_customization'}
{foreach from=$product.customizations item="customization"}
{foreach from=$customization.fields item="field"}
{assign var="dimension_text" value=" "|explode:$field.text}
<div class="alert medium-alert alert-info" style="width: 100%;">
<p style="float:left;">{$field.label}&nbsp;</p>
<div class="value">
{if $field.type == 'text'}
{if (int)$field.id_module}
{$field.text nofilter}
{else}
{$field.text}
{/if}
{elseif $field.type == 'image'}
<img src="{$field.image.small.url}">
{/if}
</div>
</div>
{/foreach}
{/foreach}
{/block}
{/if}
<div class="clearfix"></div>
</div>
{if isset($dimension_text)}
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
var id_product = {$product.id_product|intval};
$.ajax({
type: "POST",
data: {
id_product:id_product
},
url: "index.php?fc=module&module=squaremeter&controller=getdimensiondata",
dataType: "json",
async: false,
success: function(data) {
results = data;
id_product=id_product;
//console.table(results);
},
error: function (jqXHR, exception) {
console.log(jqXHR);
}
});
if (typeof results !== 'undefined' && results.length > 0) {
var displayquantity = results[0]['displayquantity'];
if ((results[0]) && (displayquantity == 'decimalok')) {
if (results[0]['step_width'])
stepvalue = results[0]['step_width'];
else
stepvalue = results[0]['step'];
if(!stepvalue)
stepvalue = 1;
switch(results[0]['calculationtype']) {
case "weight":
if (results[0]['minweight'])
minvalue = results[0]['minweight'];
else
minvalue = '';
if (results[0]['maxweight'])
maxvalue = results[0]['maxweight'];
else
maxvalue = '';
break;
default:
if (results[0]['minwidth'])
minvalue = results[0]['minwidth'];
else
minvalue = '';
if (results[0]['maxwidth'])
maxvalue = results[0]['maxwidth'];
else
maxvalue = '';
break;
}
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('min', parseFloat(minvalue));
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('max', parseFloat(maxvalue));
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('step', parseFloat(stepvalue));
}
}
if (displayquantity == "decimalok") {
window["q" + "{$product.id_product|intval}-" + "{$product.id_product_attribute|intval}-" + "{$product.id_customization|intval}"] = $("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").val();
setInterval(function(){
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").val(parseFloat(window["q" + "{$product.id_product|intval}-" + "{$product.id_product_attribute|intval}-" + "{$product.id_customization|intval}"]).toFixed(4));
}, 100);
}
</script>
{/if}
<style>
.cart-item .bootstrap-touchspin {
max-width:80px;
float:left;
margin-left: -10px;
}
</style>

View File

@@ -0,0 +1,48 @@
{**
* 2007-2017 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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 PrestaShop SA
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{block name='cart_detailed_product'}
<div class="cart-overview js-cart" data-refresh-url="{url entity='cart' params=['ajax' => true, 'action' => 'refresh']}">
{if $cart.products}
<ul class="cart-items">
{foreach from=$cart.products item=product}
<li class="cart-item">
{block name='cart_detailed_product_line'}
{*MEG Venture*}
{if (Configuration::get('squaremeter_cartupdate') == 'on')}
{include file='checkout/_partials/cart-detailed-product-line-override.tpl' product=$product}
{else}
{include file='checkout/_partials/cart-detailed-product-line.tpl' product=$product}
{/if}
{*MEG Venture*}
{/block}
</li>
{if is_array($product.customizations) && $product.customizations|count >1}<hr>{/if}
{/foreach}
</ul>
{else}
<span class="no-items">{l s='There are no more items in your cart' d='Shop.Theme.Checkout'}</span>
{/if}
</div>
{/block}

View File

@@ -0,0 +1,60 @@
{**
* 2007-2017 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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 PrestaShop SA
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{block name='cart_summary_product_line'}
<div class="media-left">
<a href="{$product.url}" title="{$product.name}">
<img class="media-object" src="{$product.cover.small.url}" alt="{$product.name}">
</a>
</div>
<div class="media-body">
<span class="product-name">{$product.name}</span>
{* MEG Venture *}
{if isset($dimension_data)}
{foreach from=$dimension_data item="ddata"}
{foreach from=$customization_added_to_cart item="cdata"}
{if $cdata.0.id_customization == $product.id_customization}
{if $ddata.0.displayquantity == 'decimalok'}
{$dimension_text = $cdata.0.value}
{$dimension_quantity = $cdata.0.total_dimension}
{$dimension_unit = $cdata.0.unittype_module}
{/if}
{/if}
{/foreach}
{/foreach}
{/if}
<span class="product-quantity">x{if isset($dimension_text)}{$dimension_quantity|string_format:"%.2f"} {$dimension_unit|escape:'htmlall':'UTF-8'}{else}{$product.quantity}{/if}</span>
{* MEG Venture *}
{* <span class="product-quantity">x{$product.quantity}</span> *}
<span class="product-price float-xs-right">{$product.price}</span>
{hook h='displayProductPriceBlock' product=$product type="unit_price"}
{foreach from=$product.attributes key="attribute" item="value"}
<div class="product-line-info product-line-info-secondary text-muted">
<span class="label">{$attribute}:</span>
<span class="value">{$value}</span>
</div>
{/foreach}
<br/>
</div>
{/block}

View File

@@ -0,0 +1,75 @@
{**
* 2007-2017 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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 PrestaShop SA
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<section id="js-checkout-summary" class="card js-cart" data-refresh-url="{$urls.pages.cart}?ajax=1&action=refresh">
<div class="card-block">
{block name='hook_checkout_summary_top'}
{hook h='displayCheckoutSummaryTop'}
{/block}
{block name='cart_summary_products'}
<div class="cart-summary-products">
<p>{$cart.summary_string}</p>
<p>
<a href="#" data-toggle="collapse" data-target="#cart-summary-product-list" class="btn btn-outline">
{l s='show details' d='Shop.Theme.Actions'}
<i class="material-icons">expand_more</i>
</a>
</p>
{block name='cart_summary_product_list'}
<div class="collapse" id="cart-summary-product-list">
<ul class="media-list">
{foreach from=$cart.products item=product}
{*MEG Venture*}
{if (Configuration::get('squaremeter_cartupdate') == 'on')}
<li class="media">{include file='checkout/_partials/cart-summary-product-line-override.tpl' product=$product}</li>
{else}
<li class="media">{include file='checkout/_partials/cart-summary-product-line.tpl' product=$product}</li>
{/if}
{*MEG Venture*}
{/foreach}
</ul>
</div>
{/block}
</div>
{/block}
{block name='cart_summary_subtotals'}
{include file='checkout/_partials/cart-summary-subtotals.tpl' cart=$cart}
{/block}
</div>
{block name='cart_summary_totals'}
{include file='checkout/_partials/cart-summary-totals.tpl' cart=$cart}
{/block}
{block name='cart_summary_voucher'}
{include file='checkout/_partials/cart-voucher.tpl'}
{/block}
</section>

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,261 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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 https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
{if isset($dimension_data)}
{foreach from=$dimension_data item="ddata"}
{foreach from=$customization_added_to_cart item="cdata"}
{if $cdata.0.id_customization == $product.id_customization}
{if $ddata.0.displayquantity == 'decimalok'}
{$dimension_text = $cdata.0.value}
{$dimension_quantity = $cdata.0.total_dimension}
{$dimension_unit = $cdata.0.unittype_module}
{$product_price = $product.price|regex_replace:'/[^0-9,.]+/':''}
{$currency = $product.price|regex_replace:'/[A-Za-z0-9.,]+/':''}
{$unit_price = $product_price|floatval / $dimension_quantity|floatval}
{/if}
{/if}
{/foreach}
{/foreach}
{/if}
<div class="product-line-grid">
<!-- product line left content: image-->
<div class="product-line-grid-left col-md-3 col-xs-4">
<span class="product-image media-middle">
{if $product.cover}
<img src="{$product.cover.bySize.cart_default.url|escape:'quotes':'UTF-8'}" alt="{$product.name|escape:'quotes':'UTF-8'}">
{else}
<img src="{$urls.no_picture_image.bySize.cart_default.url}" />
{/if}
</span>
</div>
<!-- product line body: label, discounts, price, attributes, customizations -->
<div class="product-line-grid-body col-md-4 col-xs-8">
<div class="product-line-info">
<a class="label" href="{$product.url}" data-id_customization="{$product.id_customization|intval}">{$product.name}</a>
</div>
<div class="product-line-info product-price h5 {if $product.has_discount}has-discount{/if}">
{if $product.has_discount}
<div class="product-discount">
<span class="regular-price">{$product.regular_price}</span>
{if $product.discount_type === 'percentage'}
<span class="discount discount-percentage">
-{$product.discount_percentage_absolute}
</span>
{else}
<span class="discount discount-amount">
-{$product.discount_to_display}
</span>
{/if}
</div>
{/if}
<div class="current-price">
<span class="price">{$product.price}</span>
{if $product.unit_price_full}
{if $dimension_text}
<div class="unit-price-cart">{$currency}{$unit_price|string_format:"%.2f"} per {$dimension_unit|escape:'htmlall':'UTF-8'}</div>
{else}
<div class="unit-price-cart">{$product.unit_price_full}</div>
{/if}
{/if}
</div>
</div>
<br/>
{foreach from=$product.attributes key="attribute" item="value"}
<div class="product-line-info {$attribute|lower}">
<span class="label">{$attribute}:</span>
<span class="value">{$value}</span>
</div>
{/foreach}
</div>
<!-- product line right content: actions (quantity, delete), price -->
<div class="product-line-grid-right product-line-actions col-md-5 col-xs-12">
<div class="row">
<div class="col-xs-4 hidden-md-up"></div>
<div class="col-md-10 col-xs-6">
<div class="row">
<div class="col-md-6 col-xs-6 qty" style="width: 60%;margin-left: -25px;">
{if isset($product.is_gift) && $product.is_gift}
<span class="gift-quantity">{$product.quantity}</span>
{else}
<input
class="js-cart-line-product-quantity"
style="width: 4rem;"
data-down-url="{$product.down_quantity_url}"
data-up-url="{$product.up_quantity_url}"
data-update-url="{$product.update_quantity_url}"
data-product-id="{$product.id_product|intval}"
unique-product-id="{$product.id_product|escape:'javascript':'UTF-8'}-{$product.id_product_attribute|escape:'javascript':'UTF-8'}-{$product.id_customization|escape:'javascript':'UTF-8'}"
type="number"
value="{if isset($dimension_text)}{$dimension_quantity|escape:'htmlall':'UTF-8'}{else}{$product.quantity}{/if}"
name="product-quantity-spin"
/>
{if isset($dimension_text)}
<div class="input-group-append" style="height: 40px;line-height: 40px;">
<span class="input-group-text small-text text-muted">{$dimension_unit|escape:'htmlall':'UTF-8'}</span>
</div>
{/if}
{/if}
</div>
<div class="col-md-6 col-xs-2 price">
<span class="product-price">
<strong>
{if isset($product.is_gift) && $product.is_gift}
<span class="gift">{l s='Gift' d='Shop.Theme.Checkout'}</span>
{else}
{$product.total}
{/if}
</strong>
</span>
</div>
</div>
</div>
<div class="col-md-2 col-xs-2 text-xs-right">
<div class="cart-line-product-actions">
<a
class = "remove-from-cart"
rel = "nofollow"
href = "{$product.remove_from_cart_url}"
data-link-action = "delete-from-cart"
data-id-product = "{$product.id_product|escape:'javascript':'UTF-8'}"
data-id-product-attribute = "{$product.id_product_attribute|escape:'javascript':'UTF-8'}"
data-id-customization = "{$product.id_customization|escape:'javascript':'UTF-8'}"
>
{if !isset($product.is_gift) || !$product.is_gift}
<i class="material-icons float-xs-left">delete</i>
{/if}
</a>
{block name='hook_cart_extra_product_actions'}
{hook h='displayCartExtraProductActions' product=$product}
{/block}
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
{if is_array($product.customizations) && $product.customizations|count}
<br>
{block name='cart_detailed_product_line_customization'}
{foreach from=$product.customizations item="customization"}
{foreach from=$customization.fields item="field"}
{assign var="dimension_text" value=" "|explode:$field.text}
<div class="alert medium-alert alert-info">
<p style="float:left;">{$field.label}&nbsp;</p>
<div class="value">
{if $field.type == 'text'}
{if (int)$field.id_module}
{$field.text nofilter}
{else}
{$field.text}
{/if}
{elseif $field.type == 'image'}
<img src="{$field.image.small.url}">
{/if}
</div>
</div>
{/foreach}
{/foreach}
{/block}
{/if}
</div>
{if isset($dimension_text)}
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
var id_product = {$product.id_product|intval};
$.ajax({
type: "POST",
data: {
id_product:id_product
},
url: "index.php?fc=module&module=squaremeter&controller=getdimensiondata",
dataType: "json",
async: false,
success: function(data) {
results = data;
id_product=id_product;
//console.table(results);
},
error: function (jqXHR, exception) {
console.log(jqXHR);
}
});
if (typeof results !== 'undefined' && results.length > 0) {
var displayquantity = results[0]['displayquantity'];
if ((results[0]) && (displayquantity == 'decimalok')) {
if (results[0]['step_width'])
stepvalue = results[0]['step_width'];
else
stepvalue = results[0]['step'];
if(!stepvalue)
stepvalue = 1;
switch(results[0]['calculationtype']) {
case "weight":
if (results[0]['minweight'])
minvalue = results[0]['minweight'];
else
minvalue = '';
if (results[0]['maxweight'])
maxvalue = results[0]['maxweight'];
else
maxvalue = '';
break;
default:
if (results[0]['minwidth'])
minvalue = results[0]['minwidth'];
else
minvalue = '';
if (results[0]['maxwidth'])
maxvalue = results[0]['maxwidth'];
else
maxvalue = '';
break;
}
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('min', parseFloat(minvalue));
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('max', parseFloat(maxvalue));
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('step', parseFloat(stepvalue));
}
}
if (displayquantity == "decimalok") {
window["q" + "{$product.id_product|intval}-" + "{$product.id_product_attribute|intval}-" + "{$product.id_customization|intval}"] = $("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").val();
setInterval(function(){
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").val(parseFloat(window["q" + "{$product.id_product|intval}-" + "{$product.id_product_attribute|intval}-" + "{$product.id_customization|intval}"]).toFixed(4));
}, 100);
}
</script>
{/if}

View File

@@ -0,0 +1,48 @@
{**
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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-2018 PrestaShop SA
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{block name='cart_detailed_product'}
<div class="cart-overview js-cart" data-refresh-url="{url entity='cart' params=['ajax' => true, 'action' => 'refresh']}">
{if $cart.products}
<ul class="cart-items">
{foreach from=$cart.products item=product}
<li class="cart-item">
{block name='cart_detailed_product_line'}
{*MEG Venture*}
{if (Configuration::get('squaremeter_cartupdate') == 'on')}
{include file='checkout/_partials/cart-detailed-product-line-override.tpl' product=$product}
{else}
{include file='checkout/_partials/cart-detailed-product-line.tpl' product=$product}
{/if}
{*MEG Venture*}
{/block}
</li>
{if is_array($product.customizations) && $product.customizations|count >1}<hr>{/if}
{/foreach}
</ul>
{else}
<span class="no-items">{l s='There are no more items in your cart' d='Shop.Theme.Checkout'}</span>
{/if}
</div>
{/block}

View File

@@ -0,0 +1,60 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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 https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
{block name='cart_summary_product_line'}
<div class="media-left">
<a href="{$product.url}" title="{$product.name}">
<img class="media-object" src="{$product.cover.small.url}" alt="{$product.name}">
</a>
</div>
<div class="media-body">
<span class="product-name">{$product.name}</span>
{* <span class="product-quantity">x{$product.quantity}</span> *}
{* MEG Venture *}
{if isset($dimension_data)}
{foreach from=$dimension_data item="ddata"}
{foreach from=$customization_added_to_cart item="cdata"}
{if $cdata.0.id_customization == $product.id_customization}
{if $ddata.0.displayquantity == 'decimalok'}
{$dimension_text = $cdata.0.value}
{$dimension_quantity = $cdata.0.total_dimension}
{$dimension_unit = $cdata.0.unittype_module}
{/if}
{/if}
{/foreach}
{/foreach}
{/if}
<span class="product-quantity">x{if isset($dimension_text)}{$dimension_quantity|string_format:"%.2f"} {$dimension_unit|escape:'htmlall':'UTF-8'}{else}{$product.quantity}{/if}</span>
{* MEG Venture *}
<span class="product-price float-xs-right">{$product.price}</span>
{hook h='displayProductPriceBlock' product=$product type="unit_price"}
{foreach from=$product.attributes key="attribute" item="value"}
<div class="product-line-info product-line-info-secondary text-muted">
<span class="label">{$attribute}:</span>
<span class="value">{$value}</span>
</div>
{/foreach}
<br/>
</div>
{/block}

View File

@@ -0,0 +1,83 @@
{**
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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-2018 PrestaShop SA
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<section id="js-checkout-summary" class="card js-cart" data-refresh-url="{$urls.pages.cart}?ajax=1&action=refresh">
<div class="card-block">
{block name='hook_checkout_summary_top'}
{hook h='displayCheckoutSummaryTop'}
{/block}
{block name='cart_summary_products'}
<div class="cart-summary-products">
<p>{$cart.summary_string}</p>
<p>
<a href="#" data-toggle="collapse" data-target="#cart-summary-product-list">
{l s='show details' d='Shop.Theme.Actions'}
</a>
</p>
{block name='cart_summary_product_list'}
<div class="collapse" id="cart-summary-product-list">
<ul class="media-list">
{foreach from=$cart.products item=product}
{*MEG Venture*}
{if (Configuration::get('squaremeter_cartupdate') == 'on')}
<li class="media cart-summary-product">{include file='checkout/_partials/cart-summary-product-line-override.tpl' product=$product}</li>
{else}
<li class="media">{include file='checkout/_partials/cart-summary-product-line.tpl' product=$product}</li>
{/if}
{*MEG Venture*}
{/foreach}
</ul>
</div>
{/block}
</div>
{/block}
{block name='cart_summary_subtotals'}
{foreach from=$cart.subtotals item="subtotal"}
{if $subtotal && $subtotal.type !== 'tax'}
<div class="cart-summary-line cart-summary-subtotals" id="cart-subtotal-{$subtotal.type}">
<span class="label">{$subtotal.label}</span>
<span class="value">{$subtotal.value}</span>
</div>
{/if}
{/foreach}
{/block}
</div>
{block name='cart_summary_voucher'}
{include file='checkout/_partials/cart-voucher.tpl'}
{/block}
<hr class="separator">
{block name='cart_summary_totals'}
{include file='checkout/_partials/cart-summary-totals.tpl' cart=$cart}
{/block}
</section>

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,239 @@
{* MEG Venture *}
{if (Configuration::get('squaremeter_cartupdate') == 'on')}
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
$( document ).ready(function() {
var id_product = {$product.id_product|intval};
var id_customization = {if ($product.id_customization)}{$product.id_customization|escape:'javascript'}{else}0{/if};
if(id_customization != 0) {
$.ajax({
type: "POST",
data: {
id_product:id_product,
id_customization:id_customization
},
url: "index.php?fc=module&module=squaremeter&controller=getcustomizationdata",
dataType: "json",
async: false,
success: function(data) {
customization_data = data;
id_product=id_product;
//console.table(customization_data);
//if (parseFloat(customization_data[0]['converted_ea']).toFixed(2) != $("[unique-product-id-cart={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").val()) {
// location.reload();
//}
},
error: function (jqXHR, exception) {
console.log(jqXHR);
}
});
}
});
</script>
{if isset($dimension_data)}
{foreach from=$dimension_data item="ddata"}
{foreach from=$customization_added_to_cart item="cdata"}
{if $cdata.0.id_customization == $product.id_customization}
{if $ddata.0.displayquantity == 'decimalok'}
{$dimension_text = $cdata.0.value}
{$dimension_quantity = $cdata.0.total_dimension}
{$dimension_unit = $cdata.0.unittype_module}
{$product_price = $product.price|regex_replace:'/[^0-9,.]+/':''}
{$currency = $product.price|regex_replace:'/[A-Za-z0-9.,]+/':''}
{$unit_price = $product_price|floatval / $dimension_quantity|floatval}
{/if}
{/if}
{/foreach}
{/foreach}
{/if}
{/if}
{* MEG Venture *}
<div class="row no-gutters align-items-center">
<div class="col-3">
<span class="product-image media-middle">
{if $product.cover} <a href="{$product.url}"><img src="{$product.cover.bySize.cart_default.url}"
alt="{$product.name|escape:'quotes'}"
class="img-fluid"></a>{/if}
</span>
</div>
<div class="col col-info">
<div class="pb-1">
<a href="{$product.url}">{$product.name}</a>
</div>
{if isset($product.attributes) && $product.attributes}
<div class="product-attributes text-muted pb-1">
{foreach from=$product.attributes key="attribute" item="value"}
<div class="product-line-info">
<span class="label">{$attribute}:</span>
<span class="value">{$value}</span>
</div>
{/foreach}
</div>
{/if}
<div class="row align-items-center mt-2 no-gutters">
<div class="col mr-2">
{if isset($product.is_gift) && $product.is_gift}
<input
class="form-control block-cart-product-quantity-gift"
type="number"
value="{$product.quantity}"
disabled
/>
{else}
<input
class="block-cart-product-quantity form-control js-cart-line-product-quantity"
data-down-url="{$product.down_quantity_url}"
data-up-url="{$product.up_quantity_url}"
data-update-url="{$product.update_quantity_url}"
data-product-id="{$product.id_product}"
{if (Configuration::get('squaremeter_cartupdate') == 'on')}unique-product-id-cart="{$product.id_product|escape:'javascript':'UTF-8'}-{$product.id_product_attribute|escape:'javascript':'UTF-8'}-{$product.id_customization|escape:'javascript':'UTF-8'}"{/if}
data-link-place="cart-preview"
type="number"
value="{if (isset($dimension_text) && (Configuration::get('squaremeter_cartupdate') == 'on'))}{$dimension_quantity|escape:'htmlall':'UTF-8'}{else}{$product.quantity}{/if}"
name="product-quantity-spin"
min="{$product.minimal_quantity}"
/>
{if (Configuration::get('squaremeter_cartupdate') == 'on')}
{if isset($dimension_text)}
<div class="input-group-append" style="height: 36.5px;">
<span class="input-group-text small-text text-muted">{$dimension_unit|escape:'htmlall':'UTF-8'}</span>
</div>
{/if}
{/if}
{/if}
</div>
<div class="col">
{if (Configuration::get('squaremeter_cartupdate') == 'on')}
<span>{$product.price}</span>
{else}
<span class="text-muted">x</span> <span>{$product.price}</span>
{/if}
</div>
<div class="col col-auto">
<a class="remove-from-cart"
rel="nofollow"
href="{$product.remove_from_cart_url}"
data-link-action="delete-from-cart"
data-link-place="cart-preview"
data-id-product="{$product.id_product|escape:'javascript'}"
data-id-product-attribute="{$product.id_product_attribute|escape:'javascript'}"
data-id-customization="{$product.id_customization|escape:'javascript'}"
title="{l s='remove from cart' d='Shop.Theme.Actions'}"
>
<i class="fa fa-trash-o" aria-hidden="true"></i>
</a>
</div>
</div>
{if (Configuration::get('squaremeter_cartupdate') == 'on')}
<div class="clearfix"></div>
{if is_array($product.customizations) && $product.customizations|count}
<br>
{block name='cart_detailed_product_line_customization'}
{foreach from=$product.customizations item="customization"}
{foreach from=$customization.fields item="field"}
{assign var="dimension_text" value=" "|explode:$field.text}
<div class="alert medium-alert alert-info" style="width: 100%;">
<p style="float:left;">{$field.label}&nbsp;</p>
<div class="value">
{if $field.type == 'text'}
{if (int)$field.id_module}
{$field.text nofilter}
{else}
{$field.text}
{/if}
{elseif $field.type == 'image'}
<img src="{$field.image.small.url}">
{/if}
</div>
</div>
{/foreach}
{/foreach}
{/block}
{/if}
{/if}
</div>
</div>
{if (isset($dimension_text) && (Configuration::get('squaremeter_cartupdate') == 'on'))}
<script type="text/javascript">
var id_product = {$product.id_product|intval};
$.ajax({
type: "POST",
data: {
id_product:id_product
},
url: "index.php?fc=module&module=squaremeter&controller=getdimensiondata",
dataType: "json",
async: false,
success: function(data) {
results = data;
id_product=id_product;
//console.table(results);
},
error: function (jqXHR, exception) {
console.log(jqXHR);
}
});
if (typeof results !== 'undefined' && results.length > 0) {
var displayquantity = results[0]['displayquantity'];
if ((results[0]) && (displayquantity == 'decimalok')) {
if (results[0]['step_width'])
stepvalue = results[0]['step_width'];
else
stepvalue = results[0]['step'];
if(!stepvalue)
stepvalue = 1;
switch(results[0]['calculationtype']) {
case "weight":
if (results[0]['minweight'])
minvalue = results[0]['minweight'];
else
minvalue = '';
if (results[0]['maxweight'])
maxvalue = results[0]['maxweight'];
else
maxvalue = '';
break;
default:
if (results[0]['minwidth'])
minvalue = results[0]['minwidth'];
else
minvalue = '';
if (results[0]['maxwidth'])
maxvalue = results[0]['maxwidth'];
else
maxvalue = '';
break;
}
$("[unique-product-id-cart={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('min', parseFloat(minvalue));
$("[unique-product-id-cart={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('max', parseFloat(maxvalue));
$("[unique-product-id-cart={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('step', parseFloat(stepvalue));
}
}
if (displayquantity == "decimalok") {
window["q" + "{$product.id_product|intval}-" + "{$product.id_product_attribute|intval}-" + "{$product.id_customization|intval}"] = $("[unique-product-id-cart={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").val();
setInterval(function(){
$("[unique-product-id-cart={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").val(parseFloat(window["q" + "{$product.id_product|intval}-" + "{$product.id_product_attribute|intval}-" + "{$product.id_customization|intval}"]).toFixed(2));
}, 100);
}
</script>
<style>
.input-group.bootstrap-touchspin {
float:left;
width:75px;
}
</style>
{/if}

View File

@@ -0,0 +1,270 @@
{**
* 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
*}
{if isset($dimension_data)}
{foreach from=$dimension_data item="ddata"}
{foreach from=$customization_added_to_cart item="cdata"}
{if $cdata.0.id_customization == $product.id_customization}
{if $ddata.0.displayquantity == 'decimalok'}
{$dimension_text = $cdata.0.value}
{$dimension_quantity = $cdata.0.total_dimension}
{$dimension_unit = $cdata.0.unittype_module}
{$product_price = $product.price|regex_replace:'/[^0-9,.]+/':''}
{$currency = $product.price|regex_replace:'/[A-Za-z0-9.,]+/':''}
{$unit_price = $product_price|floatval / $dimension_quantity|floatval}
{/if}
{/if}
{/foreach}
{/foreach}
{/if}
<div class="product-line-grid row align-items-center small-gutters">
<!-- product left body: description -->
<div class="product-line-grid-body col-12 col-sm-6 col-md-6">
<div class="row align-items-center small-gutters">
<div class="col product-image">
<a href="{$product.url}" data-id_customization="{$product.id_customization|intval}">
{if $product.cover}
<img src="{$product.cover.bySize.cart_default.url}" alt="{$product.name|escape:'quotes'}"
class="img-fluid">
{else}
<img src="{$urls.no_picture_image.bySize.cart_default.url}" alt="{$product.name|escape:'quotes'}"
class="img-fluid"/>
{/if}
</a>
</div>
<div class="col col-9">
<div class="product-line-info">
<a class="label" href="{$product.url}"
data-id_customization="{$product.id_customization|intval}">{$product.name}</a>
</div>
{foreach from=$product.attributes key="attribute" item="value"}
<div class="product-line-info product-line-info-secondary text-muted">
<span class="label">{$attribute}:</span>
<span class="value">{$value}</span>
</div>
{/foreach}
</div>
</div>
</div>
<!-- product left body: description -->
<div class="col-12 col-sm-6 col-md-6 product-line-grid-right product-line-actions">
<div class="row align-items-center small-gutters justify-content-end">
<!-- product unit-->
<div class="col col-auto col-md unit-price">
{if $product.has_discount}
<span class="product-discount">
{* <span class="regular-price">{$product.regular_price}</span> *}
{if $product.discount_type === 'percentage'}
<span class="discount discount-percentage mr-1">
-{$product.discount_percentage_absolute}
</span>
{else}
<span class="discount discount-amount mr-1">
-{$product.discount_to_display}
</span>
{/if}
</span>
{/if}
<span class="value">{$product.price}</span>
{if $product.unit_price_full}
{if $dimension_text}
<div class="unit-price-cart">{$currency}{$unit_price|string_format:"%.2f"} per {$dimension_unit|escape:'htmlall':'UTF-8'}</div>
{else}
<div class="unit-price-cart">{$product.unit_price_full}</div>
{/if}
{* <div class="unit-price-cart">{$product.unit_price_full}</div> *}
{/if}
</div>
<div class="col col-auto col-md qty">
{if isset($product.is_gift) && $product.is_gift}
<span class="gift-quantity">{$product.quantity}</span>
{else}
<input
class="js-cart-line-product-quantity"
style="font-size: 14px;padding:0;"
data-down-url="{$product.down_quantity_url}"
data-up-url="{$product.up_quantity_url}"
data-update-url="{$product.update_quantity_url}"
data-product-id="{$product.id_product}"
unique-product-id="{$product.id_product|escape:'javascript':'UTF-8'}-{$product.id_product_attribute|escape:'javascript':'UTF-8'}-{$product.id_customization|escape:'javascript':'UTF-8'}"
type="number"
value="{if isset($dimension_text)}{$dimension_quantity|escape:'htmlall':'UTF-8'}{else}{$product.quantity}{/if}"
name="product-quantity-spin"
/>
{if isset($dimension_text)}
<div class="input-group-append" style="height: 40px;line-height: 40px;float:right;">
<span class="input-group-text small-text text-muted">{$dimension_unit|escape:'htmlall':'UTF-8'}</span>
</div>
{/if}
{/if}
</div>
<div class="col col-auto col-md price">
<span class="product-price">
<strong>
{if isset($product.is_gift) && $product.is_gift}
<span class="gift">{l s='Gift' d='Shop.Theme.Checkout'}</span>
{else}
{$product.total}
{/if}
</strong>
</span>
</div>
<div class="col col-auto">
<div class="cart-line-product-actions">
<a
class="remove-from-cart"
rel="nofollow"
href="{$product.remove_from_cart_url}"
data-link-action="delete-from-cart"
data-id-product="{$product.id_product|escape:'javascript'}"
data-id-product-attribute="{$product.id_product_attribute|escape:'javascript'}"
data-id-customization="{$product.id_customization|escape:'javascript'}"
>
{if !isset($product.is_gift) || !$product.is_gift}
<i class="fa fa-trash-o" aria-hidden="true"></i>
{/if}
</a>
{block name='hook_cart_extra_product_actions'}
{hook h='displayCartExtraProductActions' product=$product}
{/block}
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
{if is_array($product.customizations) && $product.customizations|count}
<br>
{block name='cart_detailed_product_line_customization'}
{foreach from=$product.customizations item="customization"}
{foreach from=$customization.fields item="field"}
{assign var="dimension_text" value=" "|explode:$field.text}
<div class="alert medium-alert alert-info" style="width: 100%;">
<p style="float:left;">{$field.label}&nbsp;</p>
<div class="value">
{if $field.type == 'text'}
{if (int)$field.id_module}
{$field.text nofilter}
{else}
{$field.text}
{/if}
{elseif $field.type == 'image'}
<img src="{$field.image.small.url}">
{/if}
</div>
</div>
{/foreach}
{/foreach}
{/block}
{/if}
</div>
{if isset($dimension_text)}
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
var id_product = {$product.id_product|intval};
$.ajax({
type: "POST",
data: {
id_product:id_product
},
url: "index.php?fc=module&module=squaremeter&controller=getdimensiondata",
dataType: "json",
async: false,
success: function(data) {
results = data;
id_product=id_product;
//console.table(results);
},
error: function (jqXHR, exception) {
console.log(jqXHR);
}
});
if (typeof results !== 'undefined' && results.length > 0) {
var displayquantity = results[0]['displayquantity'];
if ((results[0]) && (displayquantity == 'decimalok')) {
if (results[0]['step_width'])
stepvalue = results[0]['step_width'];
else
stepvalue = results[0]['step'];
if(!stepvalue)
stepvalue = 1;
switch(results[0]['calculationtype']) {
case "weight":
if (results[0]['minweight'])
minvalue = results[0]['minweight'];
else
minvalue = '';
if (results[0]['maxweight'])
maxvalue = results[0]['maxweight'];
else
maxvalue = '';
break;
default:
if (results[0]['minwidth'])
minvalue = results[0]['minwidth'];
else
minvalue = '';
if (results[0]['maxwidth'])
maxvalue = results[0]['maxwidth'];
else
maxvalue = '';
break;
}
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('min', parseFloat(minvalue));
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('max', parseFloat(maxvalue));
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").attr('step', parseFloat(stepvalue));
}
}
if (displayquantity == "decimalok") {
window["q" + "{$product.id_product|intval}-" + "{$product.id_product_attribute|intval}-" + "{$product.id_customization|intval}"] = $("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").val();
setInterval(function(){
$("[unique-product-id={$product.id_product|intval}-{$product.id_product_attribute|intval}-{$product.id_customization|intval}]").val(parseFloat(window["q" + "{$product.id_product|intval}-" + "{$product.id_product_attribute|intval}-" + "{$product.id_customization|intval}"]).toFixed(4));
}, 100);
}
</script>
{/if}
<style>
.cart-item .bootstrap-touchspin {
max-width:80px;
float:left;
}
</style>

View File

@@ -0,0 +1,63 @@
{**
* 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
*}
{block name='cart_detailed_product'}
<div class="cart-overview js-cart" data-refresh-url="{url entity='cart' params=['ajax' => true, 'action' => 'refresh']}">
{if $cart.products}
<ul class="cart-items">
<li class="cart-item-header hidden-sm-down">
<div class="row small-gutters">
<div class="col-6">{l s='Product' d='Shop.Theme.Checkout'}</div>
<div class="col-6">
<div class="row small-gutters">
<div class="col">{l s='Price' d='Shop.Theme.Checkout'}</div>
<div class="col">{l s='Qty' d='Shop.Theme.Checkout'}</div>
<div class="col">{l s='Total' d='Shop.Theme.Checkout'}</div>
<div class="col col-auto"><i class="fa fa-trash-o invisible" aria-hidden="true"></i></div>
</div>
</div>
</div>
</li>
{foreach from=$cart.products item=product}
<li class="cart-item">
{block name='cart_detailed_product_line'}
{*MEG Venture*}
{if (Configuration::get('squaremeter_cartupdate') == 'on')}
{include file='checkout/_partials/cart-detailed-product-line-override.tpl' product=$product}
{else}
{include file='checkout/_partials/cart-detailed-product-line.tpl' product=$product}
{/if}
{*MEG Venture*}
{/block}
</li>
{if is_array($product.customizations) && $product.customizations|count >1}
<hr>
{/if}
{/foreach}
</ul>
{else}
<div class="alert alert-warning">{l s='There are no more items in your cart' d='Shop.Theme.Checkout'}</div>
{/if}
</div>
{/block}

View File

@@ -0,0 +1,64 @@
{**
* 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
*}
{block name='cart_summary_product_line'}
<div class="media-left mr-3 align-self-center">
{if $product.cover}
<a href="{$product.url}" title="{$product.name}">
{if $product.cover}
<img class="media-object img-fluid" src="{$product.cover.small.url}" alt="{$product.name|escape:'quotes'}">
{else}
<img class="media-object img-fluid" src="{$urls.no_picture_image.bySize.small_default.url}" alt="{$product.name|escape:'quotes'}">
{/if}
</a>
{/if}
</div>
<div class="media-body align-self-center">
<a href="{$product.url}" title="{$product.name}"><span class="product-name">{$product.name}</span></a>
{foreach from=$product.attributes key="attribute" item="value"}
<div class="product-line-info product-line-info-secondary text-muted">
<span class="label">{$attribute}:</span>
<span class="value">{$value}</span>
</div>
{/foreach}
{* MEG Venture *}
{if isset($dimension_data)}
{foreach from=$dimension_data item="ddata"}
{foreach from=$customization_added_to_cart item="cdata"}
{if $cdata.0.id_customization == $product.id_customization}
{if $ddata.0.displayquantity == 'decimalok'}
{$dimension_text = $cdata.0.value}
{$dimension_quantity = $cdata.0.total_dimension}
{$dimension_unit = $cdata.0.unittype_module}
{/if}
{/if}
{/foreach}
{/foreach}
{/if}
<span class="pull-right"><span class="product-quantity text-muted">x{if isset($dimension_text)}{$dimension_quantity|string_format:"%.2f"} {$dimension_unit|escape:'htmlall':'UTF-8'}{else}{$product.quantity}{/if}</span> {$product.price}</span>
{* MEG Venture *}
{* <span class="pull-right"><span class="product-quantity text-muted">x{$product.quantity}</span> {$product.price}</span> *}
{hook h='displayProductPriceBlock' product=$product type="unit_price"}
</div>
{/block}

View File

@@ -0,0 +1,79 @@
{**
* 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
*}
<section id="js-checkout-summary" class="card cart-summary js-cart"
data-refresh-url="{$urls.pages.cart}?ajax=1&action=refresh">
<div class="card-body">
{block name='hook_checkout_summary_top'}
{hook h='displayCheckoutSummaryTop'}
{/block}
{block name='cart_summary_products'}
<div class="cart-summary-products">
<div>{$cart.summary_string}
<a href="#" data-toggle="collapse" class="text-muted pull-right" data-target="#cart-summary-product-list">
{l s='show details' d='Shop.Theme.Actions'} <i class="fa fa-angle-down" aria-hidden="true"></i>
</a>
</div>
{block name='cart_summary_product_list'}
<div class="collapse" id="cart-summary-product-list">
<ul class="media-list">
{foreach from=$cart.products item=product}
{*MEG Venture*}
{if (Configuration::get('squaremeter_cartupdate') == 'on')}
<li class="media cart-summary-product">{include file='checkout/_partials/cart-summary-product-line-override.tpl' product=$product}</li>
{else}
<li class="media cart-summary-product">{include file='checkout/_partials/cart-summary-product-line.tpl' product=$product}</li>
{/if}
{*MEG Venture*}
{/foreach}
</ul>
<div class="text-right"><a href="{url entity=cart params=['action' => 'show']}"><span class="step-edit"><i class="fa fa-pencil" aria-hidden="true"></i> {l s='edit' d='Shop.Theme.Actions'}</span></a></div>
</div>
{/block}
</div>
{/block}
</div>
<hr>
{block name='cart_summary_subtotals'}
{include file='checkout/_partials/cart-summary-subtotals.tpl' cart=$cart}
{/block}
<hr>
{block name='cart_summary_totals'}
{include file='checkout/_partials/cart-summary-totals.tpl' cart=$cart}
{/block}
<hr>
{block name='cart_summary_voucher'}
{include file='checkout/_partials/cart-voucher.tpl'}
{/block}
</section>

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,160 @@
{*
* 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.1
* 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.
*}
{if (($allow_ordering_from_listing) AND ($availability == 'available'))}
<form action="{$urls.pages.cart}" method="post" class="squaremeterProductListing" id="sqform_{$id_product}">
<input type="hidden" name="cartsource" value="listingpage">
<input type="hidden" name="token" value="{$token}">
<input type="hidden" name="id_product" value="{$id_product}" class="product_page_product_id">
<input type="hidden" name="id_product_attribute_{$id_product}" value="{$id_product_attribute}" class="product_page_product_attribute_id">
<input type="hidden" name="id_customization" value="0" class="product_customization_id">
<input type='hidden' id='dim_{$id_product}' name='dim_{$id_product}' value='' />
<input type='hidden' id='discretion' name='discretion' value='on' />
<input type='hidden' id='converted_ea_{$id_product}' name='converted_ea_{$id_product}' value='' />
<input type='hidden' id='calculated_total_{$id_product}' name='calculated_total_{$id_product}' value='' />
<input type='hidden' id='grand_calculated_total_{$id_product}' name='grand_calculated_total_{$id_product}' value='' />
<input type='hidden' id='product_total_price_calc_{$id_product}' name='product_total_price_calc_{$id_product}' value=''/>
<input type='hidden' id='qty_alt_{$id_product}' name='qty_alt_{$id_product}' value='' />
<input type='hidden' id='quantity_wanted_{$id_product}' name='qty_{$id_product}' value='{$minimal_qty}' min='{$minimal_qty}'>
{if ($admintab_dispquan != "decimalok")} {* If direct input is allowed, step value should be one unless decimal quantity is not allowed *}
{$step = 1}
{/if}
<div class="quantity_calculated product-quantity">
<div class="value-button decrease" onclick="decreaseValue('directinput_{$id_product}', {$step});price_calculation_{$id_product}({$id_product});check_directinput({$id_product}, {$min}, {$max});" value="Decrease Value">-</div>
<input type="text" class="directinput" id="directinput_{$id_product}" name="directinput_{$id_product}" onchange="check_directinput({$id_product}, {$min}, {$max})" value="0"/>
<div class="input-group-append">
<span class="input-group-text">{$admintab_conversion_unit|escape:'html':'UTF-8'}</span>
</div>
<div class="value-button increase" onclick="increaseValue('directinput_{$id_product}', {$step});price_calculation_{$id_product}({$id_product});check_directinput({$id_product}, {$min}, {$max});" value="Increase Value">+</div>
</div>
<button
id="button_{$id_product}"
class="btn btn-primary add-to-cart"
data-button-action="add-to-cart"
type="submit"
>
{l s='Add' mod='squaremeter'}
</button>
</form>
<span id="totalpriceinfo_{$id_product}" class="totalpriceinfo"></span>
<link rel="stylesheet" href="{$module_dir|escape:'html':'UTF-8'}views/css/jquery-ui.css">
<script src="{$module_dir|escape:'html':'UTF-8'}views/js/jquery-1.12.4.js"></script>
<script src="{$module_dir|escape:'html':'UTF-8'}views/js/jquery-ui.js"></script>
<script type="text/javascript">
{if ($psversion >= '1.7.8.0')}
$('#sqform_{$id_product}').prev().prev().find('span').after($('#totalpriceinfo_{$id_product}'));
{else}
$('#sqform_{$id_product}').prev().find('span').after($('#totalpriceinfo_{$id_product}'));
{/if}
price_calculation_{$id_product}({$id_product});
$(document).on('change', 'input#directinput_{$id_product}', function (event) {
price_calculation_{$id_product}({$id_product});
});
$(document).ready(function () {
check_directinput({$id_product}, {$min}, {$max});
if ($('button[data-id-product="{$id_product}"]')) //jms_yanka theme adaptation
$('button[data-id-product="{$id_product}"]').hide();
});
function price_calculation_{$id_product}(idProduct) {
var multiplication = $('#directinput_{$id_product}').val();
if (multiplication < 0)
multiplication = 0;
if (multiplication < {$min})
multiplication = {$min};
if (multiplication > {$max})
multiplication = {$max};
$('#qty_alt_{$id_product}').val(multiplication);
var qty_prod = document.getElementById('quantity_wanted_{$id_product}');
var qty_production = Number(qty_prod.value);
var selecteddimension = {$admintab_conversion|escape:'htmlall':'UTF-8'};
{if $admintab_secconversionselect}
selecteddimension = selecteddimension * {$admintab_secconversion|escape:'htmlall':'UTF-8'};
{/if}
fulldimension = multiplication;
extra = Math.ceil(multiplication / selecteddimension) * selecteddimension - fulldimension;
if (("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onevisible")
|| ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "oneinvisible")
|| ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcvisible")
|| ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcinvisible")
|| ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok"))
{
qty_prod.value = 1;
qty_prod2 = Math.ceil(multiplication/selecteddimension);
qty_prod3 = parseFloat(Math.round((multiplication/selecteddimension) * 100) / 100).toFixed(2);
{if ($admintab_dispquan != "decimalok")}
if (qty_prod3 < 1)
qty_prod3 = 1;
{/if}
}
else
qty_prod.value = Math.ceil(multiplication/selecteddimension);
if (qty_prod.value == 0)
qty_prod.value = 1;
if ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok")
product_calc_quantity = parseFloat(Math.round((multiplication/selecteddimension) * 100) / 100).toFixed(2);
else
product_calc_quantity = Math.ceil(multiplication/selecteddimension);
var dimen = document.getElementById("dim_{$id_product}");
var unit = "{$admintab_conversion_unit|escape:'html':'UTF-8'}";
dimen.value = "({l s='Total ' mod='squaremeter'}" + parseFloat(multiplication).toFixed(2) + " " + unit + ") ";
if (typeof fulldimension !== 'undefined') {
$('#calculated_total_{$id_product}').val(parseFloat(fulldimension).toFixed(2));
if ((typeof extra !== 'undefined') && ("{$admintab_dispquan|escape:'html':'UTF-8'}" != "decimalok")) {
$('#grand_calculated_total_{$id_product}').val((fulldimension).toFixed(2) + extra);
}
}
var qty_prod = document.getElementById('quantity_wanted_{$id_product}');
if(("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcinvisible")
|| ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onewithcalcvisible"))
var qty_production = qty_prod2;
else if ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "decimalok")
var qty_production = qty_prod3;
else
var qty_production = Number(qty_prod.value);
$('#converted_ea_{$id_product}').val(qty_production);
var pricecurrencyval = "{$currency.sign}";
var pricenumberval = {$price};
$('#quantity_wanted_{$id_product}').change();
var product_total_price = Number({$admintab_startingprice|escape:'htmlall':'UTF-8'}) + pricenumberval * qty_production;
if ("{$admintab_dispquan|escape:'html':'UTF-8'}" == "onevisible"
|| "{$admintab_dispquan|escape:'html':'UTF-8'}" == "oneinvisible") {
product_total_price = pricenumberval;
}
{if $admintab_unit_baseprice}
if(pricenumberval > product_total_price)
product_total_price = pricenumberval;
{/if}
{if $admintab_reserve}
if(Number("{$admintab_reserve|escape:'htmlall':'UTF-8'}")>product_total_price)
product_total_price = Number({$admintab_reserve|escape:'htmlall':'UTF-8'});
{/if}
if ((product_total_price == 0) || (multiplication == 0))
$('#button_{$id_product}').prop( "disabled", true );
else
$('#button_{$id_product}').prop( "disabled", false );
$('#product_total_price_calc_{$id_product}').val(product_total_price.toFixed(2));
var totalpriceinfo = $('#totalpriceinfo_{$id_product}');
totalpriceinfo.html("&nbsp;{l s='(Total' mod='squaremeter'} : <span>" + pricecurrencyval + parseFloat(product_total_price).toFixed(2) + ")</span>");
}
</script>
{/if}

View File

@@ -0,0 +1,24 @@
{*
* 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.1
* 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.
*}
<script type="text/javascript">
if ('#quickview-modal-{$id_product}-{$id_product_attribute}') {
$('input#product_page_product_id[value="{$id_product}"]').next().next().next().hide();
}
</script>

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* 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 MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;