Init du module HookProduitsSaison

This commit is contained in:
2021-04-20 21:24:27 +02:00
parent 5d4ea5c2c3
commit 40d7dd94ac
8 changed files with 200 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
<?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="hookproduitssaison.hook.front">
<tag name="hook.event_listener" event="home.body" templates="render:home-body.html" />
</hook>
</hooks>
</config>

View 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>HookProduitsSaison\HookProduitsSaison</fullnamespace>
<descriptive locale="en_US">
<title>Hook used to display a selection of products</title>
</descriptive>
<descriptive locale="fr_FR">
<title>Hook permettant d'afficher une sélection des produits de saison</title>
</descriptive>
<languages>
<language>en_US</language>
<language>fr_FR</language>
</languages>
<version>1.0</version>
<authors>
<author>
<name>Laurent LE CORRE</name>
<email>laurent@thecoredev.fr</email>
</author>
</authors>
<type>classic</type>
<thelia>2.3.x</thelia>
<stability>alpha</stability>
<mandatory>0</mandatory>
<hidden>0</hidden>
</module>

View File

@@ -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 HookProduitsSaison;
use Thelia\Module\BaseModule;
class HookProduitsSaison extends BaseModule
{
/** @var string */
const DOMAIN_NAME = 'hookproduitssaison';
/*
* You may now override BaseModuleInterface methods, such as:
* install, destroy, preActivation, postActivation, preDeactivation, postDeactivation
*
* Have fun !
*/
}

View File

@@ -0,0 +1,4 @@
<?php
return array(
// 'an english string' => 'The displayed english string',
);

View File

@@ -0,0 +1,4 @@
<?php
return array(
// 'an english string' => 'La traduction française de la chaine',
);

View File

@@ -0,0 +1,55 @@
# Hook Produits Saison
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 HookProduitsSaison.
* Activate it in your thelia administration panel
### Composer
Add it in your main thelia composer.json file
```
composer require your-vendor/hook-produits-saison-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.

View File

@@ -0,0 +1,12 @@
{
"name": "your-vendor/hook-produits-saison-module",
"description": "HookProduitsSaison module for Thelia",
"license": "LGPL-3.0-or-later",
"type": "thelia-module",
"require": {
"thelia/installer": "~1.1"
},
"extra": {
"installer-name": "HookProduitsSaison"
}
}

View File

@@ -0,0 +1,56 @@
{ifloop rel="produits_saison"}
<section id="produits-saison">
<div class="products-heading">
<h2>{intl l="Our selection" d="hookproduitssaison"}</h2>
</div>
<div class="products-content">
<ul class="list-unstyled products-grid row">
{loop name="produits_saison" type="selection_container" code="fruits"}
<li class="item col-md-3 col-sm-4">
<article itemscope itemtype="http://schema.org/Product">
COUNT = {$SELECTION_COUNT}
{*
{loop type="image" name="selection_image" lang="$edit_language_id" source="selection" source_id=$SELECTION_CONTAINER_ID width="70" height="50" resize_mode="borders" limit="1" visible="true"}
<img class="img-thumbnail" src="{$IMAGE_URL nofilter}" href="">
{/loop}
*}
<!-- -->
<!-- <a href="{$URL}" itemprop="url" tabindex="-1" class="product-image overlay">-->
<!-- {ifloop rel="image_product_new" }-->
<!-- <img itemprop="image" class="img-responsive center-block"-->
<!-- {loop name="image_product_new" type="image" limit="1" product="{$ID}" force_return="true" width="280" height="196" resize_mode="borders"}-->
<!-- src="{$IMAGE_URL}"-->
<!-- {/loop}-->
<!-- alt="Product #{$LOOP_COUNT}" >-->
<!-- {/ifloop}-->
<!-- {elseloop rel="image_product_new"}-->
<!-- <img itemprop="image" class="img-responsive center-block" src="{image file='assets/dist/img/280x196.png'}" alt="Product #{$LOOP_COUNT}">-->
<!-- {/elseloop}-->
<!-- </a>-->
<!-- <a href="{$URL}" class="product-info">-->
<!-- <h3 class="name"><span itemprop="name">{$TITLE}</span></h3>-->
<!-- <div class="short-description" itemprop="description">{$CHAPO}</div>-->
<!-- <div class="product-price">-->
<!-- <div class="price-container" itemprop="offers" itemscope itemtype="http://schema.org/Offer">-->
<!-- {loop type="category" name="category_tag" id=$DEFAULT_CATEGORY}-->
<!-- <meta itemprop="category" content="{$TITLE}">-->
<!-- {/loop}-->
<!-- <meta itemprop="itemCondition" itemscope itemtype="http://schema.org/NewCondition">-->
<!-- <meta itemprop="priceCurrency" content="{currency attr="code"}">-->
<!-- <link itemprop="availability" href="http://schema.org/InStock" content="in_stock" />-->
<!-- <span class="regular-price"><span itemprop="price" class="price">{format_money number=$BEST_TAXED_PRICE}</span></span>-->
<!-- </div>-->
<!-- </div>-->
<!-- </a>-->
</article>
</li>
{/loop}
</ul>
</div>
</section>
{/ifloop}