From c7e6fbe6a89ce7f37b535c48cad9993a8f34deb9 Mon Sep 17 00:00:00 2001 From: TheCoreDev Date: Mon, 6 Sep 2021 15:07:41 +0200 Subject: [PATCH] Module "DeliveryModulesInFooter" : on avance --- .../DeliveryModulesInFooter/Config/config.xml | 42 ++-------------- .../Config/config_dev.xml | 50 ------------------- .../Config/config_prod.xml | 50 ------------------- .../Config/config_test.xml | 50 ------------------- .../DeliveryModulesInFooter/Config/module.xml | 27 +++------- .../Config/routing.xml | 31 ------------ .../DeliveryModulesInFooter/Config/schema.xml | 30 ----------- .../DeliveryModulesInFooter.php | 10 ---- .../Hook/FrontHook.php | 28 +++++++++++ .../DeliveryModulesInFooter/I18n/en_US.php | 7 +-- .../DeliveryModulesInFooter/I18n/fr_FR.php | 7 +-- .../frontOffice/default/assets/style.css | 12 +++++ .../templates/frontOffice/default/footer.html | 15 ++++++ 13 files changed, 72 insertions(+), 287 deletions(-) delete mode 100644 local/modules/DeliveryModulesInFooter/Config/config_dev.xml delete mode 100644 local/modules/DeliveryModulesInFooter/Config/config_prod.xml delete mode 100644 local/modules/DeliveryModulesInFooter/Config/config_test.xml delete mode 100644 local/modules/DeliveryModulesInFooter/Config/routing.xml delete mode 100644 local/modules/DeliveryModulesInFooter/Config/schema.xml create mode 100644 local/modules/DeliveryModulesInFooter/Hook/FrontHook.php create mode 100644 local/modules/DeliveryModulesInFooter/templates/frontOffice/default/assets/style.css create mode 100644 local/modules/DeliveryModulesInFooter/templates/frontOffice/default/footer.html diff --git a/local/modules/DeliveryModulesInFooter/Config/config.xml b/local/modules/DeliveryModulesInFooter/Config/config.xml index fae3bc43..f4509166 100644 --- a/local/modules/DeliveryModulesInFooter/Config/config.xml +++ b/local/modules/DeliveryModulesInFooter/Config/config.xml @@ -4,47 +4,11 @@ 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"> - - - - - - - - - - - - - - - - - - diff --git a/local/modules/DeliveryModulesInFooter/Config/config_dev.xml b/local/modules/DeliveryModulesInFooter/Config/config_dev.xml deleted file mode 100644 index fae3bc43..00000000 --- a/local/modules/DeliveryModulesInFooter/Config/config_dev.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/local/modules/DeliveryModulesInFooter/Config/config_prod.xml b/local/modules/DeliveryModulesInFooter/Config/config_prod.xml deleted file mode 100644 index fae3bc43..00000000 --- a/local/modules/DeliveryModulesInFooter/Config/config_prod.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/local/modules/DeliveryModulesInFooter/Config/config_test.xml b/local/modules/DeliveryModulesInFooter/Config/config_test.xml deleted file mode 100644 index fae3bc43..00000000 --- a/local/modules/DeliveryModulesInFooter/Config/config_test.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/local/modules/DeliveryModulesInFooter/Config/module.xml b/local/modules/DeliveryModulesInFooter/Config/module.xml index 523b42c5..e2f6e8da 100644 --- a/local/modules/DeliveryModulesInFooter/Config/module.xml +++ b/local/modules/DeliveryModulesInFooter/Config/module.xml @@ -4,39 +4,24 @@ xsi:schemaLocation="http://thelia.net/schema/dic/module http://thelia.net/schema/dic/module/module-2_2.xsd"> DeliveryModulesInFooter\DeliveryModulesInFooter - Automatically generated module - please update module.xml file - + Displays delivery modes in footer - Module généré automatiquement - éditez le fichier module.xml + Affiche les modes de livraison actifs dans le footer du site - - en_US fr_FR - + 1.0.0 - - + Laurent LE CORRE + laurent@thecoredev.fr classic - - 2.2.0 + 2.3.0 other 0 0 diff --git a/local/modules/DeliveryModulesInFooter/Config/routing.xml b/local/modules/DeliveryModulesInFooter/Config/routing.xml deleted file mode 100644 index c67564ce..00000000 --- a/local/modules/DeliveryModulesInFooter/Config/routing.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - diff --git a/local/modules/DeliveryModulesInFooter/Config/schema.xml b/local/modules/DeliveryModulesInFooter/Config/schema.xml deleted file mode 100644 index c6378571..00000000 --- a/local/modules/DeliveryModulesInFooter/Config/schema.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - diff --git a/local/modules/DeliveryModulesInFooter/DeliveryModulesInFooter.php b/local/modules/DeliveryModulesInFooter/DeliveryModulesInFooter.php index 009836df..c2fac81f 100644 --- a/local/modules/DeliveryModulesInFooter/DeliveryModulesInFooter.php +++ b/local/modules/DeliveryModulesInFooter/DeliveryModulesInFooter.php @@ -1,14 +1,4 @@ + */ +class FrontHook extends BaseHook +{ + public function onMainFooterBody(HookRenderBlockEvent $event) + { + $content = trim($this->render("footer.html")); + if ("" != $content) { + $event->add( + array( + "id" => "delivery-modules-footer-body", + "title" => $this->trans("Our delivery modes", array(), "deliverymodulesinfooter"), + "content" => $content + ) + ); + } + } +} diff --git a/local/modules/DeliveryModulesInFooter/I18n/en_US.php b/local/modules/DeliveryModulesInFooter/I18n/en_US.php index 0b4fa142..88a8be68 100644 --- a/local/modules/DeliveryModulesInFooter/I18n/en_US.php +++ b/local/modules/DeliveryModulesInFooter/I18n/en_US.php @@ -1,4 +1,5 @@ 'The displayed english string', -); + +return [ + 'Our delivery modes' => 'Our delivery modes', +]; diff --git a/local/modules/DeliveryModulesInFooter/I18n/fr_FR.php b/local/modules/DeliveryModulesInFooter/I18n/fr_FR.php index 37086245..ae8c1717 100644 --- a/local/modules/DeliveryModulesInFooter/I18n/fr_FR.php +++ b/local/modules/DeliveryModulesInFooter/I18n/fr_FR.php @@ -1,4 +1,5 @@ 'La traduction française de la chaine', -); + +return [ + 'Our delivery modes' => 'Nos modes de livraison', +]; diff --git a/local/modules/DeliveryModulesInFooter/templates/frontOffice/default/assets/style.css b/local/modules/DeliveryModulesInFooter/templates/frontOffice/default/assets/style.css new file mode 100644 index 00000000..cf2b6e8c --- /dev/null +++ b/local/modules/DeliveryModulesInFooter/templates/frontOffice/default/assets/style.css @@ -0,0 +1,12 @@ + +#delivery-modes { + display: flex; + justify-content: space-between; + align-items: center; + flex-wrap: wrap; + margin-bottom: 5px; +} + +#delivery-modes .item { + margin: 10px 0; +} \ No newline at end of file diff --git a/local/modules/DeliveryModulesInFooter/templates/frontOffice/default/footer.html b/local/modules/DeliveryModulesInFooter/templates/frontOffice/default/footer.html new file mode 100644 index 00000000..c5de5570 --- /dev/null +++ b/local/modules/DeliveryModulesInFooter/templates/frontOffice/default/footer.html @@ -0,0 +1,15 @@ +
+
+
    + {loop type="module" active="yes" module_type="2" name="delivery_list"} + {loop type="image" name="delivery_image" source="module" source_id={$ID}} +
  • +
    + {$TITLE} +
    +
  • + {/loop} + {/loop} +
+
+
\ No newline at end of file