Commit du module Colissimo

This commit is contained in:
2020-09-09 12:52:39 +02:00
parent de4bc540e4
commit b5d5fd110e
123 changed files with 28431 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" ?>
<config xmlns="http://thelia.net/schema/dic/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://thelia.net/schema/dic/config http://thelia.net/schema/dic/config/thelia-1.0.xsd">
<loops>
<loop class="SoColissimo\Loop\CheckRightsLoop" name="socolissimo.check.rights" />
<loop class="SoColissimo\Loop\SoColissimoDeliveryMode" name="socolissimo.delivery.mode" />
<loop class="SoColissimo\Loop\SoColissimoPrice" name="socolissimo" />
<loop class="SoColissimo\Loop\SoColissimoId" name="socolissimoid" />
<loop class="SoColissimo\Loop\GetRelais" name="socolissimo.around" />
<loop class="SoColissimo\Loop\SoColissimoAddress" name="address.socolissimo" />
<loop class="SoColissimo\Loop\NotSentOrders" name="order.notsent.socolissimo" />
<loop class="SoColissimo\Loop\SoColissimoOrderAddressLoop" name="socolissimo.order_address" />
<loop class="SoColissimo\Loop\AreaFreeshippingDom" name="socolissimo.area.freeshipping.dom" />
<loop class="SoColissimo\Loop\AreaFreeshippingPr" name="socolissimo.area.freeshipping.pr" />
</loops>
<forms>
<form name="socolissimo.freeshipping.form" class="SoColissimo\Form\FreeShipping" />
<form name="socolissimo.configure" class="SoColissimo\Form\ConfigureSoColissimo" />
<form name="socolissimo.export" class="SoColissimo\Form\ExportOrder" />
<form name="socolissimo.import" class="SoColissimo\Form\ImportForm"/>
<form name="socolissimo.add.price.form" class="SoColissimo\Form\AddPriceForm" />
<form name="socolissimo.update.price.form" class="SoColissimo\Form\UpdatePriceForm" />
</forms>
<services>
<service id="hook.order.module.socolissimo" class="SoColissimo\Listener\SetDeliveryModule" scope="request">
<argument type="service" id="request"/>
<tag name="kernel.event_subscriber"/>
</service>
<service id="send.socolissimo.mail" class="SoColissimo\Listener\SendMail" scope="request">
<argument type="service" id="thelia.parser" />
<argument type="service" id="mailer"/>
<tag name="kernel.event_subscriber"/>
</service>
<service id="socolissimo.price.smarty.plugin" class="SoColissimo\Smarty\Plugins\SocolissimoDeliveryPrice" scope="request">
<argument type="service" id="request" />
<argument type="service" id="event_dispatcher"/>
<tag name="thelia.parser.register_plugin" />
</service>
</services>
<hooks>
<hook id="socolissimo.hook.back" class="SoColissimo\Hook\BackHook">
<tag name="hook.event_listener" event="module.configuration" type="back" method="onModuleConfiguration" />
<tag name="hook.event_listener" event="module.config-js" type="back" method="onModuleConfigJs" />
</hook>
<hook id="socolissimo.hook.front" class="SoColissimo\Hook\FrontHook" scope="request">
<tag name="hook.event_listener" event="order-delivery.extra" />
<tag name="hook.event_listener" event="order-invoice.delivery-address" />
<tag name="hook.event_listener" event="main.head-bottom" />
</hook>
<hook id="socolissimo.hook.pdf" class="SoColissimo\Hook\PdfHook" scope="request">
<tag name="hook.event_listener" event="invoice.after-delivery-module" type="pdf" method="onInvoiceAfterDeliveryModule" />
</hook>
</hooks>
</config>

View File

@@ -0,0 +1,46 @@
# This is a fix for InnoDB in MySQL >= 4.1.x
# It "suspends judgement" for fkey relationships until are tables are set.
SET FOREIGN_KEY_CHECKS = 0;
-- add domicile and relais delivery mode
INSERT INTO `socolissimo_delivery_mode` (`id`, `title`, `code`, `freeshipping_active`, `freeshipping_from`)
VALUES
(1, 'Domicile', 'dom', 0, NULL),
(2, 'Point relais', 'pr', 0, NULL);
-- add domicile delivery mode
INSERT INTO `socolissimo_area_freeshipping_dom` (`id`, `area_id`, `delivery_mode_id`, `cart_amount`)
VALUES
(1, '1', '1', NULL);
-- add relais delivery mode
INSERT INTO `socolissimo_area_freeshipping_pr` (`id`, `area_id`, `delivery_mode_id`, `cart_amount`)
VALUES
(1, '1', '2', NULL);
-- ---------------------------------------------------------------------
-- Mail templates for socolissimo
-- ---------------------------------------------------------------------
-- First, delete existing entries
SET @var := 0;
SELECT @var := `id` FROM `message` WHERE name="mail_socolissimo";
DELETE FROM `message` WHERE `id`=@var;
-- Try if ON DELETE constraint isn't set
DELETE FROM `message_i18n` WHERE `id`=@var;
-- Then add new entries
SELECT @max := MAX(`id`) FROM `message`;
SET @max := @max+1;
-- insert message
INSERT INTO `message` (`id`, `name`, `secured`) VALUES
(@max,
'mail_socolissimo',
'0'
);
-- and template fr_FR
INSERT INTO `message_i18n` (`id`, `locale`, `title`, `subject`, `text_message`, `html_message`) VALUES
(@max, 'fr_FR', 'mail livraison So Colissimo', 'Suivi So Colissimo commande : {$order_ref}', '{loop type="customer" name="customer.order" current="false" id="$customer_id" backend_context="1"}\r\n{$LASTNAME} {$FIRSTNAME},\r\n{/loop}\r\nNous vous remercions de votre commande sur notre site {config key="store_name"}\r\nUn colis concernant votre commande {$order_ref} du {format_date date=$order_date} a quitté nos entrepôts pour être pris en charge par La Poste le {format_date date=$update_date}.\r\nSon numéro de suivi est le suivant : {$package}\r\nIl vous permet de suivre votre colis en ligne sur le site de La Poste : www.coliposte.net\r\nNous restons à votre disposition pour toute information complémentaire.\r\nCordialement', '{loop type="customer" name="customer.order" current="false" id="$customer_id" backend_context="1"}\r\n{$LASTNAME} {$FIRSTNAME},\r\n{/loop}\r\nNous vous remercions de votre commande sur notre site {config key="store_name"}\r\nUn colis concernant votre commande {$order_ref} du {format_date date=$order_date} a quitté nos entrepôts pour être pris en charge par La Poste le {format_date date=$update_date}.\r\nSon numéro de suivi est le suivant : {$package}\r\nIl vous permet de suivre votre colis en ligne sur le site de La Poste : www.coliposte.net\r\nIl vous sera, par ailleurs, très utile si vous étiez absent au moment de la livraison de votre colis : en fournissant ce numéro de Colissimo Suivi, vous pourrez retirer votre colis dans le bureau de Poste le plus proche.\r\nATTENTION ! Si vous ne trouvez pas l''avis de passage normalement déposé dans votre boîte aux lettres au bout de 48 Heures jours ouvrables, n''hésitez pas à aller le réclamer à votre bureau de Poste, muni de votre numéro de Colissimo Suivi.\r\nNous restons à votre disposition pour toute information complémentaire.\r\nCordialement');
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<module>
<fullnamespace>SoColissimo\SoColissimo</fullnamespace>
<descriptive locale="en_US">
<title>So Colissimo</title>
</descriptive>
<descriptive locale="fr_FR">
<title>So Colissimo</title>
</descriptive>
<version>1.4.11</version>
<author>
<name>Thelia</name>
<email>info@thelia.net</email>
</author>
<type>delivery</type>
<thelia>2.1.0</thelia>
<stability>other</stability>
</module>

View File

