Module DigressivePrice

This commit is contained in:
2021-04-08 15:57:38 +02:00
parent 99f3749535
commit f608c9332b
17041 changed files with 3164200 additions and 14 deletions

View File

@@ -0,0 +1,48 @@
<?php
namespace DigressivePrice\Hook;
use DigressivePrice\DigressivePrice;
use Thelia\Core\Event\Hook\HookRenderBlockEvent;
use Thelia\Core\Event\Hook\HookRenderEvent;
use Thelia\Core\Hook\BaseHook;
use Thelia\Core\Translation\Translator;
/**
* Class DigressivePriceHook
* @package DigressivePrice\Hook
* @author Etienne PERRIERE <eperriere@openstudio.fr> - Nexxpix - OpenStudio
*/
class DigressivePriceHook extends BaseHook
{
public function onProductTab(HookRenderBlockEvent $event)
{
$event->add([
'id' => 'digressive-prices',
'title' => Translator::getInstance()->trans(
'Digressive prices',
[],
DigressivePrice::DOMAIN
),
'content' => $this->render('product-tab-content-hook.html')
]);
}
public function onProductJavascriptInitialization(HookRenderEvent $event)
{
$event->add(
$this->render('digressive-price-update-js.html')
);
}
public function onCategoryJavascriptInitialization(HookRenderEvent $event)
{
$event->add(
$this->render('digressive-price-update-js.html')
);
}
}