This study investigates customer loyalty in Iran's chain stores, with a particular emphasis on fresh food consumers. The research utilizes a combination of K-means clustering, a weighted RFM (Recency, Frequency, Monetary) model, and ordinal logistic regression to analyze customer behavior. Using real transaction data from 9,014 customers alongside questionnaire responses, the analysis categorizes customers into four distinct groups: very loyal, loyal, at-risk, and disloyal. The weighted RFM model indicates that recency is the most significant predictor of loyalty. Further, the ordinal logistic regression identifies several key factors influencing loyalty: age, marital status, income level, perceived food quality, preference for modern stores, and brand image. These all have positive affect on loyalty; on the contrary, the importance of price and a preference for packaging-free products negatively impact loyalty. These findings provide actionable insights for retail managers, enabling them to develop segment-specific strategies that enhance customer loyalty and strengthen competitiveness in Iran’s dynamic retail sector.