After the pandemic began to subside in 2022, online shopping habits continued, even becoming a new habit. Even today, many shop owners are disappointed because their shops are no longer full of visitors, and this must be anticipated by entrepreneurs to shift their business online. The aim of this research is to examine the effect of social media marketing on purchase intention, either directly or through the mediating role of emotional attachment. This study used a sample of 220 respondents, and data were analyzed using the Structural Equation Model (SEM) to determine the direct effect and using the Bootstrapping method to examine the role of mediation. The results of this study indicate that social media marketing does not have a direct positive effect on purchase intention, but social media marketing has a positive effect on emotional attachment, and emotional attachments have a positive effect on purchase intention. This study also shows that emotional attachment has a role as a mediating variable from the positive influence of social media marketing on purchase intention.