admin管理员组

文章数量:1287253

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 3 years ago.

Improve this question

I'm facing a problem where I couldn't disable the order item link for the backend (user role: shop manager). I've found some solutions but only tackle to the front end (customer-order page).

However, I added a code to functions.php to target only on shop_order order item link

add_filter( 'woocommerce_order_items_shop_order', '__return_false' );

But it doesn't work. Does this require adding javascript in order to disable the order item link on the backend? Been struggling with this for a long time.

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 3 years ago.

Improve this question

I'm facing a problem where I couldn't disable the order item link for the backend (user role: shop manager). I've found some solutions but only tackle to the front end (customer-order page).

However, I added a code to functions.php to target only on shop_order order item link

add_filter( 'woocommerce_order_items_shop_order', '__return_false' );

But it doesn't work. Does this require adding javascript in order to disable the order item link on the backend? Been struggling with this for a long time.

Share Improve this question asked Sep 30, 2021 at 18:38 ColeCole 31 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

You can do using this way -

This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-order-details.php

if ( $sent_to_admin ) {
    /* translators: %s: Order link. */
    echo "\n" . sprintf( esc_html__( 'View order: %s', 'woocommerce' ), esc_url( $order->get_edit_order_url() ) ) . "\n";
}

本文标签: phpWoocommerce disable order item link (backend)