Author Topic: customize frontend admin so that users can only add products/categories?  (Read 17155 times)

wizzin

  • Beginner
  • *
  • Posts: 6
Is there a way to limit the frontend admin list to only allow users to add products and categories?  I'm using virtuemart as a product review site, and as such, have no need for prices etc.  It's running in catalog mode, and I've enabled frontend administration but, I only want users to be able to add products and add categories.  No delete, no other controls. 

I've started to look at busting up the admin component and creating my own component that only displays the add product and add categories, but it's looking daunting and I thought I might see if there's an easier way.

edit> I tried creating a menu item under user menu to add product which I created as a wrapper link to the public frontend add product page, but it displays the entire admin menu on the left.  I think if I could figure out how to disable the menu from displaying in the wrapper link I'd be happy.  Any suggestions?

wizzin

  • Beginner
  • *
  • Posts: 6
Ok, so this is a hack, but it appears to work exactly the way I wanted.  I edited /siteroot/components/com_virtuemart/virtuemart.php at line 131 and commented out the line:
include( ADMINPATH."header.php" );
to be:
//include( ADMINPATH."header.php" );

This removes the admin_menu from the add product page.

Next I created a menu item under the user menu as a wrapper and pointed the url for the wrapper to: http://www.yoursite.com/index2.php?pshop_mode=admin&page=product.product_form&option=com_virtuemart&Itemid=2

which is the path directly to add products.

Now on to the next task.  Simplify product.product_form.php to only show basic product information, like category etc. and re-direct the frontend form to the new dumbed down form to leave the full featured product.product_form.php intact.

Just thought I'd update this in case anyone else wants to hack up their vm install  ;)

jbennert

  • Beginner
  • *
  • Posts: 3
Re: customize frontend admin so that users can only add products/categories?
« Reply #2 on: September 12, 2008, 23:50:44 pm »
Thanks for all this. It was exactly what I needed too. I only could make it work with assigning frontend users as storeadmins. A newly created usergroup would never get the button to save a new product, no matter how I edited modul and functionlist permissions. The only security issue I see is: someone knowing virtuemart's URLs to the "disabled" admin-menubar on the left, could do some damage. Like I couldn't prevent a storeadmin to change the store information. If I missed something, please let me know.

hah

  • Beginner
  • *
  • Posts: 12
Re: customize frontend admin so that users can only add products/categories?
« Reply #3 on: January 21, 2009, 12:31:03 pm »
Wizzin! Thanks your post helped me a lot with that hack to comment out the menu :) now I can add a "SPECIAL" menu item under the User Menu to allow access to storeadmins only on certain aspects!

I think this post should be flagged or highlighted somehow - since I've seen MANY posts from people trying to do just this but obviously haven't found this post...

duchess

  • Jr. Member
  • **
  • Posts: 59
Re: customize frontend admin so that users can only add products/categories?
« Reply #4 on: February 09, 2009, 10:07:32 am »
Hey! You don't need to hack the code. All I did is set the permissions in Module list. If mu user is for example storeadmin, I put his rights to only add products, and see orders, just for him, without the possibility to change/delete other stuff on shop. You can see that in admin menu/module list then select witch one you want. For example product, click on list of functions, and there you find it all.. cheers.

morgoth_gr

  • Beginner
  • *
  • Posts: 9
Ok, so this is a hack, but it appears to work exactly the way I wanted.  I edited /siteroot/components/com_virtuemart/virtuemart.php at line 131 and commented out the line:
include( ADMINPATH."header.php" );
to be:
//include( ADMINPATH."header.php" );

This removes the admin_menu from the add product page.

Next I created a menu item under the user menu as a wrapper and pointed the url for the wrapper to: http://www.yoursite.com/index2.php?pshop_mode=admin&page=product.product_form&option=com_virtuemart&Itemid=2

which is the path directly to add products.

Now on to the next task.  Simplify product.product_form.php to only show basic product information, like category etc. and re-direct the frontend form to the new dumbed down form to leave the full featured product.product_form.php intact.

Just thought I'd update this in case anyone else wants to hack up their vm install  ;)


