Luxury goods group Richemont has agreed to buy online fashion portal Net-a-Porter in a deal which values the business at GBP350m (US$530m).