Change Menu Items When Logged In As Vendor

Hi CS-Cart community,

I would like to disable a menu item in a "text-link menu" called "apply for vendor account" once a registered vendor logged in and show instead "upload products" with a link to the vendor panel.

I want to have the same look and feel as the "test-link menu" also for mobile version.

I have come up with a solution that works more or less by implementing a block with smarty support.

The crucial part is the if else clause:

{if $is_vendor_with_active_company="MULTIVENDOR"|fn_allowed_for && $auth.user_type == "V"}

Below you can find the whole code:

Currently the menu is not visible at all when accessing the webpage via mobile device. Also this approach is a bit tedious.

My idea for a better solution:

  1. Create two menus. One with links for user not logged in, the other for user logged in.
  2. Create two wrapper files, one for hiding blocks, when user logged in, the other for hiding block if user not logged in.
  3. Applying the wrapper to the menu blocks.

Can you let me now where I have to place the wrapper files and which code I have to implement? Better solutions are also welcome.

Thanks for your help

Jerrit

To create new wrapper, just create the file here and clear cache

design/themes/responsive/templates/blocks/wrappers

Use one of existent wrappers as example. The condition for logged in users is

{if $auth.user_id}
    ... your code here...
{/if|

Hi ecom,

does the if-clause check for vendor account?

I think it must be "$auth.user_type == "V"

For other readers: I copied all the code of quick_menu.tpl in html block with smarty support instead of creating a wrapper.

Works just finde...

BR

Jerrit

does the if-clause check for vendor account?

I think it must be "$auth.user_type == "V"

No, my code just checks if the user is logged in as per your request

One with links for user not logged in, the other for user logged in.

Try to add additional condition for $auth.user_type