今天安裝了綠界的超商取貨官方提供給 WooCommerce 的外掛,
B2C 會有些狀況無法順利完成,
後來改 C2C 可以順利建立物流單,
但是發現訂單狀態會顯示 ECPay Shipping,
是能理解出貨中拉,
但是還是希望能讓消費者跟網站管理人員清楚的知道什麼是ECPay Shipping,
本來想直接改 code ,但是這樣一更新就又要在改一次,
後來看了看,應該可以使用在 theme 裡面的function.php 使用 add_filter 來覆寫
備忘一下
在 /wp-content/themes/使用的主題/functions.php 裡面加上下面這段
add_filter('wc_order_statuses', ergomap_statuses); function ergomap_statuses($order_statuses) { $order_statuses['wc-ecpay'] = _x( '出貨中', 'Order status', 'woocommerce' ); return $order_statuses; } add_action('init', ergomap_register_status); function ergomap_register_status() { register_post_status( 'wc-ecpay', array( 'label' => _x( 'ECPay Shipping', 'Order status', 'woocommerce' ), 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop( _x( '綠界超商取貨 - 已建立物流單', 'Order status', 'woocommerce' ) . ' <span class="count">(%s)</span>', _x( '綠界超商取貨 - 已建立物流單', 'Order status', 'woocommerce' ) . ' <span class="count">(%s)</span>' ) ) ); }
|
參考網址