Initial Commit
This commit is contained in:
33
local/modules/DigressivePrice/Config/config.xml
Normal file
33
local/modules/DigressivePrice/Config/config.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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 name="digressive" class="DigressivePrice\Loop\DigressiveLoop" />
|
||||
</loops>
|
||||
|
||||
<forms>
|
||||
<form name="digressiveprice.create" class="DigressivePrice\Form\CreateDigressivePriceForm" />
|
||||
<form name="digressiveprice.update" class="DigressivePrice\Form\UpdateDigressivePriceForm" />
|
||||
<form name="digressiveprice.delete" class="DigressivePrice\Form\DeleteDigressivePriceForm" />
|
||||
</forms>
|
||||
|
||||
<hooks>
|
||||
<hook id="digressiveprice.hook" class="DigressivePrice\Hook\DigressivePriceHook">
|
||||
<tag name="hook.event_listener" event="product.tab" type="back" method="onProductTab"/>
|
||||
|
||||
<tag name="hook.event_listener" event="product.details-bottom" type="front" method="onProductDetailsBottom"/>
|
||||
<tag name="hook.event_listener" event="product.javascript-initialization" type="front" method="onProductJavascriptInitialization"/>
|
||||
<tag name="hook.event_listener" event="category.javascript-initialization" type="front" method="onProductJavascriptInitialization"/>
|
||||
</hook>
|
||||
</hooks>
|
||||
|
||||
<services>
|
||||
<service id="digressiveprice.listener" class="DigressivePrice\Listener\DigressivePriceListener">
|
||||
<argument type="service" id="request_stack"/>
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
</services>
|
||||
</config>
|
||||
25
local/modules/DigressivePrice/Config/create.sql
Normal file
25
local/modules/DigressivePrice/Config/create.sql
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
# 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;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- digressive_price
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `digressive_price`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`product_id` INTEGER NOT NULL,
|
||||
`discount` FLOAT NOT NULL,
|
||||
`quantity_from` INTEGER NOT NULL,
|
||||
`quantity_to` INTEGER NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FI_product_digressive` (`product_id`),
|
||||
CONSTRAINT `fk_product_digressive`
|
||||
FOREIGN KEY (`product_id`)
|
||||
REFERENCES `product` (`id`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
# This restores the fkey checks, after having unset them earlier
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
13
local/modules/DigressivePrice/Config/delete.sql
Normal file
13
local/modules/DigressivePrice/Config/delete.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
# This is a fix for InnoDB in MySQL >= 4.1.x
|
||||
# It "suspends judgement" for fkey relationships until tables are set.
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- digressive_price
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `digressive_price`;
|
||||
|
||||
# This restores the fkey checks, after having unset them earlier
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
18
local/modules/DigressivePrice/Config/module.xml
Normal file
18
local/modules/DigressivePrice/Config/module.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module>
|
||||
<fullnamespace>DigressivePrice\DigressivePrice</fullnamespace>
|
||||
<descriptive locale="en_US">
|
||||
<title>Digressive price</title>
|
||||
</descriptive>
|
||||
<descriptive locale="fr_FR">
|
||||
<title>Prix dégressif</title>
|
||||
</descriptive>
|
||||
<version>2.0</version>
|
||||
<author>
|
||||
<name>Etienne PERRIERE - Nexxpix - OpenStudio</name>
|
||||
<email>eperriere@openstudio.fr</email>
|
||||
</author>
|
||||
<type>classic</type>
|
||||
<thelia>2.1.0</thelia>
|
||||
<stability>other</stability>
|
||||
</module>
|
||||
23
local/modules/DigressivePrice/Config/routing.xml
Normal file
23
local/modules/DigressivePrice/Config/routing.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?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="DigressivePrice.create" path="/admin/module/DigressivePrice/create">
|
||||
<default key="_controller">DigressivePrice\Controller\DigressivePriceController::createAction</default>
|
||||
</route>
|
||||
|
||||
<route id="DigressivePrice.update" path="/admin/module/DigressivePrice/update">
|
||||
<default key="_controller">DigressivePrice\Controller\DigressivePriceController::updateAction</default>
|
||||
</route>
|
||||
|
||||
<route id="DigressivePrice.delete" path="/admin/module/DigressivePrice/delete">
|
||||
<default key="_controller">DigressivePrice\Controller\DigressivePriceController::deleteAction</default>
|
||||
</route>
|
||||
|
||||
<route id="DigressivePrice.front.updateTable" path="/digressive-price/table/{pseId}">
|
||||
<default key="_controller">DigressivePrice\Controller\DigressivePriceFrontController::updateTableAction</default>
|
||||
<requirement key="pseId">\d+</requirement>
|
||||
</route>
|
||||
</routes>
|
||||
14
local/modules/DigressivePrice/Config/schema.xml
Normal file
14
local/modules/DigressivePrice/Config/schema.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<database defaultIdMethod="native" name="thelia" namespace="DigressivePrice\Model">
|
||||
<table name="digressive_price">
|
||||
<column name="id" autoIncrement="true" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="product_id" required="true" type="INTEGER" />
|
||||
<column name="discount" required="true" type="FLOAT" />
|
||||
<column name="quantity_from" required="true" type="INTEGER" />
|
||||
<column name="quantity_to" required="true" type="INTEGER" />
|
||||
<foreign-key foreignTable="product" name="fk_product_digressive">
|
||||
<reference local="product_id" foreign="id"/>
|
||||
</foreign-key>
|
||||
</table>
|
||||
<external-schema filename="local/config/schema.xml" referenceOnly="true" />
|
||||
</database>
|
||||
Reference in New Issue
Block a user