Module "DeliveryModulesInFooter" : on avance

This commit is contained in:
2021-09-06 15:07:41 +02:00
parent b4d0169996
commit c7e6fbe6a8
13 changed files with 72 additions and 287 deletions

View File

@@ -4,47 +4,11 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> xsi:schemaLocation="http://thelia.net/schema/dic/config http://thelia.net/schema/dic/config/thelia-1.0.xsd">
<loops>
<!-- sample definition
<loop name="MySuperLoop" class="DeliveryModulesInFooter\Loop\MySuperLoop" />
-->
</loops>
<forms>
<!--
<form name="MyFormName" class="DeliveryModulesInFooter\Form\MySuperForm" />
-->
</forms>
<commands>
<!--
<command class="DeliveryModulesInFooter\Command\MySuperCommand" />
-->
</commands>
<!--
<services>
</services>
-->
<!--
<hooks> <hooks>
<hook id="deliverymodulesinfooter.hook" class="DeliveryModulesInFooter\Hook\MySuperHook"> <hook id="deliverymodulesinfooter.hook" class="DeliveryModulesInFooter\Hook\FrontHook">
<tag name="hook.event_listener" event="main.body.bottom" type="front|back|pdf|email" method="onMainBodyBottom" /> <tag name="hook.event_listener" event="main.stylesheet" templates="css:assets/style.css" />
<tag name="hook.event_listener" event="main.footer-body" />
</hook> </hook>
</hooks> </hooks>
-->
<!--
<exports>
</exports>
-->
<!--
<imports>
</imports>
-->
</config> </config>

View File

@@ -1,50 +0,0 @@
<?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>
<!-- sample definition
<loop name="MySuperLoop" class="DeliveryModulesInFooter\Loop\MySuperLoop" />
-->
</loops>
<forms>
<!--
<form name="MyFormName" class="DeliveryModulesInFooter\Form\MySuperForm" />
-->
</forms>
<commands>
<!--
<command class="DeliveryModulesInFooter\Command\MySuperCommand" />
-->
</commands>
<!--
<services>
</services>
-->
<!--
<hooks>
<hook id="deliverymodulesinfooter.hook" class="DeliveryModulesInFooter\Hook\MySuperHook">
<tag name="hook.event_listener" event="main.body.bottom" type="front|back|pdf|email" method="onMainBodyBottom" />
</hook>
</hooks>
-->
<!--
<exports>
</exports>
-->
<!--
<imports>
</imports>
-->
</config>

View File

@@ -1,50 +0,0 @@
<?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>
<!-- sample definition
<loop name="MySuperLoop" class="DeliveryModulesInFooter\Loop\MySuperLoop" />
-->
</loops>
<forms>
<!--
<form name="MyFormName" class="DeliveryModulesInFooter\Form\MySuperForm" />
-->
</forms>
<commands>
<!--
<command class="DeliveryModulesInFooter\Command\MySuperCommand" />
-->
</commands>
<!--
<services>
</services>
-->
<!--
<hooks>
<hook id="deliverymodulesinfooter.hook" class="DeliveryModulesInFooter\Hook\MySuperHook">
<tag name="hook.event_listener" event="main.body.bottom" type="front|back|pdf|email" method="onMainBodyBottom" />
</hook>
</hooks>
-->
<!--
<exports>
</exports>
-->
<!--
<imports>
</imports>
-->
</config>

View File

@@ -1,50 +0,0 @@
<?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>
<!-- sample definition
<loop name="MySuperLoop" class="DeliveryModulesInFooter\Loop\MySuperLoop" />
-->
</loops>
<forms>
<!--
<form name="MyFormName" class="DeliveryModulesInFooter\Form\MySuperForm" />
-->
</forms>
<commands>
<!--
<command class="DeliveryModulesInFooter\Command\MySuperCommand" />
-->
</commands>
<!--
<services>
</services>
-->
<!--
<hooks>
<hook id="deliverymodulesinfooter.hook" class="DeliveryModulesInFooter\Hook\MySuperHook">
<tag name="hook.event_listener" event="main.body.bottom" type="front|back|pdf|email" method="onMainBodyBottom" />
</hook>
</hooks>
-->
<!--
<exports>
</exports>
-->
<!--
<imports>
</imports>
-->
</config>

View File

