Jump to content

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

Disabling Add-Ons Tab On Vendor Panel? Rate Topic   - - - - -

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

Posted 23 November 2016 - 08:38 PM #1

Does anyone know what file I must edit to disable add-ons tab in vendor panel (http://imgur.com/WkcAdmM)

 

Much appreciated in advance.



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

Posted 24 November 2016 - 07:37 AM #2

app/controllers/backend/products.php

 

replace:

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
        ),
    ));

with

$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
        ),
 );
 if (ACCOUNT_TYPE == 'vendor') {
     unset($tabs['addons']);
 }
 Registry::set('navigation.tabs', $tabs);

and replace:

    // [/Product tabs]
    Registry::set('navigation.tabs', $tabs);
    // [/Page sections]

with

    // [/Product tabs]
    if (ACCOUNT_TYPE == 'vendor') {
        unset($tabs['addons']);
    }
    Registry::set('navigation.tabs', $tabs);
    // [/Page sections]

(!) Not tested


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 руб.


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10770 posts

Posted 25 November 2016 - 05:41 AM #3

Or you can do the same using a addons/my_changes/controllers/backend/products.post.php controller and do 

if ($_SERVER["REQUEST_METHOD"] == 'GET' && $_SESSION['auth'][user_type'] == 'V') {
 $tabs = Registry::get('navigation.tabs');
  unset($tabs['addons']);
  Registry::set('navigation.tabs', $tabs);
}
return array(CONTROLLER_STATUS_OK);

 

This will survive a future upgrade and you won't be modifying a core file.  It too is UNTESTED.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


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

Posted 25 November 2016 - 10:29 PM #4

Thanks so much for the help guys. 

 

My original question was regarding the add-ons tab on vendor profile page, not the product page. 

 

Although, I do have need to disable add-on tab on product page as well. I tried both of the solutions above,

unfortunately neither of them worked for me in hiding add-ons on the vendor product page.

 

Albeit probably didn't work due to my products.php page being mangled to hell, - by some miracle it still works and hides most of the tabs I need it but is a disorganized mess..

 

If anyone can help, still looking how to disable add-ons tab on vendor panel profile, which you can be accessed on vendor panel by clicking vendor name (http://imgur.com/SHz40tq).



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

Posted 28 November 2016 - 10:20 AM #5

It is hard to say why it does not work for the product details page. For the Update vendor page please try

 

app/controllers/backend/companies.php

 

add

    if (ACCOUNT_TYPE == 'vendor') {
        unset($tabs['addons']);
    }

before

Registry::set('navigation.tabs', $tabs);

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 руб.


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

Posted 28 November 2016 - 07:43 PM #6

 

It is hard to say why it does not work for the product details page. For the Update vendor page please try

 

app/controllers/backend/companies.php

 

add

    if (ACCOUNT_TYPE == 'vendor') {
        unset($tabs['addons']);
    }

before

Registry::set('navigation.tabs', $tabs);

 

Your a wizard  :mrgreen:

 

That did it!

 

Thanks!!!



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

Posted 29 November 2016 - 07:23 AM #7

You are welcome!


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 руб.


 

Posted 11 April 2018 - 04:33 AM #8

Actually I was looking for solution to this and tried your method but it didn't work.

 

Can someone guide me on how to disable following menus from vendor's admin when vendors are adding new product or editing product? I'm using CS Cart 4.7.3 MV.

 

Vendor.jpg