Files
newwalls.pl/modules/squaremeter/sql/uninstall.php
2024-12-17 13:43:22 +01:00

69 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.
*/
/* Drop tables and altered table fields */
$sql = array();
$sql[] = 'DROP TABLE IF EXISTS `' . pSQL(_DB_PREFIX_) . 'squaremeteradmin`';
Db::getInstance()->Execute('ALTER TABLE `' . pSQL(_DB_PREFIX_) . 'customized_data` DROP `dimension_price`');
Db::getInstance()->Execute('ALTER TABLE `' . pSQL(_DB_PREFIX_) . 'customized_data` DROP `extra_fee`');
Db::getInstance()->Execute('ALTER TABLE `' . pSQL(_DB_PREFIX_) . 'customized_data` DROP `waste`');
Db::getInstance()->Execute('ALTER TABLE `' . pSQL(_DB_PREFIX_) . 'customized_data` DROP `calculationtype`');
Db::getInstance()->Execute('ALTER TABLE `' . pSQL(_DB_PREFIX_) . 'customized_data` DROP `directinput`');
Db::getInstance()->Execute('ALTER TABLE `' . pSQL(_DB_PREFIX_) . 'customized_data` DROP `width_module`');
Db::getInstance()->Execute('ALTER TABLE `' . pSQL(_DB_PREFIX_) . 'customized_data` DROP `height_module`');
Db::getInstance()->Execute('ALTER TABLE `' . pSQL(_DB_PREFIX_) . 'customized_data` DROP `depth_module`');
Db::getInstance()->Execute('ALTER TABLE `' . pSQL(_DB_PREFIX_) . 'customized_data` DROP `weight_module`');
Db::getInstance()->Execute('ALTER TABLE `' . pSQL(_DB_PREFIX_) . 'customized_data` DROP `unittype_module`');
Db::getInstance()->Execute('ALTER TABLE `' . pSQL(_DB_PREFIX_) . 'customized_data` DROP `total_dimension`');
Db::getInstance()->Execute('ALTER TABLE `' . pSQL(_DB_PREFIX_) . 'customized_data` DROP `grand_total_dimension`');
Db::getInstance()->Execute('ALTER TABLE `' . pSQL(_DB_PREFIX_) . 'customized_data` DROP `converted_ea`');
$index = Configuration::get('WD_CUSTOMIZATION_INDEX');
Db::getInstance()->delete('customization_field_lang', 'id_customization_field=' . $index);
if (_THEME_NAME_ == 'classic') {
if (file_exists(_PS_ALL_THEMES_DIR_ . 'classic/templates/checkout/_partials/cart-detailed_old.tpl')) {
unlink(_PS_ALL_THEMES_DIR_ . 'classic/templates/checkout/_partials/cart-detailed.tpl');
rename(_PS_ALL_THEMES_DIR_ . 'classic/templates/checkout/_partials/cart-detailed_old.tpl', _PS_ALL_THEMES_DIR_ . 'classic/templates/checkout/_partials/cart-detailed.tpl');
}
}
if (_THEME_NAME_ == 'classic') {
if (file_exists(_PS_ALL_THEMES_DIR_ . 'classic/templates/checkout/_partials/cart-summary_old.tpl')) {
unlink(_PS_ALL_THEMES_DIR_ . 'classic/templates/checkout/_partials/cart-summary.tpl');
rename(_PS_ALL_THEMES_DIR_ . 'classic/templates/checkout/_partials/cart-summary_old.tpl', _PS_ALL_THEMES_DIR_ . 'classic/templates/checkout/_partials/cart-summary.tpl');
}
}
if (file_exists(_PS_MODULE_DIR_ . 'ps_shoppingcart/controllers/front/ajax_old.php')) {
unlink('../modules/ps_shoppingcart/controllers/front/ajax.php');
rename(_PS_MODULE_DIR_ . 'ps_shoppingcart/controllers/front/ajax_old.php', _PS_MODULE_DIR_ . 'ps_shoppingcart/controllers/front/ajax.php');
}
/* Drop added configuration fields and uninstall */
if (!Configuration::deleteByName('squaremeter_designtype')
|| !Configuration::deleteByName('squaremeter_unittype')
|| !Configuration::deleteByName('squaremeter_decimaltype')
|| !Configuration::deleteByName('squaremeter_dimensiondisplaytype')
|| !Configuration::deleteByName('squaremeter_cartupdate')
|| !parent::uninstall()
|| !$this->runSql($sql)) {
return false;
}