@@ -4,39 +4,24 @@
xsi:schemaLocation="http://thelia.net/schema/dic/module http://thelia.net/schema/dic/module/module-2_2.xsd"> xsi:schemaLocation="http://thelia.net/schema/dic/module http://thelia.net/schema/dic/module/module-2_2.xsd">
<fullnamespace>DeliveryModulesInFooter\DeliveryModulesInFooter</fullnamespace> <fullnamespace>DeliveryModulesInFooter\DeliveryModulesInFooter</fullnamespace>
<descriptive locale="en_US"> <descriptive locale="en_US">
<title>Automatically generated module - please update module.xml file</title> <title>Displays delivery modes in footer</title>
<!--
<subtitle></subtitle>
<description></description>
<postscriptum></postscriptum>
-->
</descriptive> </descriptive>
<descriptive locale="fr_FR"> <descriptive locale="fr_FR">
<title>Module généré automatiquement - éditez le fichier module.xml</title> <title>Affiche les modes de livraison actifs dans le footer du site</title>
</descriptive> </descriptive>
<!-- <logo></logo> -->
<!--<images-folder>images</images-folder>-->
<languages> <languages>
<language>en_US</language> <language>en_US</language>
<language>fr_FR</language> <language>fr_FR</language>
</languages> </languages>
<version></version> <version>1.0.0</version>
<authors> <authors>
<author> <author>
<name></name> <name>Laurent LE CORRE</name>
<email></email> <email>laurent@thecoredev.fr</email>
</author> </author>
</authors> </authors>
<type>classic</type> <type>classic</type>
<!-- <thelia>2.3.0</thelia>
module dependencies
<required>
<module version="&gt;=0.1">Front</module>
<module version="~1.0">HookCart</module>
<module version="&gt;0.2">HookSearch</module>
</required>
-->
<thelia>2.2.0</thelia>
<stability>other</stability> <stability>other</stability>
<mandatory>0</mandatory> <mandatory>0</mandatory>
<hidden>0</hidden> <hidden>0</hidden>

View File

@@ -1,31 +0,0 @@
<?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">
<!--
if a /admin/module/deliverymodulesinfooter/ route is provided, a "Configuration" button will be displayed
for the module in the module list. Clicking this button will invoke this route.
<route id="my_route_id" path="/admin/module/deliverymodulesinfooter">
<default key="_controller">DeliveryModulesInFooter\Full\Class\Name\Of\YourConfigurationController::methodName</default>
</route>
<route id="my_route_id" path="/admin/module/deliverymodulesinfooter/route-name">
<default key="_controller">DeliveryModulesInFooter\Full\Class\Name\Of\YourAdminController::methodName</default>
</route>
<route id="my_route_id" path="/my/route/name">
<default key="_controller">DeliveryModulesInFooter\Full\Class\Name\Of\YourOtherController::methodName</default>
</route>
...add as many routes as required.
<route>
...
</route>
-->
</routes>

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<database defaultIdMethod="native" name="thelia"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../core/vendor/propel/propel/resources/xsd/database.xsd" >
<!--
See propel documentation on http://propelorm.org for all information about schema file
<table name="product_rel" namespace="DeliveryModulesInFooter\Model">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column defaultValue="0" name="visible" required="true" type="TINYINT" />
<column defaultValue="0" name="position" required="true" type="INTEGER" />
<column name="title" size="255" type="VARCHAR" />
<column name="description" type="CLOB" />
<column name="chapo" type="LONGVARCHAR" />
<column name="postscriptum" type="LONGVARCHAR" />
<foreign-key foreignTable="product" name="fk_product_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="product_id" />
</foreign-key>
<behavior name="timestampable" />
<behavior name="i18n">
<parameter name="i18n_columns" value="title, description, chapo, postscriptum" />
</behavior>
<behavior name="versionable">
<parameter name="log_created_at" value="true" />
<parameter name="log_created_by" value="true" />
</behavior>
</table>
-->
<external-schema filename="local/config/schema.xml" referenceOnly="true" />
</database>

View File

@@ -1,14 +1,4 @@
<?php <?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 DeliveryModulesInFooter; namespace DeliveryModulesInFooter;

View File

@@ -0,0 +1,28 @@
<?php
namespace DeliveryModulesInFooter\Hook;
use Thelia\Core\Event\Hook\HookRenderBlockEvent;
use Thelia\Core\Hook\BaseHook;
/**
* Class FrontHook
* @package DeliveryModulesInFooter\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" => "delivery-modules-footer-body",
"title" => $this->trans("Our delivery modes", array(), "deliverymodulesinfooter"),
"content" => $content
)
);
}
}
}

View File

@@ -1,4 +1,5 @@
<?php <?php
return array(
// 'an english string' => 'The displayed english string', return [
); 'Our delivery modes' => 'Our delivery modes',
];

View File

@@ -1,4 +1,5 @@
<?php <?php
return array(
// 'an english string' => 'La traduction française de la chaine', return [
); 'Our delivery modes' => 'Nos modes de livraison',
];

View File

@@ -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;
}

View File

@@ -0,0 +1,15 @@
<section id="our-delivery-modes">
<div id="delivery-modes">
<ul class="dmif-list row">
{loop type="module" active="yes" module_type="2" name="delivery_list"}
{loop type="image" name="delivery_image" source="module" source_id={$ID}}
<li class="item logo-module 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>