Add reference in display

This commit is contained in:
Michael RICOIS 2017-06-27 17:09:47 +02:00
parent 7af93b1cc0
commit 7adb1c26d7
4 changed files with 24 additions and 4 deletions

View File

@ -24,8 +24,10 @@ class ProductConfiguratorOptGroup extends ObjectModel
$id_lang = (int)Context::getContext()->language->id;
$opts = Db::getInstance()->executeS('
SELECT pcog.*, col.`name` FROM `'._DB_PREFIX_.'product_configurator_opt_group` pcog, `'._DB_PREFIX_.'configurator_opt_group_lang` col
SELECT pcog.*, col.`name`, cog.`reference`
FROM `'._DB_PREFIX_.'product_configurator_opt_group` pcog, `'._DB_PREFIX_.'configurator_opt_group` cog, `'._DB_PREFIX_.'configurator_opt_group_lang` col
WHERE pcog.`id_product` = '.(int)$id_product.'
AND cog.`id_configurator_opt_group` = col.`id_configurator_opt_group`
AND pcog.`id_configurator_opt_group` = col.`id_configurator_opt_group`
AND col.`id_lang` = '.(int)$id_lang.'
ORDER BY pcog.`position` ASC');

View File

@ -86,6 +86,9 @@ class AdminAntadisConfiguratorProductGroupController extends ModuleAdminControll
'name' => array(
'title' => $this->l('Option Name'),
),
'reference' => array(
'title' => $this->l('Option Reference'),
),
'required' => array(
'title' => $this->l('Required'),
'active' => 'status',
@ -100,8 +103,9 @@ class AdminAntadisConfiguratorProductGroupController extends ModuleAdminControll
);
// Override SQL to get name
$this->_select = ' cogl.`name`';
$this->_select = ' cogl.`name`, cog.`reference`';
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'configurator_opt_group_lang` cogl ON(cogl.`id_configurator_opt_group` = a.`id_configurator_opt_group`)';
$this->_join.= 'LEFT JOIN `'._DB_PREFIX_.'configurator_opt_group` cog ON(cog.`id_configurator_opt_group` = a.`id_configurator_opt_group`)';
$this->_where = ' AND a.`id_product` = '.(int)$id_product;
$this->_orderBy = 'position';

View File

@ -33,6 +33,9 @@ class AntadisConfiguratorDisplayAdminProductsExtraController
'name' => array(
'title' => $this->module->l('Option Name'),
),
'reference' => array(
'title' => $this->module->l('Option reference'),
),
'required' => array(
'title' => $this->module->l('Required'),
'active' => 'status',

View File

@ -19,8 +19,8 @@
</div>
<button type="submit" class="btn btn-default">{l s="Add New option"}</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
@ -51,3 +51,14 @@ $('form#product-configurator-opt-add').submit(function(){
{$ProductOptGroupList}
<div id="product-configurator-opt" class="panel product-tab">
<div class="panel-heading">{l s='Copy options from product'}</div>
<div class="panel-body">
<div class="row">
<div class="col-md-6">
</div>
</div>
</div>
</div>