[29/05/2024]
Nouveau module pour afficher les modes de paiement acceptés dans le footer du site
This commit is contained in:
14
local/modules/PaymentMethodsInFooter/Config/config.xml
Normal file
14
local/modules/PaymentMethodsInFooter/Config/config.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?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">
|
||||
|
||||
<hooks>
|
||||
<hook id="paymentmethodsinfooter.hook" class="PaymentMethodsInFooter\Hook\FrontHook">
|
||||
<tag name="hook.event_listener" event="main.stylesheet" templates="css:assets/style.css" />
|
||||
<tag name="hook.event_listener" event="main.footer-body" />
|
||||
</hook>
|
||||
</hooks>
|
||||
|
||||
</config>
|
||||
28
local/modules/PaymentMethodsInFooter/Config/module.xml
Normal file
28
local/modules/PaymentMethodsInFooter/Config/module.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module xmlns="http://thelia.net/schema/dic/module"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://thelia.net/schema/dic/module http://thelia.net/schema/dic/module/module-2_2.xsd">
|
||||
<fullnamespace>PaymentMethodsInFooter\PaymentMethodsInFooter</fullnamespace>
|
||||
<descriptive locale="en_US">
|
||||
<title>Display payment methods allowed in footer of the site</title>
|
||||
</descriptive>
|
||||
<descriptive locale="fr_FR">
|
||||
<title>Affiche les modes de paiement acceptés, dans le footer du site</title>
|
||||
</descriptive>
|
||||
<languages>
|
||||
<language>en_US</language>
|
||||
<language>fr_FR</language>
|
||||
</languages>
|
||||
<version>1.0.0</version>
|
||||
<authors>
|
||||
<author>
|
||||
<name>Laurent LE CORRE</name>
|
||||
<email>laurent@thecoredev.fr</email>
|
||||
</author>
|
||||
</authors>
|
||||
<type>classic</type>
|
||||
<thelia>2.3.0</thelia>
|
||||
<stability>other</stability>
|
||||
<mandatory>0</mandatory>
|
||||
<hidden>0</hidden>
|
||||
</module>
|
||||
28
local/modules/PaymentMethodsInFooter/Hook/FrontHook.php
Normal file
28
local/modules/PaymentMethodsInFooter/Hook/FrontHook.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace PaymentMethodsInFooter\Hook;
|
||||
|
||||
use Thelia\Core\Event\Hook\HookRenderBlockEvent;
|
||||
use Thelia\Core\Hook\BaseHook;
|
||||
|
||||
/**
|
||||
* Class FrontHook
|
||||
* @package PaymentMethodsInFooter\Hook
|
||||
* @author Laurent LE CORRE <laurent@thecoredev.fr>
|
||||
*/
|
||||
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
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
4
local/modules/PaymentMethodsInFooter/I18n/en_US.php
Normal file
4
local/modules/PaymentMethodsInFooter/I18n/en_US.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
return array(
|
||||
'Our payment methods' => 'Our payment methods',
|
||||
);
|
||||
4
local/modules/PaymentMethodsInFooter/I18n/fr_FR.php
Normal file
4
local/modules/PaymentMethodsInFooter/I18n/fr_FR.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
return array(
|
||||
'Our payment methods' => 'Nos moyens de paiement',
|
||||
);
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* This file is part of the Thelia package. */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : dev@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* For the full copyright and license information, please view the LICENSE.txt */
|
||||
/* file that was distributed with this source code. */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace PaymentMethodsInFooter;
|
||||
|
||||
use Thelia\Module\BaseModule;
|
||||
|
||||
class PaymentMethodsInFooter extends BaseModule
|
||||
{
|
||||
/** @var string */
|
||||
const DOMAIN_NAME = 'paymentmethodsinfooter';
|
||||
|
||||
/*
|
||||
* You may now override BaseModuleInterface methods, such as:
|
||||
* install, destroy, preActivation, postActivation, preDeactivation, postDeactivation
|
||||
*
|
||||
* Have fun !
|
||||
*/
|
||||
}
|
||||
55
local/modules/PaymentMethodsInFooter/Readme.md
Normal file
55
local/modules/PaymentMethodsInFooter/Readme.md
Normal file
@@ -0,0 +1,55 @@
|
||||
# Payment Methods In Footer
|
||||
|
||||
Add a short description here. You can also add a screenshot if needed.
|
||||
|
||||
## Installation
|
||||
|
||||
### Manually
|
||||
|
||||
* Copy the module into ```<thelia_root>/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.
|
||||
11
local/modules/PaymentMethodsInFooter/composer.json
Normal file
11
local/modules/PaymentMethodsInFooter/composer.json
Normal file
@@ -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"
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<section id="our-payment-methods">
|
||||
<div id="payment-methods">
|
||||
<ul class="list-unstyled row">
|
||||
{loop type="module" active="yes" module_type="3" name="payment_list" order="manual"}
|
||||
{loop type="image" name="payment_image" source="module" source_id={$ID}}
|
||||
<li class="item col-xs-6 col-sm-4 col-md-2">
|
||||
<article class="row">
|
||||
<img src="{$IMAGE_URL}" alt="{$TITLE}" />
|
||||
</article>
|
||||
</li>
|
||||
{/loop}
|
||||
{/loop}
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
@@ -193,9 +193,8 @@ GNU General Public License : http://www.gnu.org/licenses/
|
||||
<!-- DEBUT CHOIX PAR COULEURS SUR PAGE D'ACCUEIL-->
|
||||
|
||||
<!--<div class="container">
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col-md-4" style="padding:0px">
|
||||
|
||||
{loop type="category" name="category.navigation" parent="188"}
|
||||
<div class="col-xs-3" style="text-align:center">
|
||||
<a href="{$URL}">
|
||||
@@ -211,7 +210,6 @@ GNU General Public License : http://www.gnu.org/licenses/
|
||||
{if {$LOOP_COUNT} == 8}
|
||||
</div><div class="col-md-4" style="padding:0px">
|
||||
{/if}
|
||||
|
||||
{/loop}
|
||||
</div>
|
||||
</div>
|
||||
@@ -227,7 +225,7 @@ GNU General Public License : http://www.gnu.org/licenses/
|
||||
<div class="blocks row">
|
||||
{hookblock name="main.footer-body" fields="id,class,title,content"}
|
||||
{forhook rel="main.footer-body"}
|
||||
<div class="col col-md-6">
|
||||
<div class="col col-md-4">
|
||||
<section {if $id} id="{$id}"{/if} class="block {if $class} block-{$class}{/if}">
|
||||
<div class="block-heading"><h3 class="block-title">{$title}</h3></div>
|
||||
<div class="block-content">
|
||||
|
||||
Reference in New Issue
Block a user