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,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;"
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(2));
}, 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,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.0
* Author: MEG Venture
*
* Copyright 2013, MEG Venture (info@megventure.com)
*
* This program is not a free software: you can't redistribute it and/or modify
* it. All rights reserved.
*
*
* This copyright notice and licence should be retained in all modules based on this framework.
* This does not affect your rights to assert copyright over your own original work.
*}
<!-- Square Meter Calculation Module -->
{if ($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,779 @@
{*
* Module Name: Perimeter / Length / Surface (Area) / Volume / Weight Calculator for Prestashop
* Module URI: Please contact with info@megventure.com
* Description: A utility to calculate quantity in perimeter, length, area, volume or weight units
* Version: 5.5.0
* Author: MEG Venture
*
* Copyright 2013, MEG Venture (info@megventure.com)
*
* This program is not a free software: you can't redistribute it and/or modify
* it. All rights reserved.
*
*
* This copyright notice and licence should be retained in all modules based on this framework.
* This does not affect your rights to assert copyright over your own original work.
*}
{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);
{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);
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);
{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);
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(2));
if ((typeof extra !== 'undefined') && ("{$admintab_dispquan|escape:'html':'UTF-8'}" != "decimalok")) {
$('#grand_calculated_total').val((fulllength).toFixed(2) + 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);
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);
var pricenumberval = $("#product-details").data("product").price_amount;
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(2);
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(2);
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,950 @@
{*
* Module Name: Perimeter / Length / Surface (Area) / Volume / Weight Calculator for Prestashop
* Module URI: Please contact with info@megventure.com
* Description: A utility to calculate quantity in perimeter, length, area, volume or weight units
* Version: 5.5.0
* Author: MEG Venture
*
* Copyright 2013, MEG Venture (info@megventure.com)
*
* This program is not a free software: you can't redistribute it and/or modify
* it. All rights reserved.
*
*
* This copyright notice and licence should be retained in all modules based on this framework.
* This does not affect your rights to assert copyright over your own original work.
*}
{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);
{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);
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(2));
if ((typeof extra !== 'undefined') && ("{$admintab_dispquan|escape:'html':'UTF-8'}" != "decimalok")) {
$('#grand_calculated_total').val((fulllength).toFixed(2) + 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);
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);
var pricenumberval = $("#product-details").data("product").price_amount;
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(2);
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(2);
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,290 @@
{*
* Module Name: Perimeter / Length / Surface (Area) / Volume / Weight Calculator for Prestashop
* Module URI: Please contact with info@megventure.com
* Description: A utility to calculate quantity in perimeter, length, area, volume or weight units
* Version: 5.5.0
* Author: MEG Venture
*
* Copyright 2013, MEG Venture (info@megventure.com)
*
* This program is not a free software: you can't redistribute it and/or modify
* it. All rights reserved.
*
*
* This copyright notice and licence should be retained in all modules based on this framework.
* This does not affect your rights to assert copyright over your own original work.
*}
{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}
</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.0
* Author: MEG Venture
*
* Copyright 2013, MEG Venture (info@megventure.com)
*
* This program is not a free software: you can't redistribute it and/or modify
* it. All rights reserved.
*
*
* This copyright notice and licence should be retained in all modules based on this framework.
* This does not affect your rights to assert copyright over your own original work.
*}
{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.0
* Author: MEG Venture
*
* Copyright 2013, MEG Venture (info@megventure.com)
*
* This program is not a free software: you can't redistribute it and/or modify
* it. All rights reserved.
*
*
* This copyright notice and licence should be retained in all modules based on this framework.
* This does not affect your rights to assert copyright over your own original work.
*}
{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.0
* Author: MEG Venture
*
* Copyright 2013, MEG Venture (info@megventure.com)
*
* This program is not a free software: you can't redistribute it and/or modify
* it. All rights reserved.
*
*
* This copyright notice and licence should be retained in all modules based on this framework.
* This does not affect your rights to assert copyright over your own original work.
*}
{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.0
* Author: MEG Venture
*
* Copyright 2013, MEG Venture (info@megventure.com)
*
* This program is not a free software: you can't redistribute it and/or modify
* it. All rights reserved.
*
*
* This copyright notice and licence should be retained in all modules based on this framework.
* This does not affect your rights to assert copyright over your own original work.
*}
{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,5 @@
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

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;"
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(2));
}, 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;"
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(2));
}, 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(2));
}, 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,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;"
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(2));
}, 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,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,238 @@
{* 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;"
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(2));
}, 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;