Breakdown of Det var hyggelig å treffe deg! Ha det bra!
Questions & Answers about Det var hyggelig å treffe deg! Ha det bra!
Using Det var... (It was...) puts the phrase in the past tense, so Det var hyggelig å treffe deg! is said when you are parting ways at the end of a conversation — which is why it is paired with Ha det bra! here. When you are first introduced to someone, you use the present tense (Det er hyggelig å treffe deg!) or simply shorten it to Hyggelig å treffe deg!
Notice also that Norwegian uses the infinitive å treffe (to meet) after the adjective, where English often uses the "-ing" form ("nice meeting you").