Two teenagers who peed into a pot of broth at a hotpot restaurant have been ordered to pay 2.2m yuan ($309,000; £227,000) to two catering companies in China.

The incident, which occurred in February at a Shanghai branch of China's biggest hotpot chain Haidilao, sparked widespread criticism after the 17-year-olds posted a video of their drunken act online.

There is no suggestion that anyone consumed the contaminated broth, but Haidilao had offered to pay thousands of diners who dined at the restaurant in the days following the incident.

In March, Haidilao sought more than 23m yuan in losses, claiming it accounted for the compensation provided to customers over the incident.

Last Friday, a Shanghai court found that the teenagers had infringed upon the companies' property rights and reputation through acts of insult, noting that their actions contaminated tableware and caused strong discomfort among the public.

The court also determined that the teens' parents had failed to fulfil their duty of guardianship and ordered them to bear the compensation costs, state media reported.

This includes 2m yuan for operational and reputational damage, 130,000 yuan to one of the caterers for tableware losses and cleaning expenses, and 70,000 yuan in legal costs.

However, the court ruled that any additional compensation Haidilao offered to its customers, beyond what they were billed, was a voluntary business decision and thus should not be covered by the teenagers.

Haidilao had offered to compensate more than 4,000 diners who visited the branch between February 24 – the date of their visit – and March 8, both with a full refund and cash compensation that is 10 times the amount they were billed.

They also replaced all hotpot equipment and stated they had conducted cleaning and disinfection works.

Haidilao has quickly expanded since its first restaurant opened in Jianyang, Sichuan province, operating more than 1,000 restaurants worldwide. The company is noted for its customer service and family-friendly atmosphere, offering amenities such as manicures and candy floss for children while guests wait for a table.