Any ideas of how to show the save button??I made the changes you said , works great but i can't save products!
Please if you know something help us a little..
Thanks in advance

kmanevil

  • Beginner
  • *
  • Posts: 2
You don't have to hack the code. You can simply do the following:

Log-in to your administrator back-end. From the Admin menu, select Components > Virtuemart.

From the left-hand side menu (Admin menu) click on Admin... and under Admin, find "List Modules".

You will be presented with a list of Modules used by the ViruteMart component. Scroll to find the "product" module and click on the "Functions List"... found in one of the columns listing "product" module details.

You will then be provided with a list of functions associated with that module and you can set permissions based on user type...

Simple, easy... no need to hack nothing. :)

Hope this was helpful.

morgoth_gr

  • Beginner
  • *
  • Posts: 9
I've found a way around this , edit the 'virtuemart.php' file under components/com_virtuemart and copy/paste this under the ** END: FRONTEND ADMIN - MOD :

if ( vmIsAdminMode()
      && $perm->check("shopper")
      && ((!stristr($my->usertype, "admin") ^ PSHOP_ALLOW_FRONTENDADMIN_FOR_NOBACKENDERS == '' )
         || stristr($my->usertype, "admin")
         )
      && !stristr($page, "shop.")
   ) {
      
      define( '_FRONTEND_ADMIN_LOADED', '1' );
      
      if( vmIsJoomla(1.5) ) {
         $editor =& JFactory::getEditor();
         echo $editor->initialise();
      } else {
         $mainframe->loadEditor = 1;
         require_once( $mosConfig_absolute_path."/editor/editor.php" );
         initEditor();
      }

      $editor1_array = Array('product.product_form' => 'product_desc',
      'product.product_category_form' => 'category_description',
      'store.store_form' => 'vendor_store_desc',
      'vendor.vendor_form' => 'vendor_store_desc');
      $editor2_array = Array('store.store_form' => 'vendor_terms_of_service',
      'vendor.vendor_form' => 'vendor_terms_of_service');
      editorScript(isset($editor1_array[$page]) ? $editor1_array[$page] : '', isset($editor2_array[$page]) ? $editor2_array[$page] : '');
      
      $vm_mainframe->addStyleSheet( VM_THEMEURL .'admin.css' );
      $vm_mainframe->addStyleSheet( VM_THEMEURL .'admin.styles.css' );
      $vm_mainframe->addScript( "$mosConfig_live_site/components/$option/js/functions.js" );
      echo '<table style="width:100%;table-layout:fixed;"><tr>';
      if( $no_menu != "1" ) {
         $vmLayout = 'standard';
         echo '<td valign="top" width="15%">';
         // The admin header with dropdown menu
         //include( ADMINPATH."header.php" );
         echo '</td>';
      }
      echo '<td width="80%" valign="top" style="border: 1px solid silver;padding:4px;">';
      include( ADMINPATH."toolbar.virtuemart.php" );
      echo '<br style="clear:both;" />';

   }

it's the exact same code as the above ( frontend admin mod) but works with shoppers and the ADMINPATH."header.php" is hidden.
:)

wdsjpk

  • Beginner
  • *
  • Posts: 42
I manage to customise the "Admin login from the frontend" as I wanted, except I am unable to hide/delete the "Help" button and the hyperlink "VirtueMart 1.1.3 stable" on the bottom of the Virtuemart menu on the left.

I will be much obliged if someone can suggest a solution.
Thanking you,
Jay

sanjukgowda

  • Beginner
  • *
  • Posts: 2
Ok, so this is a hack, but it appears to work exactly the way I wanted.  I edited /siteroot/components/com_virtuemart/virtuemart.php at line 131 and commented out the line:
include( ADMINPATH."header.php" );
to be:
//include( ADMINPATH."header.php" );

This removes the admin_menu from the add product page.

Next I created a menu item under the user menu as a wrapper and pointed the url for the wrapper to: http://www.yoursite.com/index2.php?pshop_mode=admin&page=product.product_form&option=com_virtuemart&Itemid=2

which is the path directly to add products.



Im new to joomla
I was able to do this much but i dint get the next part .. plz help me out....

marcovilla

  • Beginner
  • *
  • Posts: 1
