59 lines
4.0 KiB
PHP
59 lines
4.0 KiB
PHP
<?php
|
|
/**
|
|
* Module Name: Perimeter / Length / Surface (Area) / Volume / Weight Calculator for Prestashop
|
|
*
|
|
* Module URI: Please contact with info@megventure.com
|
|
* Description: A utility to calculate quantity in perimeter, length, area, volume or weight units
|
|
* Version: 5.5.1
|
|
*
|
|
* @author MEG Venture <info@megventure.com>
|
|
* @copyright 2007-2021 MEG Venture
|
|
* @license For Prestashop--> http://opensource.org/licenses/osl-3.2.1.php Open Software License (OSL 3.2.1)
|
|
*
|
|
* This program is not a free software: you can't redistribute it and/or modify
|
|
* it. All rights reserved to MEG Venture.
|
|
*
|
|
* 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.
|
|
*/
|
|
|
|
$scanCustomThemes = scandir(_PS_ALL_THEMES_DIR_);
|
|
foreach ($scanCustomThemes as $theme_folder) {
|
|
if (is_dir(_PS_ALL_THEMES_DIR_ . '/' . $theme_folder)
|
|
&& ($theme_folder != '.')
|
|
&& ($theme_folder != '..')) {
|
|
//echo '<p>'.$theme_folder.'</p>';
|
|
$scanAvailableCustomThemes = scandir(_PS_MODULE_DIR_ . 'squaremeter/views/templates/front/supported_themes');
|
|
foreach ($scanAvailableCustomThemes as $module_folder) {
|
|
if (is_dir(_PS_MODULE_DIR_ . 'squaremeter/views/templates/front/supported_themes/' . $module_folder)
|
|
&& ($module_folder != ".")
|
|
&& ($module_folder != "..")
|
|
&& ($theme_folder == $module_folder)) {
|
|
// echo '<p>'.$module_folder.'</p>';
|
|
if (file_exists(_PS_ALL_THEMES_DIR_ . '/' . $theme_folder . '/templates/checkout/_partials/cart-detailed_old.tpl')) {
|
|
unlink(_PS_ALL_THEMES_DIR_ . '/' . $theme_folder . '/templates/checkout/_partials/cart-detailed.tpl');
|
|
rename(_PS_ALL_THEMES_DIR_ . '/' . $theme_folder . '/templates/checkout/_partials/cart-detailed_old.tpl', _PS_ALL_THEMES_DIR_ . '/' . $theme_folder . '/templates/checkout/_partials/cart-detailed.tpl');
|
|
}
|
|
if (file_exists(_PS_ALL_THEMES_DIR_ . '/' . $theme_folder . '/templates/checkout/_partials/cart-summary_old.tpl')) {
|
|
unlink(_PS_ALL_THEMES_DIR_ . '/' . $theme_folder . '/templates/checkout/_partials/cart-summary.tpl');
|
|
rename(_PS_ALL_THEMES_DIR_ . '/' . $theme_folder . '/templates/checkout/_partials/cart-summary_old.tpl', _PS_ALL_THEMES_DIR_ . '/' . $theme_folder . '/templates/checkout/_partials/cart-summary.tpl');
|
|
}
|
|
unlink(_PS_ALL_THEMES_DIR_ . '/' . $theme_folder . '/templates/checkout/_partials/cart-detailed-product-line-override.tpl');
|
|
unlink(_PS_ALL_THEMES_DIR_ . '/' . $theme_folder . '/templates/checkout/_partials/cart-summary-product-line-override.tpl');
|
|
if ($theme_folder == 'jms_yanka') {
|
|
if (file_exists(_PS_ALL_THEMES_DIR_ . '/' . $theme_folder . '/templates/catalog/product-layout-default_old.tpl')) {
|
|
unlink(_PS_ALL_THEMES_DIR_ . '/' . $theme_folder . '/templates/catalog/product-layout-default.tpl');
|
|
rename(_PS_ALL_THEMES_DIR_ . '/' . $theme_folder . '/templates/catalog/product-layout-default_old.tpl', _PS_ALL_THEMES_DIR_ . '/' . $theme_folder . '/catalog/product-layout-default.tpl');
|
|
}
|
|
}
|
|
if ($theme_folder == 'warehouse') {
|
|
if (file_exists(_PS_ALL_THEMES_DIR_ . '/' . $theme_folder . '/modules/ps_shoppingcart/ps_shoppingcart-product-line_old.tpl')) {
|
|
unlink(_PS_ALL_THEMES_DIR_ . '/' . $theme_folder . '/modules/ps_shoppingcart/ps_shoppingcart-product-line.tpl');
|
|
rename(_PS_ALL_THEMES_DIR_ . '/' . $theme_folder . '/modules/ps_shoppingcart/ps_shoppingcart-product-line_old.tpl', _PS_ALL_THEMES_DIR_ . '/' . $theme_folder . '/modules/ps_shoppingcart/ps_shoppingcart-product-line.tpl');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|