shipment = $shipment; } /** * Are settings set for auto complete order. * * @return bool */ private function is_shipment_settings_complete_order() { $change_status = $this->shipment->get_paczkomaty_shipping_method()->get_option( 'complete_order', '' ); return ( $change_status === '1' || $change_status === 'yes' ); } /** * Handle complete order. */ public function handle_order() { if ( $this->is_shipment_settings_complete_order() ) { $order = $this->shipment->get_order(); if ( ! $order->has_status( self::TARGET_STATUS ) ) { $order->update_status( self::TARGET_STATUS, __( 'Status zamówienia zmieniony na zrealizowany przez InPost', 'woocommerce-paczkomaty-inpost' ) ); } } } }