Posts

Showing posts with the label woocommerce_checkout_customer_id

How to change user id on checkout page for assign order to different user in woocommerce wordpress

Just copy and paste below code into your theme's functions.php file or in your custom plugin file function rj_replace_user_id_with_session_id(){     if(!session_id()){         session_start();     }     if(isset($_SESSION['order_replace_by_user_id'])){            return $_SESSION['order_replace_by_user_id']; // return user id you want to assign order     } } add_filter( 'woocommerce_checkout_customer_id', 'rj_replace_user_id_with_session_id' );