Several core-flooding-based experimental studies demonstrated the effect of calcium and magnesium ions and it is found that these hard ions have detrimental effects on oil recovery during chemical-enhanced oil recovery operations. However, studies regarding the coupled effect of hard ions and surfactant adsorption are very limited. Thus, this study aims to present a novel approach that can capture mineral-brine, brine-oil, and brine-surfactant interactions in the presence of hard ions (Ca2+ and Mg2+). Also, we introduced four oil-surfactant-based surface complexation geochemical reactions (SCGR) in the presence of hard ions for the first time to analyze the oil-surfactant interactions. The developed thermodynamic-based geochemical model is compared and validated with recent core-flooding data. Our results illustrate that the use of oil-surfactant SCGR is important and should be captured for detailed surfactant adsorption. Thus, we observed that in the presence of hard ions, surfactant adsorption increases with the increase in temperature, which is due to the surge in kinetic energy. We also observed that a reduction in hardness reduces the adsorption of surfactants. Additionally, increasing surfactant concentration led to a minor increase in the adsorption of surfactant with a significant increase in its concentration in the discharge/effluent. Therefore, the hard ions (Ca2+ and Mg2+) concentration has a substantial negative effect, as they reduce the solubility of surfactant and increase its adsorption. Furthermore, the lowest level of surfactant adsorption was accomplished by injecting ten times diluted water (<0.070 mg/g).