I’m having issues displaying hyperlink value correctly in the table column “Profile”.

1) In the Profile column (which should output “Customer Profile” hyperlink of each customer that bought a product) there is just always number “1” no matter which customer purchases a product…so there’s no profile hyperlink in that column to link to customer’s profile and I want to remove that number “1”.

2) Hyperlink “View Customer” which is linking to customer profile is outside the table (specifically above the table). I want to move this hyperlink to “Profile” column from above. I’m not sure what’s the problem.

Here are table columns including 'user_link‘ (it’s a column that should display “Customer Profile” hyperlink but instead it’s displaying number “1”:

public function table_columns( ) {

        $columns = apply_filters( 'wcv_order_table_columns', array( 
                    'ID'            => __( 'ID',            'wcvendors-pro' ), 
                    'order_number'  => __( 'Purchase ID',       'wcvendors-pro' ),
                    'customer'      => __( 'Customer',      'wcvendors-pro' ),
                    'products'      => __( 'Product)',      'wcvendors-pro' ), 
                    'total'         => __( 'Total',         'wcvendors-pro' ), 
                    'order_date'    => __( 'Sale Date',     'wcvendors-pro' ),
                    'user_link'     => __( 'Profile', 'wcvendors-pro'),
        ) ); 

it’s a $new_row->user_link in question:

$new_row->ID            = $order->get_order_number(); 
                $new_row->order_number  = $order->get_order_number(); 
                $new_row->customer      = $customer_details; 
                $new_row->products      = $products_html;
                $new_row->total         = $total_text;
                $new_row->status        = $shipped;
                 $new_row->user_link  = print '<p><a class="author-link" href="'. $order->user_link .'">'. __( 'Customer Profile' ) . '</a><p>';
                $new_row->order_date    = date_i18n( wc_date_format(), strtotime( $order->order_date ) ) . '<br /><strong>' . ucfirst( $order->get_status() ) . '</strong>'; 
                $new_row->row_actions   = $row_actions; 
                $new_row->action_after  = $this->order_details_template( $_order ) . $this->order_note_template( $order->get_order_number() ) . $this->tracking_number_template( $order->get_order_number(), get_current_user_id() ); 

                do_action( 'wcv_orders_add_new_row', $new_row ); 

                $rows[] = $new_row; 

Read more here: Table column value not displaying correctly


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: