Initial Commit
This commit is contained in:
48
local/modules/DigressivePrice/Hook/DigressivePriceHook.php
Normal file
48
local/modules/DigressivePrice/Hook/DigressivePriceHook.php
Normal 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;
|
||||
|
||||
/**
|
||||
* 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')
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user