Files
domokits/local/modules/DigressivePrice/Hook/DigressivePriceHook.php
2019-11-21 12:25:31 +01:00

49 lines
1.3 KiB
PHP

<?php
namespace DigressivePrice\Hook;
use DigressivePrice\DigressivePrice;
use Thelia\Core\Event\Hook\HookRenderBlockEvent;
use Thelia\Core\Event\Hook\HookRenderEvent;
use Thelia\Core\Hook\BaseHook;
/**
* Class DigressivePriceHook
* @package DigressivePrice\Hook
* @author Etienne PERRIERE <eperriere@openstudio.fr> - Nexxpix - OpenStudio
* @author Franck Allimant <franck@cqfdev.fr>
*/
class DigressivePriceHook extends BaseHook
{
public function onProductTab(HookRenderBlockEvent $event)
{
$event->add(
[
'id' => 'product_digressive_price',
'title' => $this->trans('Digressive Prices', [], DigressivePrice::DOMAIN),
'content' => $this->render('product-tab-content-hook.html')
]
);
}
public function onProductDetailsBottom(HookRenderEvent $event)
{
$event->add(
$this->render(
'digressive-price/product-details-bottom.html',
[
'product_id' => $event->getArgument('product')
]
)
);
}
public function onProductJavascriptInitialization(HookRenderEvent $event)
{
$event->add(
$this->render('digressive-price/digressive-price.js.html')
);
}
}