@@ -0,0 +1 @@
{"1":{"_info":"area 1 : France","slices":{"0.25":"5.2","0.5":5.8,"0.75":6.56,"1":7.13,"2":8.08,"3":9.22,"5":"1","7":13.4,"10":16.53,"15":19.14,"30":26.93,"10000000000":"1"}},"2":{"_info":"area 2 : A Zone - Union Europ\u00e9enne et Suisse","slices":{"1":15.34,"2":16.96,"3":20.47,"4":23.99,"5":27.5,"6":31.02,"7":34.53,"8":38.05,"9":41.56,"10":45.08,"15":51.92,"20":58.76,"25":65.6,"30":72.44}},"3":{"_info":"area 3 : B Zone - Pays de l\u2019Europe de l\u2019Est (hors Union Europ\u00e9enne), Norv\u00e8ge, Maghreb","slices":{"1":18.81,"2":20.62,"3":24.94,"4":29.26,"5":33.58,"6":37.91,"7":42.23,"8":46.55,"9":50.87,"10":55.2,"15":65.08,"20":74.96}},"4":{"_info":"area 4 : C Zone - Pays d\u2019Afrique hors Maghreb, Canada, Etats-Unis, Proche et Moyen Orient","slices":{"1":22.04,"2":29.55,"3":38.86,"4":48.17,"5":57.48,"6":66.79,"7":76.1,"8":85.41,"9":94.72,"10":104.03,"15":126.92,"20":149.82}},"5":{"_info":"area 5 : D Zone - Autres destinations","slices":{"1":25.08,"2":37.72,"3":50.26,"4":62.8,"5":75.34,"6":87.88,"7":100.42,"8":112.96,"9":125.5,"10":138.04,"15":162.74,"20":187.44}},"6":{"_info":"area 6 : France OM1","slices":{"0.5":8.27,"1":12.49,"2":17.05,"3":21.61,"4":26.17,"5":30.73,"6":35.29,"7":39.85,"8":44.41,"9":48.97,"10":53.53,"15":76.33,"20":99.13,"25":121.93,"30":144.73}},"7":{"_info":"area 7 : France OM2","slices":{"0.5":9.88,"1":14.92,"2":26.32,"3":37.72,"4":49.12,"5":60.52,"6":71.92,"7":83.32,"8":94.72,"9":106.12,"10":117.52,"15":174.52,"20":231.52,"25":288.52,"30":345.52}}}

View File

