- This topic has 1 reply, 2 voices, and was last updated 2 years ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
› Forums › WordPress/WooCommerce › How can I change the layout of WooCommerce my account order column?
I want to change the layout of WooCommerce my account order column , How can I achieve it?
You can change the layout of WooCommerce my account order column.
You can add a new column and row by using this code:
add_filter( ‘woocommerce_account_orders_columns’, ‘add_account_orders_column’, 10, 1 );
function add_account_orders_column( $columns ){
$columns[‘custom-column’] = __( ‘New Column’, ‘woocommerce’ );
return $columns;
}
add_action( ‘woocommerce_my_account_my_orders_column_custom-column’, ‘add_account_orders_column_rows’ );
function add_account_orders_column_rows( $order ) {
// Example with a custom field
if ( $value = $order->get_meta( ‘_custom_field’ ) ) {
echo esc_html( $value );
}
}