2017-07-31 16:01:07 +02:00

39 lines
940 B
PHP

<?php
class AntadisSimulatorDisplayProductBlocController
{
/**
* @var ModuleAdminController
*/
protected $module;
/**
* @var Context
*/
protected $context;
public function __construct($module, $file, $path)
{
$this->file = $file;
$this->module = $module;
$this->context = Context::getContext();
$this->_path = $path;
}
public function run()
{
$id_product = (int)Tools::getValue('id_product');
// Looks for a simulator associate with product
$simulatorCode = $this->context->smarty->getVariable('simulatorCode');
if (!empty($simulatorCode)) {
return $this->module->display($this->file, 'productbloc/'.$simulatorCode.'.tpl');
}
// Fallback
return $this->module->display($this->file, 'displayProductBloc.tpl');
}
}