According to some analysts, the decline in Walmart’s stock on the back of a disappointing earnings warning creates a great opportunity to buy shares of the retail giant. Walmart on Monday cut its second-quarter and full-year earnings forecasts as it struggles with rising inflation and a shift in consumer spending, in a move that sent the retailer’s shares down more than 8%. To be sure, many analysts believe the results will spell trouble for Walmart and other retailers going forward. However, shares are undervalued at these levels, according to Michael Lasser of UBS, who rated Walmart as a buy with a target price of $152. Analyst Stifel Mark Astrachan (contract at $145) similarly believes that the stock’s reaction on Tuesday could create a potential “offsetting event” for Walmart. He said he expects the second quarter to be “low” for gross margins going forward, but maintained a hold rating for the stock. Despite the near-term troubles, BMO Capital Markets’ Kelly Banya (outstanding, $160) expects Walmart to bounce back and produce a “more consistent earnings growth cadence” going forward. “While this announcement was disappointing and highlights how poor visibility persists across the consumer landscape, we continue to see WMT’s share price as attractive to a global retailer on a scale that is difficult to replicate and best-in-class price setting,” Banya wrote of Pieces Guidance . Jefferies’ Stephanie Wesink (buy, $150) considered the adjustment a “necessary hard reset” and maintained a buy rating on the stock. “While we don’t like evidence from a company we think has a slack advantage, we see this review as more realistic compared to the previous one,” Wesink wrote. Despite the earnings warning, many analysts believe Walmart remains in a better position than its peers in the current economic environment. According to Kate McShane of Goldman Sachs (buy, $135), many of the current cost pressures are likely only temporary and the company’s long-term trajectory should prevail. Meanwhile, Walmart continues to gain market share in the grocery segment, indicating that consumers are relying on the company in this challenging landscape, said Baird’s Peter Benedict (outstanding, $140). He said the latest move could signal a push to “clear floors” and get rid of Walmart’s inventory risk on the back of John David Rainey’s start as chief financial officer. “However, we maintain our buy rating as we believe risks and estimates have been eliminated and WMT appears to be capturing market share in the current environment which should be flat,” said Michael Baker at DA Davidson (PT $148) in a note to clients. . “This should lead to better sales while margins recover in 2023 once inventory rights are up.” CNBC’s Michael Bloom contributed to the report.