The effect of magnetic fields on the solidification of a droplet impacting a substrate, and its potential for controlling the topology and properties of the final solidified splat, has not been explored thus far. In this research, we conduct a computational study on the solidification of a metallic alloy droplet impacting onto a substrate under the influence of a magnetic field, for the first time. Our model undergoes rigorous assessments through a systematic procedure to avoid error-hiding of different sub-models. We investigate the effects of applying direct and alternating magnetic fields with different Strouhal numbers (or dimensionless frequencies). Our findings demonstrate that MagnetoHydroDynamics (MHD) can effectively control the shape of the frozen splat upon impact. Depending on the interplay between the inertia and capillary forces as well as the MHD braking and shaking effects (damping and oscillating Lorentz forces), we achieve a hemispherical, oblate, prolate, or cupcake solidified splat topology. Additionally, we identify a critical Strouhal number at which the solidified splat-shape parameters reach an extremum. Our analyses reveal two distinct causes underlying this phenomenon at low or moderate Weber numbers. At low Weber numbers, the resonance triggered by the proximity of the MHD actuation frequency and the capillary natural frequency of the splat is the determining factor. On the other hand, at the higher Weber numbers, the severe droplet regime changes and instability play a key role.