|

Hiding Product tabs in Admin
Posted 19 April 2012 - 09:06 AM #1
I would like to hide some of the Product tabs within Admin. I am setting up a downloadable media store and it makes no sense to have a Quantity Discount tabs. I found this is tabsbox.tbl:
<ul>
{foreach from=$navigation.tabs item=tab key=key name=tabs}
{if (!$tabs_section || $tabs_section == $tab.section) && ($tab.hidden || !$key|in_array:$empty_tab_ids)}
<li id="{$key}{$id_suffix}" class="{if $tab.hidden == "Y"}hidden {/if}{if $tab.js}cm-js{elseif $tab.ajax}cm-js cm-ajax{/if}{if $key == $active_tab} cm-active{/if}"><a {if $tab.href}href="{$tab.href|fn_url}"{/if}>{$tab.title}</a>{if $key == $active_tab}{$active_tab_extra}{/if}</li>
{/if}
{/foreach}
</ul>
So it would seem there is a "tab.hidden" flag somewhere.
Any clues?
Appreciate the help.
Posted 17 May 2012 - 07:03 PM #2
I am setting up a Multi-vendor downloadable media store and have no need for some of the Tabs like "Quantity Discounts" and "Shipping Properties"
Posted 19 May 2012 - 08:30 PM #3
'shippings' => array ( 'title' => fn_get_lang_var('shipping_properties'), 'js' => true ), 'qty_discounts' => array ( 'title' => fn_get_lang_var('qty_discounts'), 'js' => true ),to turn off the "Quantity Discount" and "Shipping Properties" tabs in "Editing product".
Posted 30 April 2015 - 10:40 AM #4
I tried the logic from this post here:
if ($auth.user_type=="A"){
in the following file to reduce the product tabs displayed for vendors.....
/app/controllers/backend/products.php
Unfortunately it did not work....anybody an idea why?
I implemented the following logic:
if ($auth.user_type=="A"){
$tabs = array (
'detailed' => array (
'title' => __('general'),
'js' => true
),
'images' => array (
'title' => __('images'),
'js' => true
....
}
else //do not show all tabs
{
}
Posted 05 May 2015 - 08:53 AM #5
For limitation of number of tabs in admin panel, please add the code in the "app/controllers/backend/products.php":
if ($auth['user_type'] =="A"){ $tabs = array ( 'detailed' => array ( 'title' => __('general'), 'js' => true ), 'images' => array ( 'title' => __('images'), 'js' => true ) ); }before lines:
// [/Product tabs] Registry::set('navigation.tabs', $tabs); // [/Page sections]
Also in the file "design/backend/templates/views/products/update.tpl" replace line:
<div id="content_addons">with:
<div class="hidden" id="content_addons">
NOTE: After that don't forget to clean up the template cache.
NOTE: After this fix major part of tabs will disappear (e.g. "Options" or "Shipping Properties" ), however some other tabs might stay (mainly it is about tabs added by modules, e.g. "Attachments" - these tabs are added in POST controllers, e.g. "app/addons/attachments/controllers/backend/products.post.php").
For hiding other tabs you should find and modify all these POST controllers.
If you need our assistance in it, please don't hesitate to contact us.
Best regards,
WSA team
Posted 05 May 2015 - 10:45 AM #6
Unfortunately it did not work....anybody an idea why?
As we said in that post, additional template modifications are required to complete the modification. The thread was updated yesterday. Please check.
CS-Cart USD 345 Multi-Vendor USD 1250 Multi-Vendor PLUS USD 3100 (2775)
CS-Cart Ultimate USD 775 CS-Cart + YOUPI USD 545 Multi-Vendor Ultimate USD 7500 (6000)
Posted 23 September 2016 - 08:04 PM #7
Hello, this thread was very helpful. I did everything and had success in hiding all the tabs when editing a product, but when I add a new product the tabs appear again. It seems this only works when updating or after creation.
Is there a way to hide the tabs on creation of the product?
I would like to hide tabs like SEO, Product Discounts and more...which still appear when I add a new product, but are hidden after creation.
Posted 23 September 2016 - 09:50 PM #8
Hello, this thread was very helpful. I did everything and had success in hiding all the tabs when editing a product, but when I add a new product the tabs appear again. It seems this only works when updating or after creation.
Is there a way to hide the tabs on creation of the product?
I would like to hide tabs like SEO, Product Discounts and more...which still appear when I add a new product, but are hidden after creation.
Bump, I would like to find out the same!!
Posted 26 September 2016 - 06:58 AM #9
Hello, this thread was very helpful. I did everything and had success in hiding all the tabs when editing a product, but when I add a new product the tabs appear again. It seems this only works when updating or after creation.
Is there a way to hide the tabs on creation of the product?
I would like to hide tabs like SEO, Product Discounts and more...which still appear when I add a new product, but are hidden after creation.
For adding products another part of code is used in the same file:
// [Page sections] Registry::set('navigation.tabs', array ( 'detailed' => array ( 'title' => __('general'), 'js' => true ), 'images' => array ( 'title' => __('images'), 'js' => true ), 'seo' => array( 'title' => __('seo'), 'js' => true ), 'qty_discounts' => array ( 'title' => __('qty_discounts'), 'js' => true ), 'addons' => array ( 'title' => __('addons'), 'js' => true ), 'shippings' => array ( 'title' => __('shipping_properties'), 'js' => true ), )); // [/Page sections]
Just remove unnecessary sections
CS-Cart USD 345 Multi-Vendor USD 1250 Multi-Vendor PLUS USD 3100 (2775)
CS-Cart Ultimate USD 775 CS-Cart + YOUPI USD 545 Multi-Vendor Ultimate USD 7500 (6000)
Posted 11 November 2016 - 08:12 AM #10
I am running MV 4.3.10 and amended products.php like before....this means
if ($auth.user_type=="A"){ //tabs for admin
tabs for admin
}
else //do not show all tabs
{
tabs for vendors
}
Now I am getting the warning....
Notice: Use of undefined constant user_type - assumed 'user_type' in app/controllers/backend/products.php on line 502
Anyone an idea how to solve this?
Posted 11 November 2016 - 08:17 AM #11
Please try
if ($auth['user_type'] == "A") {
CS-Cart USD 345 Multi-Vendor USD 1250 Multi-Vendor PLUS USD 3100 (2775)
CS-Cart Ultimate USD 775 CS-Cart + YOUPI USD 545 Multi-Vendor Ultimate USD 7500 (6000)
Posted 11 November 2016 - 02:08 PM #13
We are glad to help you.
CS-Cart USD 345 Multi-Vendor USD 1250 Multi-Vendor PLUS USD 3100 (2775)
CS-Cart Ultimate USD 775 CS-Cart + YOUPI USD 545 Multi-Vendor Ultimate USD 7500 (6000)
Posted 31 August 2018 - 05:26 PM #14
So i copied this file:
app/controllers/backend/products.php
Put it in
app/addon/my_changes/controllers/backend/products.php
Modified the copied file, cleared the cache , but cart is not picking up the changes. To be sure I purposely put a syntax error to find out which file cart is picking up and it is picking up original file at app/controllers/backend/products.php
Posted 31 August 2018 - 05:59 PM #15
So i copied this file:
app/controllers/backend/products.php
Put it in
app/addon/my_changes/controllers/backend/products.php
Modified the copied file, cleared the cache , but cart is not picking up the changes. To be sure I purposely put a syntax error to find out which file cart is picking up and it is picking up original file at app/controllers/backend/products.php
Any ideas on how to force cart to use new copied file?
Hello!
You shouldn't copy the file, just create app/addon/my_changes/controllers/backend/products.post.php with the following code:
<?php /*************************************************************************** * * * (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev * * * * This is commercial software, only users who have purchased a valid * * license and accept to the terms of the License Agreement can install * * and use this program. * * * **************************************************************************** * PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE * * "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. * ****************************************************************************/ use Tygh\Registry; if ($_SERVER['REQUEST_METHOD'] == 'POST') { return array(CONTROLLER_STATUS_OK); } if ($mode == 'add' && Tygh::$app['session']['auth']['user_type'] == 'V') { Registry::del('navigation.tabs.qty_discounts'); } elseif ($mode == 'update' && Tygh::$app['session']['auth']['user_type'] == 'V') { Registry::del('navigation.tabs.qty_discounts'); }
You can delete any tab with Registry::del('navigation.tabs.tab_name');
Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE
Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics
Posted 03 September 2018 - 04:30 AM #16
Hello!
You shouldn't copy the file, just create app/addon/my_changes/controllers/backend/products.post.php with the following code:
<?php /*************************************************************************** * * * (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev * * * * This is commercial software, only users who have purchased a valid * * license and accept to the terms of the License Agreement can install * * and use this program. * * * **************************************************************************** * PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE * * "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. * ****************************************************************************/ use Tygh\Registry; if ($_SERVER['REQUEST_METHOD'] == 'POST') { return array(CONTROLLER_STATUS_OK); } if ($mode == 'add' && Tygh::$app['session']['auth']['user_type'] == 'V') { Registry::del('navigation.tabs.qty_discounts'); } elseif ($mode == 'update' && Tygh::$app['session']['auth']['user_type'] == 'V') { Registry::del('navigation.tabs.qty_discounts'); }You can delete any tab with Registry::del('navigation.tabs.tab_name');
Thank you for your response, did you mean products.php? or products.post.php?
products.post.php is under app/controller/common
products.php is under app/controller/backend
Posted 03 September 2018 - 05:07 AM #17
Thank you for your response, did you mean products.php? or products.post.php?
products.post.php is under app/controller/common
products.php is under app/controller/backend
No, you need to remove your app/addon/my_changes/controllers/backend/products.php file and create app/addon/my_changes/controllers/backend/products.post.php file with the code I mentioned.
Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE
Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics
Posted 03 September 2018 - 09:14 PM #18
No, you need to remove your app/addon/my_changes/controllers/backend/products.php file and create app/addon/my_changes/controllers/backend/products.post.php file with the code I mentioned.
Thank you again for the response, I copied exact code in the backend directory with same file name, cleared the cache, but it is still showing qty_discount tab on edit and add product screens.
Posted 04 September 2018 - 05:22 AM #19
Thank you again for the response, I copied exact code in the backend directory with same file name, cleared the cache, but it is still showing qty_discount tab on edit and add product screens.
There is a condition for vendors in my code above. So now the tab is removed only for vendors. If you want to remove it for all admins, remove the
&& Tygh::$app['session']['auth']['user_type'] == 'V'
code from both places.
Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE
Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics
Posted 04 September 2018 - 05:27 AM #20
Thank you again for the response, I copied exact code in the backend directory with same file name, cleared the cache, but it is still showing qty_discount tab on edit and add product screens.
Did you check it in the vendor area, not in the admin panel?
CS-Cart USD 345 Multi-Vendor USD 1250 Multi-Vendor PLUS USD 3100 (2775)
CS-Cart Ultimate USD 775 CS-Cart + YOUPI USD 545 Multi-Vendor Ultimate USD 7500 (6000)