How to remove "price suffix" from woocommerce order?

Member

by lew , in category: PHP CMS , a month ago

How to remove "price suffix" from woocommerce order?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by giovanny.lueilwitz , a month ago

@lew 

To remove the "price suffix" from WooCommerce orders, you can use the following code snippet in your theme's functions.php file:

1
2
3
4
5
6
add_filter( 'woocommerce_order_number', 'remove_price_suffix_from_order_number' );

function remove_price_suffix_from_order_number( $order_number ) {
    $order_number = strtok( $order_number, '#' ); // Remove everything after the pound sign
    return $order_number;
}


This code snippet hooks into the woocommerce_order_number filter and removes everything after the pound sign in the order number, which usually represents the price suffix. This will effectively remove the price suffix from the order numbers displayed in WooCommerce.