NaveenYadav Posted May 27, 2014 Share Posted May 27, 2014 (edited) Hello Everyone, I am using PS 1.6.0.5. I need to show extra product info and I am creating a module. I want an extra tab where admin can add data at the time of product add/edit. see attachment. Please help me Edited May 27, 2014 by NaveenYadav (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted May 27, 2014 Share Posted May 27, 2014 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. 1 Link to comment Share on other sites More sharing options...
NaveenYadav Posted May 27, 2014 Author Share Posted May 27, 2014 Thanks Vekia Link to comment Share on other sites More sharing options...
NaveenYadav Posted May 28, 2014 Author Share Posted May 28, 2014 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 More sharing options...
NaveenYadav Posted May 28, 2014 Author Share Posted May 28, 2014 Hello Vekia, Any help? Link to comment Share on other sites More sharing options...
vekia Posted May 28, 2014 Share Posted May 28, 2014 how you created form with your datas? i just suppose that with "save and stay" button you aren't sending form you created in your tpl file. Link to comment Share on other sites More sharing options...
NaveenYadav Posted May 28, 2014 Author Share Posted May 28, 2014 (edited) 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 May 28, 2014 by NaveenYadav (see edit history) Link to comment Share on other sites More sharing options...
NaveenYadav Posted May 28, 2014 Author Share Posted May 28, 2014 Hello Vekia, Any help? Link to comment Share on other sites More sharing options...
NaveenYadav Posted May 29, 2014 Author Share Posted May 29, 2014 Anyone plz help me ...! Link to comment Share on other sites More sharing options...
Spir Posted October 17, 2014 Share Posted October 17, 2014 You can find an example here: http://nemops.com/prestashop-products-new-tabs-fields/ Link to comment Share on other sites More sharing options...
Recommended Posts