How to remove "price suffix" from woocommerce order?

Member

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

How to remove "price suffix" from woocommerce order?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by giovanny.lueilwitz , a year 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.

Related Threads:

How to get order->price in woocommerce?
How to remove woocommerce order status?
How to remove url from woocommerce my account order number?
How to add custom suffix to product attributes in woocommerce?
How to round up the price in woocommerce?
How to update price of all products in woocommerce?