I’m using How can I remove product link from order details page? answer code
However, I’ve tried this code and placed it on functions.php
, but it does not work, and this is not for backend.
Is there any specific custom code to be placed in functions.php
? for only shop manager to disable the order item’s link? It can be non-clickable or it will redirect to the page like ‘no access’ for shop manager. Because I do not want shop manager have the access to the product page and edit the details of product which they can only view the items.
For better reference the item order is at here: https://snipboard.io/uK28js.jpg
2
Answers
An update on the alternative solution using User Role Editor plugin.
To specify for a user role, may untick all 'Posts' (refer to the image below), to prevent a role (backend) to access the link to edit the product. This applies to the user role who doesn't want the user role to have complete access to the product page. Where they only can see the product name with SKU (if have) without access to edit product page.
After update the role, and under woocommerce > orders > click on order item
It will shows 'Sorry, you are not allowed to edit this item'
Feel free to add answer asides from this.
If you want you can do it by editing plugin file
here you’ll see the hyperlink
change this line:
Just remove the tag