Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Add a clickable button on my account view order page

$
0
0

Replies: 0

I’m trying to insert a button on the “view order” page to redirect the user to a page on my site. As you can see in the screenshot, I tried to add this button with the a plugin, but I can only insert downloadable files and not URLs. I’m going crazy and can’t find a solution. Some advice?

Screenshot: https://i.stack.imgur.com/uWAaJ.png

I tried this code but just a label appears:

add_action( 'woocommerce_order_details_after_order_table', 'custom_order_details_after_order_table', 10, 1 );
function custom_order_details_after_order_table( $order ) {

    $user_link = get_post_meta( $order->id, '_user_link', true );

    echo '<p><a class="author-link" href="'. $user_link .'">'. __( 'User Link: ' ) . '</a><p>';

}

Viewing all articles
Browse latest Browse all 59525

Trending Articles