I'm trying to run a custompiece of code but I just have this in it's own PHP file. How am I supposed to make sure that it 'inherits' all the functions of wordpress and woocommerce so that it knows what to do?
$order = wc_get_order( $order_id );
$order->update_status( 'completed' );