deepa Posted March 13, 2014 Share Posted March 13, 2014 (edited) I want to remove some tabs from product admin section for some level of users like for employees, for that i have modified the following code: $this->available_tabs = array_merge($this->available_tabs, array( 'Informations' => 0, 'Pack' => 7, 'VirtualProduct' => 8, 'Prices' => 1, 'Seo' => 2, 'Associations' => 3, 'Images' => 9, 'Shipping' => 4, 'Combinations' => 5, 'Features' => 10, 'Customization' => 11, 'Attachments' => 12, 'Suppliers' => 13, )); I have removed the suppliers, attachments, customisation, features,shipping successfully. Now they are not appearing in the backend. But when i try to remove the seo tab, my product section stops working. Please tell me what else i need to modify in order to remove this seo tab. Thanks in advance. Edited March 28, 2014 by deepa (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted March 15, 2014 Share Posted March 15, 2014 Hi Deepa, What message/error do you get when doing this? If no error seen, can you turn on debug mode (http://www.prestashop.com/forums/topic/224525-how-to-turn-on-error-reporting-for-debug-information/) and see if you get any message? I can imagine it complains about the friendly URL, as this may be a required field (Maybe only when using Friendly URL mode?? Not sure about that), so then you have to fill this automatically in the background when saving the product. My 2 cents, pascal. Link to comment Share on other sites More sharing options...
deepa Posted March 19, 2014 Author Share Posted March 19, 2014 Thanks for your reply When i tried to remove the SEO tab from the above code, i did not get any error. But the textbox for the products name becomes disabled(could not enter anything in it). None of the fields in SEO tab is mandatory. Then what can be the problem? However i am successfully able to remove other tabs from here like Shipping, suppliers, etc. Regards Link to comment Share on other sites More sharing options...
deepa Posted March 27, 2014 Author Share Posted March 27, 2014 Anybody there to help me on this? Link to comment Share on other sites More sharing options...
PascalVG Posted March 27, 2014 Share Posted March 27, 2014 deepa, what version do you use? Link to comment Share on other sites More sharing options...
deepa Posted March 27, 2014 Author Share Posted March 27, 2014 Its 1.5.6.2 Link to comment Share on other sites More sharing options...
PascalVG Posted March 27, 2014 Share Posted March 27, 2014 Think you have to do three things to make it possible: in controllers/admin/AdminProductsController.php (make backup, just in case): if ($this->context->shop->getContext() != Shop::CONTEXT_GROUP) $this->available_tabs = array_merge($this->available_tabs, array( 'Informations' => 0, 'Pack' => 7, 'VirtualProduct' => 8, 'Prices' => 1, /*'Seo' => 2,*/ <-- comment out this line, to remove the tab itself (think you did already) 'Associations' => 3, 'Images' => 9, 'ImagesAlt' => 10, 'Shipping' => 4, 'Combinations' => 5, 'Features' => 11, 'Customization' => 12, 'Attachments' => 13, 'Suppliers' => 14, )); then, in classes/Product.php: (make backup!) public static $definition = array( 'table' => 'product', 'primary' => 'id_product', .... 'link_rewrite' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isLinkRewrite', 'required' => false, 'size' => 128), <-- change true to false, to make it non-required finally, in: <your ADMIN folder>/themes/default/template/controllers/products/informations.tpl (Make backup!!) {* global information *} <tr> <td class="col-left"> {include file="controllers/products/multishop/checkbox.tpl" field="name" type="default" multilang="true"} <label>{l s='Name:'}</label> </td> <td style="padding-bottom:5px;" class="translatable"> {foreach from=$languages item=language} <div class="lang_{$language.id_lang}" style="{if !$language.is_default}display: none;{/if} float: left;"> <input class="{$class_input_ajax}{if !$product->id}copy2friendlyUrl{/if} updateCurrentText" size="43" type="text" {*{if !$product->id}disabled="disabled"{/if}*} <-- comment out this piece of code id="name_{$language.id_lang}" name="name_{$language.id_lang}" value="{$product->name[$language.id_lang]|htmlentitiesUTF8|default:''}"/><sup> *</sup> <span class="hint" name="help_box">{l s='Invalid characters:'} <>;=#{}<span class="hint-pointer"> </span> </span> </div> {/foreach} </td> </tr> That should do the trick, give it a try :-) pascal. Link to comment Share on other sites More sharing options...
deepa Posted March 27, 2014 Author Share Posted March 27, 2014 Hi Pascal, Thanks for your response. I have made changes in the above files as you said. And yes now it is working fine. But a confirmation, if i comment out the line in <your ADMIN folder>/themes/default/template/controllers/products/informations.tpl file, would it have some side effect in product edit mode or may be this should be commented only? Thanks Link to comment Share on other sites More sharing options...
PascalVG Posted March 27, 2014 Share Posted March 27, 2014 The change in informations.tpl makes the Name field editable, independent of anything (I believe it used to be shortly disabled, when it was a new product, when updating of the friendly URL. This seems unnecessary, as you took out the SEO tab. I don't see any side effect, but to make sure, just play with it a little bit to see if you bump into something, when being an admininstratior AND when begin a limited user without SEO tab. pascal. Link to comment Share on other sites More sharing options...
deepa Posted March 27, 2014 Author Share Posted March 27, 2014 Pascal, Thankyou so much for your quick back to back replies. It really helped me alot. Deepa Link to comment Share on other sites More sharing options...
PascalVG Posted March 27, 2014 Share Posted March 27, 2014 I'm glad it works :-) If you're happy with the answer, please mark post #7 as 'solved' and change the title to [sOLVED] (see my footer text on how to do that) Happy selling, Pascal. Link to comment Share on other sites More sharing options...
deepa Posted March 28, 2014 Author Share Posted March 28, 2014 Hi Pascal, Again i found a issue in the same thing. As per your instructions i modified the code to enable the textbox of products name. But this is giving me a new problem, now the textbox is enabled but the save button in toolbar is not appearing and i am not able to save the products You can also try this at your end. Please help. Thanks Link to comment Share on other sites More sharing options...
PascalVG Posted March 28, 2014 Share Posted March 28, 2014 I saw this one time yesterday. Moving to another tab made it to show up again. Not sure if it had to do with the change or not though, or some existing problem... Link to comment Share on other sites More sharing options...
deepa Posted March 28, 2014 Author Share Posted March 28, 2014 You are right, i checked it out.May be an existing problem with prestashop. Anyways thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now