@@ -0,0 +1 @@
{"1":{"_info":"area 1 : France","slices":{"0.25":"5.2","0.5":5.8,"0.75":6.56,"1":7.13,"2":8.08,"3":9.22,"5":"1","7":13.4,"10":16.53,"15":19.14,"30":26.93,"10000000000":"1"}},"2":{"_info":"area 2 : A Zone - Union Europ\u00e9enne et Suisse","slices":{"1":15.34,"2":16.96,"3":20.47,"4":23.99,"5":27.5,"6":31.02,"7":34.53,"8":38.05,"9":41.56,"10":45.08,"15":51.92,"20":58.76,"25":65.6,"30":72.44}},"3":{"_info":"area 3 : B Zone - Pays de l\u2019Europe de l\u2019Est (hors Union Europ\u00e9enne), Norv\u00e8ge, Maghreb","slices":{"1":18.81,"2":20.62,"3":24.94,"4":29.26,"5":33.58,"6":37.91,"7":42.23,"8":46.55,"9":50.87,"10":55.2,"15":65.08,"20":74.96}},"4":{"_info":"area 4 : C Zone - Pays d\u2019Afrique hors Maghreb, Canada, Etats-Unis, Proche et Moyen Orient","slices":{"1":22.04,"2":29.55,"3":38.86,"4":48.17,"5":57.48,"6":66.79,"7":76.1,"8":85.41,"9":94.72,"10":104.03,"15":126.92,"20":149.82}},"5":{"_info":"area 5 : D Zone - Autres destinations","slices":{"1":25.08,"2":37.72,"3":50.26,"4":62.8,"5":75.34,"6":87.88,"7":100.42,"8":112.96,"9":125.5,"10":138.04,"15":162.74,"20":187.44}},"6":{"_info":"area 6 : France OM1","slices":{"0.5":8.27,"1":12.49,"2":17.05,"3":21.61,"4":26.17,"5":30.73,"6":35.29,"7":39.85,"8":44.41,"9":48.97,"10":53.53,"15":76.33,"20":99.13,"25":121.93,"30":144.73}},"7":{"_info":"area 7 : France OM2","slices":{"0.5":9.88,"1":14.92,"2":26.32,"3":37.72,"4":49.12,"5":60.52,"6":71.92,"7":83.32,"8":94.72,"9":106.12,"10":117.52,"15":174.52,"20":231.52,"25":288.52,"30":345.52}}}

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<routes xmlns="http://symfony.com/schema/routing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
<route id="socolissimo.add.price" path="/admin/module/socolissimo/slice/save" methods="post">
<default key="_controller">SoColissimo\Controller\SliceController::saveSliceAction</default>
</route>
<route id="socolissimo.update.price" path="/admin/module/socolissimo/slice/delete" methods="post">
<default key="_controller">SoColissimo\Controller\SliceController::deleteSliceAction</default>
</route>
<route id="socolissimo.toggle.freeshipping" path="/admin/module/socolissimo/freeshipping" methods="post">
<default key="_controller">SoColissimo\Controller\FreeShipping::toggleFreeShippingActivation</default>
</route>
<route id="socolissimo.edit.freeshippingfrom" path="/admin/module/socolissimo/freeshipping_from" methods="post">
<default key="_controller">SoColissimo\Controller\FreeShipping::setFreeShippingFrom</default>
</route>
<route id="socolissimo.edit.areafreeshipping" path="/admin/module/socolissimo/area_freeshipping" methods="post">
<default key="_controller">SoColissimo\Controller\FreeShipping::setAreaFreeShipping</default>
</route>
<route id="socolissimo.configure" path="/admin/module/socolissimo/configure" methods="post">
<default key="_controller">SoColissimo\Controller\SaveConfig::save</default>
</route>
<route id="socolissimo.get.specific.location" path="/module/socolissimo/{countryid}/{zipcode}/{city}/{address}" methods="get">
<default key="_controller">SoColissimo\Controller\GetSpecificLocation::get</default>
<default key="address"></default>
<requirement key="city">[a-zA-Z\- ]+</requirement>
</route>
<route id="socolissimo.point.info" path="/module/socolissimo/point/{point_id}">
<default key="_controller">SoColissimo\Controller\GetSpecificLocation::getPointInfo</default>
</route>
<route id="socolissimo.point.search" path="/module/socolissimo/points">
<default key="_controller">SoColissimo\Controller\GetSpecificLocation::search</default>
</route>
<route id="socolissimo.export" path="/admin/module/socolissimo/export" methods="post">
<default key="_controller">SoColissimo\Controller\Export::export</default>
</route>
<route id="socolissimo.import" path="/admin/module/socolissimo/import" methods="post">
<default key="_controller">SoColissimo:Import:import</default>
</route>
</routes>

