I have created a new Menu(Connections) in the Admin Panel. It was visible to all types of users {ie., Admin & Vendors}. But i want to disable this Menu(Connections) to the vendors.
I have created a new Menu(Connections) in the Admin Panel. It was visible to all types of users {ie., Admin & Vendors}. But i want to disable this Menu(Connections) to the vendors.
you can set permission for vendor here : app/schemas/permissions/vendor_multivendor.php
use here controller which you want to block for vendor.
Add the following around the code you want to hide. I.e.
{if !$runtime.company_id} {** include only when company_id is 0 - all vendors **}
my list item
{/if}
Hi,
I added the following code in app/schemas/menu/menu.php , But it is not working. Is there any mistake in my code. Please review it and help me to solve the issue.
I didn't mean for you to add that in the schema. That behaves differently and is cached by the system. My example was for the specific template to prevent the various standard list items from showing. However, you should be able to set this in the schema. I'm not familiar with a 'connections' controller. Suggest you do your settings in the DB like most addons in addition to using your own menu.post.php schema in the addon itself.
You can use css to hide that menu from the vendor console.
Hi Screenimages,
How can i add the css hide property to the Schema file. If it happens, Please provide me the solution. Here is my schema code to generate the Menu in the Admin Panel.
I added the following code in app/schemas/menu/menu.php , But it is not working. Is there any mistake in my code. Please review it and help me to solve the issue.
Hi Satya. I was just playing around with this myself and I think I have the solution if you're still having this issue. I think it will work if you change the following:
if (Registry::get('runtime.company_id'))
to
if (!Registry::get('runtime.company_id'))
If I am correct, the code effectively is saying "if vendor, show the following menu" and by adding the "!" it should now be "if not vendor, show the following menu". However, I'm not sure about the all the caching stuff, so not sure if that could still be an issue.
Hi Satya. I was just playing around with this myself and I think I have the solution if you're still having this issue. I think it will work if you change the following:
if (Registry::get('runtime.company_id'))
to
if (!Registry::get('runtime.company_id'))
If I am correct, the code effectively is saying "if vendor, show the following menu" and by adding the "!" it should now be "if not vendor, show the following menu". However, I'm not sure about the all the caching stuff, so not sure if that could still be an issue.
Good luck.
Hi Arteeni,
Thanks for your help , Issue is resolved with a small modification in the code.