Tag: woocommerce

How to rename Woocommerce order status?

Add the following code in your functions.php or custom plugin // rename processing to shipping function wc_rename_order_statuses( $statuses ) { foreach ( $statuses as $key => $status ) { $statuses[ $key ] = $status; if ( ‘wc-processing’ === $key ) { $statuses[‘wc-processing’] = _x( ‘Pending’, ‘Order status’, ‘woocommerce’ ); } if ( ‘wc-completed’ === $key […]

Read more

How to merge Woocommerce current and persistent cart?

Add the following code in your functions.php function wc_custom_user_redirect( $redirect, $user ) { if($_COOKIE[‘_redirect_url’] == ”) { if (sizeof(WC()->cart->get_cart()) != 0) { return home_url(‘checkout’); }else{ return home_url(‘my-account’); } }else{ $redirect = $_COOKIE[‘_redirect_url’]; } // declaration $final_items_key = array(); // get current cart sessions global $woocommerce; $items = $woocommerce->cart->get_cart(); $current_items = array(); foreach($items as $item => […]

Read more