This paper is concerned with the development of a high-order numerical scheme for two-phase viscoelastic flows. In the companion paper, herein referred to as Part 1, the scheme is applied to the modelling of two-phase Newtonian flows. The particular problem of the collapse of a 2D bubble in the vicinity of a rigid boundary is considered. Attention is given to the construction of the most general form of the compressible Oldroyd B model that is consistent with the compressible Newtonian and upper-convected Maxwell models in the appropriate limits. The governing equations are discretized using the spectral element method, and the two phases are modelled using a marker particle method. A comprehensive set of results is presented for the problem of bubble collapse near a rigid wall, and qualitative agreement is obtained with other numerical studies and experimental observations. Viscoelastic effects that are predicted include increased bubble oscillation with increasing Weissenberg number and considerable bubble deformation and cusping near the wall. Most importantly, it has been shown that viscoelasticity has the ability to prevent jet formation and therefore is likely to have a mitigating effect on cavitation damage. Copyright © 2012 John Wiley & Sons, Ltd.