How to remove the front-end edit button in Virtuemart

Posted by: twmeier

Tagged in: Programming , Joomla

There are times when you may not want the ability to edit a Virtuemart product from the front end. This may be due to a poorly designed template that just doesn't work well with this feature.

To remove the edit button from the product detail page, you will need to open the following file:

/administrator/components/com_virtuemart/html/shop.product_details.php


Starting on Liine 240, it should read:

// Show an "Edit PRODUCT"-Link
if ($perm->check("admin,storeadmin")) {
    $edit_link = 'url( 'index2.php?page=product.product_form&next_page=shop.product_details&product_id='.$product_id).'">
      '._('PHPSHOP_PRODUCT_FORM_EDIT_PRODUCT') .'" border="0" />
';
}
else {
    $edit_link = "";
}

Change that to:

// Show an "Edit PRODUCT"-Link
//if ($perm->check("admin,storeadmin")) {
//    $edit_link = 'url( 'index2.php?page=product.product_form&next_page=shop.product_details&product_id='.$product_id).'">
//      '._('PHPSHOP_PRODUCT_FORM_EDIT_PRODUCT') .'" border="0" />
';
//}
//else {
    $edit_link = "";
//}
This basically comments out everything accept $edit_link = ""; which makes the link no longer exist. I like comment out code just in case I ever want to change it back to the way it was.

That is all there is to it.