View File

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<database defaultIdMethod="native" name="thelia" namespace="SoColissimo\Model">
<table name="address_socolissimo">
<column name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="title_id" required="true" type="INTEGER" />
<column name="company" size="255" type="VARCHAR" />
<column name="firstname" required="true" size="255" type="VARCHAR" />
<column name="lastname" required="true" size="255" type="VARCHAR" />
<column name="address1" required="true" size="255" type="VARCHAR" />
<column name="address2" required="true" size="255" type="VARCHAR" />
<column name="address3" required="true" size="255" type="VARCHAR" />
<column name="zipcode" required="true" size="10" type="VARCHAR" />
<column name="city" required="true" size="255" type="VARCHAR" />
<column name="country_id" required="true" type="INTEGER" />
<column name="code" required="true" size="10" type="VARCHAR" />
<column name="type" required="true" size="10" type="VARCHAR" />
<column name="cellphone" required="false" size="20" type="VARCHAR" />
<foreign-key foreignTable="customer_title" name="fk_address_socolissimo_customer_title_id" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference foreign="id" local="title_id" />
</foreign-key>
<foreign-key foreignTable="country" name="fk_address_socolissimo_country_id" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference foreign="id" local="country_id" />
</foreign-key>
</table>
<table name="order_address_socolissimo">
<column name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="code" size="10" type="VARCHAR" required="true" />
<column name="type" size="10" type="VARCHAR" required="true" />
<foreign-key foreignTable="order_address" name="fk_order_address_socolissimo_order_address_id" onDelete="CASCADE" onUpdate="CASCADE">
<reference foreign="id" local="id" />
</foreign-key>
</table>
<table name="socolissimo_delivery_mode">
<column name="id" primaryKey="true" autoIncrement="true" required="true" type="INTEGER" />
<column name="title" size="255" type="VARCHAR"/>
<column name="code" size="55" type="VARCHAR" required="true"/>
<column name="freeshipping_active" type="BOOLEAN"/>
<column name="freeshipping_from" type="FLOAT"/>
</table>
<table name="socolissimo_price">
<column name="id" primaryKey="true" autoIncrement="true" required="true" type="INTEGER" />
<column name="area_id" required="true" type="INTEGER" />
<column name="delivery_mode_id" required="true" type="INTEGER" />
<column name="weight_max" type="FLOAT" />
<column name="price_max" type="FLOAT" />
<column name="franco_min_price" type="FLOAT" />
<column name="price" required="true" type="FLOAT" />
<foreign-key foreignTable="area" name="fk_socolissimo_price_area_id" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference foreign="id" local="area_id" />
</foreign-key>
<foreign-key foreignTable="socolissimo_delivery_mode" name="fk_socolissimo_price_delivery_mode_id" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference foreign="id" local="delivery_mode_id" />
</foreign-key>
</table>
<table name="socolissimo_area_freeshipping_dom">
<column name="id" primaryKey="true" autoIncrement="true" required="true" type="INTEGER" />
<column name="area_id" required="true" type="INTEGER" />
<column name="delivery_mode_id" required="true" type="INTEGER" />
<column name="cart_amount" defaultValue="0.000000" scale="6" size="16" type="DECIMAL" />
<foreign-key foreignTable="area" name="fk_socolissimo_area_freeshipping_dom_area_id" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference foreign="id" local="area_id" />
</foreign-key>
<foreign-key foreignTable="socolissimo_delivery_mode" name="fk_socolissimo_area_freeshipping_dom_delivery_mode_id" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference foreign="id" local="delivery_mode_id" />
</foreign-key>
</table>
<table name="socolissimo_area_freeshipping_pr">
<column name="id" primaryKey="true" autoIncrement="true" required="true" type="INTEGER" />
<column name="area_id" required="true" type="INTEGER" />
<column name="delivery_mode_id" required="true" type="INTEGER" />
<column name="cart_amount" defaultValue="0.000000" scale="6" size="16" type="DECIMAL" />
<foreign-key foreignTable="area" name="fk_socolissimo_area_freeshipping_pr_area_id" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference foreign="id" local="area_id" />
</foreign-key>
<foreign-key foreignTable="socolissimo_delivery_mode" name="fk_socolissimo_area_freeshipping_pr_delivery_mode_id" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference foreign="id" local="delivery_mode_id" />
</foreign-key>
</table>
<external-schema filename="local/config/schema.xml" referenceOnly="true" />
</database>

View File

