Public Ticket #3433101

Placed By Column Value Override

Closed
Comments
5 Tickets 3
Nicholas started the conversation 3 years ago on August 9, 2023 at 12:48pm

We need the ability to override the 'placed by' column value in the myaccount order history grid. Is it possible to add a filter for this?

If there is a way to do this already please may you let us know.

Best regards,

Nick

2,762
KingsPlugins replied 3 years ago on August 9, 2023 at 6:09pm

Hi Nick,

Thank you for purchasing our plugin!


It is possible to replace the value there by adding this PHP code snippet to your site:

global $b2bking_public;
remove_action( 'woocommerce_my_account_my_orders_column_order-placed-by', array($b2bking_public, 'b2bking_orders_placed_by_column_content')  );
add_action( 'woocommerce_my_account_my_orders_column_order-placed-by', function( $order ) {
    // echo your custom content here
}, 10, 1);

This code basically removes the standard value and allows you to display your own custom value.


The above code can be added to functions.php If you are adding it to a snippets plugin you may need to write the snippet like this:

add_action('plugins_loaded', function(){
    global $b2bking_public;
    remove_action( 'woocommerce_my_account_my_orders_column_order-placed-by', array($b2bking_public, 'b2bking_orders_placed_by_column_content')  );
    add_action( 'woocommerce_my_account_my_orders_column_order-placed-by', function( $order ) {
        // echo your custom content here
    }, 10, 1);
});


Let me know if that can solve it for you,

Kind regards,

Stefan

Sign In