Jump to content

Product additional tab


Recommended Posts

displayAdminProductsExtra - this is hook for additional product tab on product edit page

in your module you have to register this hook in the install function:

!$this->registerHook('displayAdminProductsExtra')

then you have to create function with this hook:

public function hookDisplayAdminProductsExtra($params) {
return $this->display(__FILE__, 'your-new-tab-body.tpl');
}

and that's all.

  • Like 1
Link to comment
Share on other sites

Hello Vekia,

 

 

Above solution works for me. By using "displayAdminProductsExtra" hook I was able to show xtra tab.

I have create some text fields in modules and when I hit "save and stay" button and print $_POST on module php file, I got only

Array ( [controller] => AdminProducts [id_product] => 1 [updateproduct] => [conf] => 4 [key_tab] => ModuleCustomattr [token] => 84fe1ff13fc2fba75d6007eb9dbd3e45 ).

No text field data is printed on module php file. But is printing on "AdminProductController.php".

So is there any way to print whole array (text field data) on module php file.

Please help.

Link to comment
Share on other sites

I hav't created form in tpl file.

 

Below is the code on module tpl file:

<div class="panel product-tab" id="product-ModuleCustomattr">
 <h3>{l s='Custom Attribute'}</h3>
 {foreach from=$attribute_label item="item"}
     <div class="form-group">
  <label for="customattr[{$item.id_customattr}]" class="control-label col-lg-3">
   {$item.attribute_title}
  </label>
  <div class="col-lg-9">
   <textarea class="textarea-autosize" name="customattr[{$item.id_customattr}]" id="customattr[{$item.id_customattr}]" style="overflow: hidden; word-wrap: break-word; resize: none; height: 27px;"></textarea>
   <span max="none" class="counter"></span>
  </div>
 </div>
 <hr>
 {/foreach}
 <div class="panel-footer">
  <a href="{$link->getAdminLink('AdminProducts')}" class="btn btn-default"><i class="process-icon-cancel"></i> {l s='Cancel'}</a>
  <button type="submit" name="submitAddproduct" class="btn btn-default pull-right"><i class="process-icon-save"></i> {l s='Save'}</button>
  <button type="submit" name="submitAddproductAndStay" class="btn btn-default pull-right"><i class="process-icon-save"></i> {l s='Save and stay'}</button>
 </div>
</div>
Edited by NaveenYadav (see edit history)
Link to comment
Share on other sites

  • 4 months later...
×
×
  • Create New...