Re: customize frontend admin so that users can only add products/categories?
« Reply #10 on: September 02, 2009, 11:08:08 am »
Ok, so this is a hack, but it appears to work exactly the way I wanted.  I edited /siteroot/components/com_virtuemart/virtuemart.php at line 131 and commented out the line:
include( ADMINPATH."header.php" );
to be:
//include( ADMINPATH."header.php" );

This removes the admin_menu from the add product page.

Next I created a menu item under the user menu as a wrapper and pointed the url for the wrapper to: http://www.yoursite.com/index2.php?pshop_mode=admin&page=product.product_form&option=com_virtuemart&Itemid=2

which is the path directly to add products.

Now on to the next task.  Simplify product.product_form.php to only show basic product information, like category etc. and re-direct the frontend form to the new dumbed down form to leave the full featured product.product_form.php intact.

Just thought I'd update this in case anyone else wants to hack up their vm install  ;)


Any ideas of how to show the save button??I made the changes you said , works great but i can't save products!
Please if you know something help us a little..
Thanks in advance

HI, did You solve the problem with the save button? Thanks for any help...

braca86

  • Beginner
  • *
  • Posts: 4
You could have obtained this  information by searching the forum.

1. Select "Allow Frontend-Administration for non-Backend Users?"  in VM's global config

2. Enure that the user being given access has signed up with full VM details, billing information and a shopping group. (check users under VM menu)

3. Assign the user  to Public Backend manager/Administrator group. (under VM users - General User info.)

4. Make sure than mod_login is diasbles and mod_virtuemart is configured to show the login module.

The shop manager then logs in on the front page  & an administration link iwll appear in the user menu.

lavoro83

  • Beginner
  • *
  • Posts: 5
Re: customize frontend admin so that users can only add products/categories?
« Reply #12 on: October 27, 2010, 23:32:18 pm »

1. Select "Allow Frontend-Administration for non-Backend Users?"  in VM's global config

2. Enure that the user being given access has signed up with full VM details, billing information and a shopping group. (check users under VM menu)

3. Assign the user  to Public Backend manager/Administrator group. (under VM users - General User info.)

4. Make sure than mod_login is diasbles and mod_virtuemart is configured to show the login module.

The shop manager then logs in on the front page  & an administration link iwll appear in the user menu.


I have done exactly this and no results, the user has all permissions not only add product and view report (as I wanted), please help

ebaygdl

  • Beginner
  • *
  • Posts: 5
  • MyEbay
    • MyEbay
You don't have to hack the code. You can simply do the following:

Log-in to your administrator back-end. From the Admin menu, select Components > Virtuemart.

From the left-hand side menu (Admin menu) click on Admin... and under Admin, find "List Modules".

You will be presented with a list of Modules used by the ViruteMart component. Scroll to find the "product" module and click on the "Functions List"... found in one of the columns listing "product" module details.

You will then be provided with a list of functions associated with that module and you can set permissions based on user type...

Simple, easy... no need to hack nothing. :)

Hope this was helpful.


That permission must be given to registered users only publish and delete their own items in front end?
Thanks 8)

eijii777

  • Beginner
  • *
  • Posts: 3
Ok, so this is a hack, but it appears to work exactly the way I wanted.  I edited /siteroot/components/com_virtuemart/virtuemart.php at line 131 and commented out the line:
include( ADMINPATH."header.php" );
to be:
//include( ADMINPATH."header.php" );

This removes the admin_menu from the add product page.

Next I created a menu item under the user menu as a wrapper and pointed the url for the wrapper to: http://www.yoursite.com/index2.php?pshop_mode=admin&page=product.product_form&option=com_virtuemart&Itemid=2

which is the path directly to add products.

Now on to the next task.  Simplify product.product_form.php to only show basic product information, like category etc. and re-direct the frontend form to the new dumbed down form to leave the full featured product.product_form.php intact.

Just thought I'd update this in case anyone else wants to hack up their vm install  ;)

This hack work great, It's really like i want.. But, how to simplify "product.product_form.php" and "re-direct the frontend form to the new dumbed down"? I dont have any php knowledge..
Is anyone can help me, please?

VirtueMart Forum