From 20f52baa31db2aeccb5aa2f02c88669fdc27c651 Mon Sep 17 00:00:00 2001 From: TheCoreDev Date: Wed, 29 May 2024 17:04:15 +0200 Subject: [PATCH] =?UTF-8?q?[29/05/2024]=20Nouveau=20module=20pour=20affich?= =?UTF-8?q?er=20les=20modes=20de=20paiement=20accept=C3=A9s=20dans=20le=20?= =?UTF-8?q?footer=20du=20site?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontOffice/default/assets/style.css | 2 +- .../frontOffice/default/assets/style.css | 2 +- .../PaymentMethodsInFooter/Config/config.xml | 14 +++++ .../PaymentMethodsInFooter/Config/module.xml | 28 ++++++++++ .../PaymentMethodsInFooter/Hook/FrontHook.php | 28 ++++++++++ .../PaymentMethodsInFooter/I18n/en_US.php | 4 ++ .../PaymentMethodsInFooter/I18n/fr_FR.php | 4 ++ .../PaymentMethodsInFooter.php | 28 ++++++++++ .../modules/PaymentMethodsInFooter/Readme.md | 55 +++++++++++++++++++ .../PaymentMethodsInFooter/composer.json | 11 ++++ .../frontOffice/default/assets/style.css | 11 ++++ .../templates/frontOffice/default/footer.html | 15 +++++ templates/frontOffice/default2020/layout.tpl | 20 +++---- 13 files changed, 209 insertions(+), 13 deletions(-) create mode 100644 local/modules/PaymentMethodsInFooter/Config/config.xml create mode 100644 local/modules/PaymentMethodsInFooter/Config/module.xml create mode 100644 local/modules/PaymentMethodsInFooter/Hook/FrontHook.php create mode 100644 local/modules/PaymentMethodsInFooter/I18n/en_US.php create mode 100644 local/modules/PaymentMethodsInFooter/I18n/fr_FR.php create mode 100644 local/modules/PaymentMethodsInFooter/PaymentMethodsInFooter.php create mode 100644 local/modules/PaymentMethodsInFooter/Readme.md create mode 100644 local/modules/PaymentMethodsInFooter/composer.json create mode 100644 local/modules/PaymentMethodsInFooter/templates/frontOffice/default/assets/style.css create mode 100644 local/modules/PaymentMethodsInFooter/templates/frontOffice/default/footer.html diff --git a/local/modules/BrandsOnHome/templates/frontOffice/default/assets/style.css b/local/modules/BrandsOnHome/templates/frontOffice/default/assets/style.css index e412c70c..bd157675 100644 --- a/local/modules/BrandsOnHome/templates/frontOffice/default/assets/style.css +++ b/local/modules/BrandsOnHome/templates/frontOffice/default/assets/style.css @@ -29,4 +29,4 @@ .list .brands-content > ul .item > article .product-image { margin-bottom: 15px; padding: 0; -} +} \ No newline at end of file diff --git a/local/modules/DeliveryModulesInFooter/templates/frontOffice/default/assets/style.css b/local/modules/DeliveryModulesInFooter/templates/frontOffice/default/assets/style.css index 1aeda9de..99cac2de 100644 --- a/local/modules/DeliveryModulesInFooter/templates/frontOffice/default/assets/style.css +++ b/local/modules/DeliveryModulesInFooter/templates/frontOffice/default/assets/style.css @@ -6,6 +6,6 @@ justify-content: space-between; } #delivery-modes img { - width: 85px; + height: 50px; vertical-align: center; } \ No newline at end of file diff --git a/local/modules/PaymentMethodsInFooter/Config/config.xml b/local/modules/PaymentMethodsInFooter/Config/config.xml new file mode 100644 index 00000000..1a39bd02 --- /dev/null +++ b/local/modules/PaymentMethodsInFooter/Config/config.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/local/modules/PaymentMethodsInFooter/Config/module.xml b/local/modules/PaymentMethodsInFooter/Config/module.xml new file mode 100644 index 00000000..516e5d6d --- /dev/null +++ b/local/modules/PaymentMethodsInFooter/Config/module.xml @@ -0,0 +1,28 @@ + + + PaymentMethodsInFooter\PaymentMethodsInFooter + + Display payment methods allowed in footer of the site + + + Affiche les modes de paiement acceptés, dans le footer du site + + + en_US + fr_FR + + 1.0.0 + + + Laurent LE CORRE + laurent@thecoredev.fr + + + classic + 2.3.0 + other + 0 + 0 + diff --git a/local/modules/PaymentMethodsInFooter/Hook/FrontHook.php b/local/modules/PaymentMethodsInFooter/Hook/FrontHook.php new file mode 100644 index 00000000..c98b7af5 --- /dev/null +++ b/local/modules/PaymentMethodsInFooter/Hook/FrontHook.php @@ -0,0 +1,28 @@ + + */ +class FrontHook extends BaseHook +{ + public function onMainFooterBody(HookRenderBlockEvent $event) + { + $content = trim($this->render("footer.html")); + if ("" != $content) { + $event->add( + array( + "id" => "payment-methods-footer-body", + "title" => $this->trans("Our payment methods", array(), "paymentmethodsinfooter"), + "content" => $content + ) + ); + } + } +} diff --git a/local/modules/PaymentMethodsInFooter/I18n/en_US.php b/local/modules/PaymentMethodsInFooter/I18n/en_US.php new file mode 100644 index 00000000..ee2ff17a --- /dev/null +++ b/local/modules/PaymentMethodsInFooter/I18n/en_US.php @@ -0,0 +1,4 @@ + 'Our payment methods', +); diff --git a/local/modules/PaymentMethodsInFooter/I18n/fr_FR.php b/local/modules/PaymentMethodsInFooter/I18n/fr_FR.php new file mode 100644 index 00000000..0aec4af7 --- /dev/null +++ b/local/modules/PaymentMethodsInFooter/I18n/fr_FR.php @@ -0,0 +1,4 @@ + 'Nos moyens de paiement', +); diff --git a/local/modules/PaymentMethodsInFooter/PaymentMethodsInFooter.php b/local/modules/PaymentMethodsInFooter/PaymentMethodsInFooter.php new file mode 100644 index 00000000..be967efa --- /dev/null +++ b/local/modules/PaymentMethodsInFooter/PaymentMethodsInFooter.php @@ -0,0 +1,28 @@ +/local/modules/``` directory and be sure that the name of the module is PaymentMethodsInFooter. +* Activate it in your thelia administration panel + +### Composer + +Add it in your main thelia composer.json file + +``` +composer require your-vendor/payment-methods-in-footer-module:~1.0 +``` + +## Usage + +Explain here how to use your module, how to configure it, etc. + +## Hook + +If your module use one or more hook, fill this part. Explain which hooks are used. + + +## Loop + +If your module declare one or more loop, describe them here like this : + +[loop name] + +### Input arguments + +|Argument |Description | +|--- |--- | +|**arg1** | describe arg1 with an exemple. | +|**arg2** | describe arg2 with an exemple. | + +### Output arguments + +|Variable |Description | +|--- |--- | +|$VAR1 | describe $VAR1 variable | +|$VAR2 | describe $VAR2 variable | + +### Exemple + +Add a complete exemple of your loop + +## Other ? + +If you have other think to put, feel free to complete your readme as you want. diff --git a/local/modules/PaymentMethodsInFooter/composer.json b/local/modules/PaymentMethodsInFooter/composer.json new file mode 100644 index 00000000..d0f69a08 --- /dev/null +++ b/local/modules/PaymentMethodsInFooter/composer.json @@ -0,0 +1,11 @@ +{ + "name": "your-vendor/payment-methods-in-footer-module", + "license": "LGPL-3.0+", + "type": "thelia-module", + "require": { + "thelia/installer": "~1.1" + }, + "extra": { + "installer-name": "PaymentMethodsInFooter" + } +} \ No newline at end of file diff --git a/local/modules/PaymentMethodsInFooter/templates/frontOffice/default/assets/style.css b/local/modules/PaymentMethodsInFooter/templates/frontOffice/default/assets/style.css new file mode 100644 index 00000000..1e8fcd13 --- /dev/null +++ b/local/modules/PaymentMethodsInFooter/templates/frontOffice/default/assets/style.css @@ -0,0 +1,11 @@ + +#payment-methods ul { + width: 100%; + display: inline-flex; + align-items: center; + justify-content: space-between; +} +#payment-methods img { + height: 48px; + vertical-align: center; +} \ No newline at end of file diff --git a/local/modules/PaymentMethodsInFooter/templates/frontOffice/default/footer.html b/local/modules/PaymentMethodsInFooter/templates/frontOffice/default/footer.html new file mode 100644 index 00000000..d17b6f8f --- /dev/null +++ b/local/modules/PaymentMethodsInFooter/templates/frontOffice/default/footer.html @@ -0,0 +1,15 @@ +
+
+
    + {loop type="module" active="yes" module_type="3" name="payment_list" order="manual"} + {loop type="image" name="payment_image" source="module" source_id={$ID}} +
  • +
    + {$TITLE} +
    +
  • + {/loop} + {/loop} +
+
+
\ No newline at end of file diff --git a/templates/frontOffice/default2020/layout.tpl b/templates/frontOffice/default2020/layout.tpl index cee8fd69..43ef1daa 100644 --- a/templates/frontOffice/default2020/layout.tpl +++ b/templates/frontOffice/default2020/layout.tpl @@ -193,12 +193,11 @@ GNU General Public License : http://www.gnu.org/licenses/ @@ -227,7 +225,7 @@ GNU General Public License : http://www.gnu.org/licenses/
{hookblock name="main.footer-body" fields="id,class,title,content"} {forhook rel="main.footer-body"} -
+

{$title}