简体   繁体   中英

How to remove '#' in WooCommerce Orders

I'm building a WooCommerce store and integrating it with my ERP system. My ERP system does not function correctly when it pulls in orders with special characters. In WooCommerce, my order numbers default with the # in the beginning (see image):

在此处输入图片说明

I am trying to find a solution to remove the # from the beginning of my orders. I found this resource: https://github.com/woothemes/woocommerce/issues/6518 but unfortunately the files are out of date and WooCommerce has implemented new functions and the commits/changes are out of place.

Has anyone attempted to remove the # and if so point me in the right direction of how to remove this?

If it always starts with # there are many ways to do it, str_replace, substr, or the following ltrim.

$orderNumber= ltrim ($orderNumberWithLeadingHash, '#');

Depending on your ERP and integration, you'd have to put this in multiple places.

I recently had that problem too.

I realized that the # symbol is not part of the order as such, it is simply a concatenation of that character with the order id.

Due to the above, I came to the conclusion that what should be modified is a screen printing function.

For the version of wordpress that I am using, that function is in the directory "\\ wp-content \\ plugins \\ woocommerce \\ includes \\ admin \\ list-tables \\ class-wc-admin-list-table-orders.php" I modified the lines 196, 199 and 365.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM