The right way to have amplified speakers that mute when you plug in earphones
The headphones may be connected to the amplifiers, through attenuators, with a DPDT switch to select speakers or headphones.

Since the PAM8301AAF output is for an 8Ω speaker, the sum of R1 and R2 should be 8Ω. The choice of R1 &amp; R2 values would depend on the level of attenuation required. 1W resistors would suffice.

The schematic shown is for one channel.

 

With the PAM8301AAF outputs to be kept isolated between themselves and ground, a standard headphone plug/jack cannot be used. 

Separate mono headphone plugs/jacks, with separate cables for each headphone element, would be required for the isolation.