Vendor Administration: Customized Menu

Dear all,



I would like hide some of the menu items for vendors. Anybody an idea how & where to do that?



I found a hint in here…



[size=4]http://forum.cs-cart…add-categories/ [/size]



[size=4]But I want to hide additional items like features, filters, options below the products menu item[/size]



[attachment=8172:products.jpg]



I want to hide the Website menu



[attachment=8173:website.jpg]



[size=4]Additionally I want to remove some of the admin stuff for vendors[/size]



[size=4][attachment=8171:admin.jpg][/size]



[attachment=8174:design.jpg]



Regards



Jan

admin.jpg

products.jpg

website.jpg

design.jpg

(on v4.x.x) you can just modify app/schemas/menu/menu_multivendor.php this way:



on the bottom before return $schema; add these lines:



if (Registry::get('runtime.company_id')) {
$schema['central']['website'] = array();
$schema['central']['products']['categories'] = array();
$schema['central']['products']['features'] = array();
$schema['central']['products']['filters'] = array();
$schema['central']['products']['options'] = array();
$schema['top']['administration']['items']['shippings_taxes'] = array();
$schema['top']['administration']['items']['currencies'] = array();
}




But if you want to make it right you need to activate my_changes addon and add a path schema/menu then create new file menu.post.php there and add these lines and return $schema; into it

Unfortunately I believe the schema is cached. So having it inside a condition requiring the company_id to be set could make it never show up (or always be present depending on when the cache was built and what user was active when the cache was built). Many of these things are controlled via permissions in admin groups…

[quote name='tbirnseth' timestamp='1403675571' post='186386']

Unfortunately I believe the schema is cached. So having it inside a condition requiring the company_id to be set could make it never show up (or always be present depending on when the cache was built and what user was active when the cache was built). Many of these things are controlled via permissions in admin groups…

[/quote]



Similiar checking is used in default menu_multivendor.php file. So I beleive that the solution proposed by ilib will work.

Quite possible. Not sure of what's changed in the caching in V4. In prior versions, $schema was cached and the schema files were not read at runtime. But maybe they're now caching the php versus the resulting data array?

Dear ilib,



sorry for the delay & thank you very much for your directions. It almost works perfectly :grin:



I ammended the code a little (w/o using my changes):


$schema['central']['website']['items']['content']= array();<br />
  $schema['central']['website']['items']['news']= array();<br />
		$schema['central']['products']['items']['categories'] = array();<br />
		$schema['central']['products']['items']['features'] = array();<br />
		$schema['central']['products']['items']['filters'] = array();<br />
		$schema['central']['products']['items']['options'] = array();<br />
		$schema['top']['administration']['items']['shippings_taxes'] = array();<br />
		$schema['top']['administration']['items']['currencies'] = array();<br />
  $schema['top']['design']['items']['file_editor'] = array();
```<br />
<br />
...works nearly perfect...just the bloody "Website --> News" menu item still appears. I figured out that this is an add on using a [i]menu.post.php[/i] file.<br />
<br />
Next idea:<br />
Usage my changes add-on - might be the case that the menu.post.php within the my changes add-on is processed after the menu.post.php of the "News" add-on. In that case the "Website --> News" should not appear anymore.<br />
<br />
Unfortunately it is not working when I use the my changes add on (it is active)...<br />
<br />
I added added the following folder & file:<br />
<br />
app\addons\my_changes\schemas\menu\menu.post.php<br />
<br />
including the following coding and the menu does not change at all.....anybody an idea?<br />
<br />
```php
<?php<br />
/***************************************************************************<br />
*																		  *<br />
*   (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev	*<br />
*																		  *<br />
* This  is  commercial  software,  only  users  who have purchased a valid *<br />
* license  and  accept  to the terms of the  License Agreement can install *<br />
* and use this program.													*<br />
*																		  *<br />
****************************************************************************<br />
* PLEASE READ THE FULL TEXT  OF THE SOFTWARE  LICENSE   AGREEMENT  IN  THE *<br />
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.			*<br />
****************************************************************************/<br />
use Tygh\Registry;<br />
if (Registry::get('runtime.company_id')) {<br />
		$schema['central']['website']['items']['content']= array();<br />
  $schema['central']['website']['items']['news']= array();<br />
		$schema['central']['products']['items']['categories'] = array();<br />
		$schema['central']['products']['items']['features'] = array();<br />
		$schema['central']['products']['items']['filters'] = array();<br />
		$schema['central']['products']['items']['options'] = array();<br />
		$schema['top']['administration']['items']['shippings_taxes'] = array();<br />
		$schema['top']['administration']['items']['currencies'] = array();<br />
  $schema['top']['design']['items']['file_editor'] = array();<br />
}<br />
return $schema;

I have got a solution…at least one without my changes…I included


if (Registry::get('runtime.company_id')) {
$schema['central']['website']['items']['news']= array();
[size=4]};
[/size]



into the menu.post.php of the news add-on.



In case anbody knows, why my my changes add on is not working, I would be glad hearing from you.



Kind regards



Jan

[quote name='hipe' timestamp='1404132144' post='186672']

In case anbody knows, why my my changes add on is not working, I would be glad hearing from you.

[/quote]


  1. Make sure that the add-on is installed
  2. Make sure that the add-on status is active
  3. Make sure that the path to menu.post.php is correct
  4. Clear the cache

Thanks…cleared the cache & it worked with the my changes add-on…for the other newbies here…cache is cleared in



Administration → Storage → Clear cache

So as I stated originally, that the addon schema files are cached and using conditional code is only going to be good for the context that is active when the cache is rebuilt. I misunderstood originally that you were modifying the files in app/schema versus the addon directories.



Hence you may not always have consistent results.

Hi tbirnseth,



I have no idea about that cache stuff…[size=4]if I now keep it as ist is (within the my changes add-on), the cache should always consider it? Or not?[/size]



[size=4]Kind regards[/size]



[size=4]Jan [/size]

[quote name='hipe' timestamp='1404195555' post='186713']

I have no idea about that cache stuff…[size=4]if I now keep it as ist is (within the my changes add-on), the cache should always consider it? Or not?

[/quote]



I am not sure, but it looks like the system uses different menu cache for admins and vendor admins. You cleared the cahce and store generated two versions of the menu.

I’m not sure on the MVE front either… But if a customer comes in to a storefront and the cache was cleared. It will be rebuilt in the context of the customer, not a vendor nor an admin. So if the info is cached, it will be cached in the context in which it was built.



YOu’ll just have to try it and watch results… Like most customers, if it’s wrong, it won’t take long for you to hear about it… :-)



tony

Wish there were just an easy disable button to remove the listings suggested above for those of us who don't really understand the coding stuff.

how can we disable the following items from user menu?

Events

Downloads

Order Tracking



thanks

We hid most of these items using css rules. It's certainly less destructive, and easier to put back after the fact.

how to do it? what happens when the direct link to those menu items is accessed by those who know cs-cart?

[quote name='csca' timestamp='1411057153' post='192470']

how can we disable the following items from user menu?

Events

Downloads

Order Tracking

[/quote]



Not use that CS-Cart version you use. For the first point, disable the Gift Registry add-on, for the rest ones correct the following template:



design/themes/THEME_NAME/templates/blocks/my_account.tpl

Suggest you do it via css versus editing the templates so you do not end up with future upgrade conflicts.

how to do in css?



what would happen is someone tries to access the downloads by entering the url? by others familiar with cs-cart who know the link to downloads?