Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Hiding Product tabs in Admin Rate Topic   - - - - -

 
  • Entangled
  • Advanced Member
  • Members
  • Join Date: 10-Oct 11
  • 60 posts

Posted 19 April 2012 - 09:06 AM #1

Hello,

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.

 
  • Entangled
  • Advanced Member
  • Members
  • Join Date: 10-Oct 11
  • 60 posts

Posted 17 May 2012 - 07:03 PM #2

Nobody knows how to turn off the Tabs in "Editing product"?

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"

 
  • h694616
  • Newbie
  • Trial users
  • Join Date: 24-Apr 12
  • 5 posts

Posted 19 May 2012 - 08:30 PM #3

You can comment out or delete these lines of code ( in $DIR_ROOT/controllers/admin/products.php file):
  '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".

 
  • hipe
  • Member
  • Members
  • Join Date: 17-Apr 14
  • 28 posts

Posted 30 April 2015 - 10:40 AM #4

Hi,

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

hi,

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

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18335 posts

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.

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • mbevia
  • Advanced Member
  • Members
  • Join Date: 30-Jul 16
  • 54 posts

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.



 
  • cscartfan
  • Advanced Member
  • Members
  • Join Date: 26-Jul 16
  • 98 posts

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!!



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18335 posts

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • hipe
  • Member
  • Members
  • Join Date: 17-Apr 14
  • 28 posts

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?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18335 posts

Posted 11 November 2016 - 08:17 AM #11

Please try

if ($auth['user_type'] == "A") {

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • hipe
  • Member
  • Members
  • Join Date: 17-Apr 14
  • 28 posts

Posted 11 November 2016 - 08:26 AM #12

Perfect, thanks it works like that :grin:  



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18335 posts

Posted 11 November 2016 - 02:08 PM #13

We are glad to help you.


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • 12ka4
  • Advanced Member
  • Trial users
  • Join Date: 21-Feb 18
  • 93 posts

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

 
Any ideas on how to force cart to use new copied file?


 
  • oleg.gorshkov
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3078 posts

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

Mega SEO Package - All you need for your SEO


 
  • 12ka4
  • Advanced Member
  • Trial users
  • Join Date: 21-Feb 18
  • 93 posts

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



 
  • oleg.gorshkov
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3078 posts

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

Mega SEO Package - All you need for your SEO


 
  • 12ka4
  • Advanced Member
  • Trial users
  • Join Date: 21-Feb 18
  • 93 posts

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.



 
  • oleg.gorshkov
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3078 posts

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

Mega SEO Package - All you need for your SEO


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18335 posts

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?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.