first commit
This commit is contained in:
35
modules/squaremeter_dizalawycinek/sql/index.php
Normal file
35
modules/squaremeter_dizalawycinek/sql/index.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* 2007-2021 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2021 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
161
modules/squaremeter_dizalawycinek/sql/install.php
Normal file
161
modules/squaremeter_dizalawycinek/sql/install.php
Normal file
@@ -0,0 +1,161 @@
|
||||
<?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.0
|
||||
*
|
||||
* @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.
|
||||
*/
|
||||
|
||||
/* SQL for overriding product customized data */
|
||||
if (!Db::getInstance()->Execute('
|
||||
ALTER TABLE `' . pSQL(_DB_PREFIX_) . 'customized_data`
|
||||
ADD `dimension_price` VARCHAR( 150 ) NOT NULL,
|
||||
ADD `extra_fee` VARCHAR( 150 ) NOT NULL,
|
||||
ADD `waste` VARCHAR( 150 ) NOT NULL,
|
||||
ADD `calculationtype` VARCHAR( 150 ) NOT NULL,
|
||||
ADD `directinput` FLOAT( 10,2 ) NOT NULL,
|
||||
ADD `width_module` FLOAT( 10,2 ) NOT NULL,
|
||||
ADD `height_module`FLOAT( 10,2 ) NOT NULL,
|
||||
ADD `depth_module` FLOAT( 10,2 ) NOT NULL,
|
||||
ADD `weight_module` FLOAT( 10,2 ) NOT NULL,
|
||||
ADD `unittype_module` VARCHAR( 10 ) NOT NULL,
|
||||
ADD `total_dimension` DECIMAL( 20,6 ) NOT NULL,
|
||||
ADD `grand_total_dimension` DECIMAL( 20,6 ) NOT NULL,
|
||||
ADD `converted_ea` DECIMAL( 20,6 ) NOT NULL')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$sql0 = 'INSERT INTO `' . pSQL(_DB_PREFIX_) . 'customization_field` (`id_product`, `type`, `required`) VALUES (0,1,0)';
|
||||
if (!DB::getInstance()->execute($sql0)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$id_customisefield = Db::getInstance()->Insert_ID();
|
||||
$available_languages = LanguageCore::getLanguages();
|
||||
foreach ($available_languages as $a_language) {
|
||||
$sql = 'INSERT INTO `' . pSQL(_DB_PREFIX_) . 'customization_field_lang` (`id_customization_field`, `id_lang`, `name`)
|
||||
VALUES (' . (int) $id_customisefield . ',' . (int) $a_language['id_lang'] . ',\' Dimension \')';
|
||||
if (!DB::getInstance()->execute($sql)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
ConfigurationCore::updateValue('WD_CUSTOMIZATION_INDEX', (int) $id_customisefield);
|
||||
ConfigurationCore::updateValue('PS_CUSTOMIZATION_FEATURE_ACTIVE', 1);
|
||||
|
||||
/* SQL squaremeter module separate product settings */
|
||||
$sql = array();
|
||||
$sql[] = 'CREATE TABLE IF NOT EXISTS `' . pSQL(_DB_PREFIX_) . 'squaremeteradmin` (
|
||||
`id_squaremeteradmin` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`id_shop` INT( 11 ) UNSIGNED NOT NULL,
|
||||
`id_product` INT( 11 ) UNSIGNED NOT NULL,
|
||||
`displaycalculator` varchar(10) NOT NULL,
|
||||
`displaypicture` varchar(10) NOT NULL,
|
||||
`calculationtype` varchar(10) NOT NULL,
|
||||
`additionalquantity` varchar(10) NOT NULL,
|
||||
`directinput` varchar(10) NOT NULL,
|
||||
`displayquantity` varchar(20) NOT NULL,
|
||||
`ratio` varchar(20) NOT NULL,
|
||||
`displayprice` varchar(20) NOT NULL,
|
||||
`displayreserve` varchar(20) NOT NULL,
|
||||
`unit_baseprice` varchar(10) NOT NULL,
|
||||
`displaystartingprice` varchar(20) NOT NULL,
|
||||
`displayextrafee` varchar(20) NOT NULL,
|
||||
`displayextrafeeselect` varchar(20) NOT NULL,
|
||||
`displaywaste` varchar(20) NOT NULL,
|
||||
`displaywasteselect` varchar(20) NOT NULL,
|
||||
`conversion` varchar(15) NOT NULL,
|
||||
`secconversionselect` varchar(15) NOT NULL,
|
||||
`secconversion` varchar(15) NOT NULL,
|
||||
`conversionunit` varchar(15) NOT NULL,
|
||||
`attribute` varchar(15) NOT NULL,
|
||||
`attributeunit` varchar(15) NOT NULL,
|
||||
`step` varchar(15) NOT NULL,
|
||||
`disableapplet` varchar(10) NOT NULL,
|
||||
`allow_ordering_from_listing` varchar(10) NOT NULL,
|
||||
`attselect` varchar(15) NOT NULL,
|
||||
`minheight` varchar(15) NOT NULL,
|
||||
`maxheight` varchar(15) NOT NULL,
|
||||
`maxheightunit` varchar(15) NOT NULL,
|
||||
`heightcheck` varchar(15) NOT NULL,
|
||||
`step_height` varchar(15) NOT NULL,
|
||||
`minwidth` varchar(15) NOT NULL,
|
||||
`maxwidth` varchar(15) NOT NULL,
|
||||
`maxwidthunit` varchar(15) NOT NULL,
|
||||
`widthcheck` varchar(15) NOT NULL,
|
||||
`step_width` varchar(15) NOT NULL,
|
||||
`mindepth` varchar(15) NOT NULL,
|
||||
`maxdepth` varchar(15) NOT NULL,
|
||||
`maxdepthunit` varchar(15) NOT NULL,
|
||||
`depthcheck` varchar(15) NOT NULL,
|
||||
`step_depth` varchar(15) NOT NULL,
|
||||
`minweight` varchar(15) NOT NULL,
|
||||
`maxweight` varchar(15) NOT NULL,
|
||||
`maxweightunit` varchar(15) NOT NULL,
|
||||
`weightcheck` varchar(15) NOT NULL,
|
||||
PRIMARY KEY (`id_squaremeteradmin`)
|
||||
-- UNIQUE `SQUAREMETER_ADMIN_UNIQ` (`id_product`)
|
||||
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8';
|
||||
|
||||
/* SQL for options */
|
||||
if (!Db::getInstance()->Execute('
|
||||
INSERT INTO `' . pSQL(_DB_PREFIX_) . 'configuration`(`id_configuration`, `name`, `value`, `date_add`, `date_upd`)
|
||||
VALUES("","squaremeter_designtype", "design1", "2012-03-29 00:08:22", "2012-04-02 12:42:16")')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Db::getInstance()->Execute('
|
||||
INSERT INTO `' . pSQL(_DB_PREFIX_) . 'configuration`(`id_configuration`, `name`, `value`, `date_add`, `date_upd`)
|
||||
VALUES("","squaremeter_unittype", "metric", "2012-03-29 00:08:22", "2012-04-02 12:42:16")')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Db::getInstance()->Execute('
|
||||
INSERT INTO `' . pSQL(_DB_PREFIX_) . 'configuration`(`id_configuration`, `name`, `value`, `date_add`, `date_upd`)
|
||||
VALUES("","squaremeter_decimaltype", "point", "2012-03-29 00:08:22", "2012-04-02 12:42:16")')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Db::getInstance()->Execute('
|
||||
INSERT INTO `' . pSQL(_DB_PREFIX_) . 'configuration`(`id_configuration`, `name`, `value`, `date_add`, `date_upd`)
|
||||
VALUES("","squaremeter_dimensiondisplaytype", "off", "2012-03-29 00:08:22", "2012-04-02 12:42:16")')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Db::getInstance()->Execute('
|
||||
INSERT INTO `' . pSQL(_DB_PREFIX_) . 'configuration`(`id_configuration`, `name`, `value`, `date_add`, `date_upd`)
|
||||
VALUES("","squaremeter_cartupdate", "on", "2012-03-29 00:08:22", "2012-04-02 12:42:16")')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Modules Override */
|
||||
if (file_exists(_PS_MODULE_DIR_ . 'ps_shoppingcart/controllers/front/ajax.php')) {
|
||||
rename(_PS_MODULE_DIR_ . 'ps_shoppingcart/controllers/front/ajax.php', _PS_MODULE_DIR_ . 'ps_shoppingcart/controllers/front/ajax_old.php');
|
||||
}
|
||||
copy(_PS_MODULE_DIR_ . 'squaremeter/override/modules/ps_shoppingcart/controllers/front/ajax.php', _PS_MODULE_DIR_ . 'ps_shoppingcart/controllers/front/ajax.php');
|
||||
|
||||
/* Theme Override */
|
||||
if (_THEME_NAME_ == 'classic') {
|
||||
if (file_exists(_PS_ALL_THEMES_DIR_ . 'classic/templates/checkout/_partials/cart-detailed.tpl')) {
|
||||
rename(_PS_ALL_THEMES_DIR_ . 'classic/templates/checkout/_partials/cart-detailed.tpl', _PS_ALL_THEMES_DIR_ . 'classic/templates/checkout/_partials/cart-detailed_old.tpl');
|
||||
}
|
||||
copy(_PS_MODULE_DIR_ . 'squaremeter/views/templates/front/cart-detailed.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.tpl')) {
|
||||
rename(_PS_ALL_THEMES_DIR_ . 'classic/templates/checkout/_partials/cart-summary.tpl', _PS_ALL_THEMES_DIR_ . 'classic/templates/checkout/_partials/cart-summary_old.tpl');
|
||||
}
|
||||
copy(_PS_MODULE_DIR_ . 'squaremeter/views/templates/front/cart-summary.tpl', _PS_ALL_THEMES_DIR_ . 'classic/templates/checkout/_partials/cart-summary.tpl');
|
||||
}
|
||||
68
modules/squaremeter_dizalawycinek/sql/uninstall.php
Normal file
68
modules/squaremeter_dizalawycinek/sql/uninstall.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?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.0
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
Reference in New Issue
Block a user