A police officer was attacked in a supermarket car park while dealing with a domestic incident.