2017-06-08 12:23:50 +02:00

52 lines
1.6 KiB
PHP

<?php
class AntadisConfiguratorDisplayProductTabContentController
{
/**
* @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()
{
$isActivated = false;
if($isActivated === true) {
$id_product = Tools::getValue('id_product');
// Get Product
// Get Options associées au produit
// Tableau Multi Niveau
// => Option Group : label / name / ref
// => Liste des Valeurs : name / value / price
$optGroupList = Product::getConfiguratorOptGroup($id_product);
$optImpact = Product::getConfiguratorOptImpact($id_product);
$optImpactList = array();
if (count($optImpact) > 0) {
foreach ($optImpact as $o) {
$optImpactList[$o['id_product_configurator_opt_group']][] = $o;
}
}
$this->context->smarty->assign('token', Tools::getToken(false));
$this->context->smarty->assign('optGroupList', $optGroupList);
$this->context->smarty->assign('optImpactList', $optImpactList);
return $this->module->display($this->file, 'displayProductTabContent.tpl');
}
return '';
}
}