@@ -0,0 +1,163 @@
# This is a fix for InnoDB in MySQL >= 4.1.x
# It "suspends judgement" for fkey relationships until are tables are set.
SET FOREIGN_KEY_CHECKS = 0;
-- ---------------------------------------------------------------------
-- address_socolissimo
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `address_socolissimo`;
CREATE TABLE `address_socolissimo`
(
`id` INTEGER NOT NULL,
`title_id` INTEGER NOT NULL,
`company` VARCHAR(255),
`firstname` VARCHAR(255) NOT NULL,
`lastname` VARCHAR(255) NOT NULL,
`address1` VARCHAR(255) NOT NULL,
`address2` VARCHAR(255) NOT NULL,
`address3` VARCHAR(255) NOT NULL,
`zipcode` VARCHAR(10) NOT NULL,
`city` VARCHAR(255) NOT NULL,
`country_id` INTEGER NOT NULL,
`code` VARCHAR(10) NOT NULL,
`type` VARCHAR(10) NOT NULL,
`cellphone` VARCHAR(20),
PRIMARY KEY (`id`),
INDEX `FI_address_socolissimo_customer_title_id` (`title_id`),
INDEX `FI_address_socolissimo_country_id` (`country_id`),
CONSTRAINT `fk_address_socolissimo_customer_title_id`
FOREIGN KEY (`title_id`)
REFERENCES `customer_title` (`id`)
ON UPDATE RESTRICT
ON DELETE RESTRICT,
CONSTRAINT `fk_address_socolissimo_country_id`
FOREIGN KEY (`country_id`)
REFERENCES `country` (`id`)
ON UPDATE RESTRICT
ON DELETE RESTRICT
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
-- order_address_socolissimo
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `order_address_socolissimo`;
CREATE TABLE `order_address_socolissimo`
(
`id` INTEGER NOT NULL,
`code` VARCHAR(10) NOT NULL,
`type` VARCHAR(10) NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `fk_order_address_socolissimo_order_address_id`
FOREIGN KEY (`id`)
REFERENCES `order_address` (`id`)
ON UPDATE CASCADE
ON DELETE CASCADE
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
-- socolissimo_delivery_mode
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `socolissimo_delivery_mode`;
CREATE TABLE `socolissimo_delivery_mode`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`title` VARCHAR(255),
`code` VARCHAR(55) NOT NULL,
`freeshipping_active` TINYINT(1),
`freeshipping_from` FLOAT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
-- socolissimo_price
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `socolissimo_price`;
CREATE TABLE `socolissimo_price`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`area_id` INTEGER NOT NULL,
`delivery_mode_id` INTEGER NOT NULL,
`weight_max` FLOAT,
`price_max` FLOAT,
`franco_min_price` FLOAT,
`price` FLOAT NOT NULL,
PRIMARY KEY (`id`),
INDEX `FI_socolissimo_price_area_id` (`area_id`),
INDEX `FI_socolissimo_price_delivery_mode_id` (`delivery_mode_id`),
CONSTRAINT `fk_socolissimo_price_area_id`
FOREIGN KEY (`area_id`)
REFERENCES `area` (`id`)
ON UPDATE RESTRICT
ON DELETE RESTRICT,
CONSTRAINT `fk_socolissimo_price_delivery_mode_id`
FOREIGN KEY (`delivery_mode_id`)
REFERENCES `socolissimo_delivery_mode` (`id`)
ON UPDATE RESTRICT
ON DELETE RESTRICT
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
-- socolissimo_area_freeshipping_dom
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `socolissimo_area_freeshipping_dom`;
CREATE TABLE `socolissimo_area_freeshipping_dom`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`area_id` INTEGER NOT NULL,
`delivery_mode_id` INTEGER NOT NULL,
`cart_amount` DECIMAL(16,6) DEFAULT 0.000000,
PRIMARY KEY (`id`),
INDEX `FI_socolissimo_area_freeshipping_dom_area_id` (`area_id`),
INDEX `FI_socolissimo_area_freeshipping_dom_delivery_mode_id` (`delivery_mode_id`),
CONSTRAINT `fk_socolissimo_area_freeshipping_dom_area_id`
FOREIGN KEY (`area_id`)
REFERENCES `area` (`id`)
ON UPDATE RESTRICT
ON DELETE RESTRICT,
CONSTRAINT `fk_socolissimo_area_freeshipping_dom_delivery_mode_id`
FOREIGN KEY (`delivery_mode_id`)
REFERENCES `socolissimo_delivery_mode` (`id`)
ON UPDATE RESTRICT
ON DELETE RESTRICT
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
-- socolissimo_area_freeshipping_pr
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `socolissimo_area_freeshipping_pr`;
CREATE TABLE `socolissimo_area_freeshipping_pr`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`area_id` INTEGER NOT NULL,
`delivery_mode_id` INTEGER NOT NULL,
`cart_amount` DECIMAL(16,6) DEFAULT 0.000000,
PRIMARY KEY (`id`),
INDEX `FI_socolissimo_area_freeshipping_pr_area_id` (`area_id`),
INDEX `FI_socolissimo_area_freeshipping_pr_delivery_mode_id` (`delivery_mode_id`),
CONSTRAINT `fk_socolissimo_area_freeshipping_pr_area_id`
FOREIGN KEY (`area_id`)
REFERENCES `area` (`id`)
ON UPDATE RESTRICT
ON DELETE RESTRICT,
CONSTRAINT `fk_socolissimo_area_freeshipping_pr_delivery_mode_id`
FOREIGN KEY (`delivery_mode_id`)
REFERENCES `socolissimo_delivery_mode` (`id`)
ON UPDATE RESTRICT
ON DELETE RESTRICT
) ENGINE=InnoDB;
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -0,0 +1,2 @@
ALTER TABLE `socolissimo_price`
ADD COLUMN `franco_min_price` FLOAT AFTER `weight_max`;

View File

@@ -0,0 +1,2 @@
ALTER TABLE `socolissimo_price` ADD COLUMN `price_max` FLOAT AFTER `weight_max`;
ALTER TABLE `socolissimo_price` MODIFY `weight_max` FLOAT NULL DEFAULT NULL;

View File

@@ -0,0 +1,56 @@
SET FOREIGN_KEY_CHECKS = 0;
-- ---------------------------------------------------------------------
-- socolissimo_area_freeshipping_dom
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `socolissimo_area_freeshipping_dom`;
CREATE TABLE `socolissimo_area_freeshipping_dom`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`area_id` INTEGER NOT NULL,
`delivery_mode_id` INTEGER NOT NULL,
`cart_amount` DECIMAL(16,6) DEFAULT 0.000000 NOT NULL,
PRIMARY KEY (`id`),
INDEX `FI_socolissimo_area_freeshipping_dom_area_id` (`area_id`),
INDEX `FI_socolissimo_area_freeshipping_dom_delivery_mode_id` (`delivery_mode_id`),
CONSTRAINT `fk_socolissimo_area_freeshipping_dom_area_id`
FOREIGN KEY (`area_id`)
REFERENCES `area` (`id`)
ON UPDATE RESTRICT
ON DELETE RESTRICT,
CONSTRAINT `fk_socolissimo_area_freeshipping_dom_delivery_mode_id`
FOREIGN KEY (`delivery_mode_id`)
REFERENCES `socolissimo_delivery_mode` (`id`)
ON UPDATE RESTRICT
ON DELETE RESTRICT
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
-- socolissimo_area_freeshipping_pr
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `socolissimo_area_freeshipping_pr`;
CREATE TABLE `socolissimo_area_freeshipping_pr`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`area_id` INTEGER NOT NULL,
`delivery_mode_id` INTEGER NOT NULL,
`cart_amount` DECIMAL(16,6) DEFAULT 0.000000 NOT NULL,
PRIMARY KEY (`id`),
INDEX `FI_socolissimo_area_freeshipping_pr_area_id` (`area_id`),
INDEX `FI_socolissimo_area_freeshipping_pr_delivery_mode_id` (`delivery_mode_id`),
CONSTRAINT `fk_socolissimo_area_freeshipping_pr_area_id`
FOREIGN KEY (`area_id`)
REFERENCES `area` (`id`)
ON UPDATE RESTRICT
ON DELETE RESTRICT,
CONSTRAINT `fk_socolissimo_area_freeshipping_pr_delivery_mode_id`
FOREIGN KEY (`delivery_mode_id`)
REFERENCES `socolissimo_delivery_mode` (`id`)
ON UPDATE RESTRICT
ON DELETE RESTRICT
) ENGINE=InnoDB;
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -0,0 +1,2 @@
ALTER TABLE `socolissimo_area_freeshipping_dom` MODIFY `cart_amount` DECIMAL(16,6) DEFAULT 0.000000 NULL;
ALTER TABLE `socolissimo_area_freeshipping_pr` MODIFY `cart_amount` DECIMAL(16,6) DEFAULT 0.000000 NULL;