If you think chocolate prices this Valentine’s Day were more expensive than usual, it’s not you. The price of cocoa , the key commodity used in chocolate, hit a record high last week at $5,798 per ton. Year to date, futures contracts are up nearly 27%, with cocoa prices rising in six of the past seven weeks. Those gains have been driven by major weather changes that have raised supply concerns for the commodity. Adding to those worries is an outbreak of cacao swollen shoot virus, which has compromised a chunk of global cocoa supply. “The changing weather patterns means that the potential yields of cocoa are now permanently impaired,” Humza Hussain, a commodities analyst at TD Asset Management, told CNBC last week. These gains can be a double-edged sword for chocolate makers such as Hershey and Mondelez . On one hand, they let these companies raise prices. On the other, in some cases, it may force them to raise prices beyond what consumers are willing to pay, leading to a sales blow. Here’s a breakdown of what’s driving cocoa prices higher and how it impacts the investment case around two major chocolate stocks. Weather and other factors Dry weather conditions induced by El Niño in Ghana and the Ivory Coast — the two main cocoa-producing regions of the world — have recently threatened local soil moisture levels. Therefore, an especially intense El Niño effect could reduce the amount of arable land available for cocoa cultivation , threatening the crop’s production yield. Compounding the problem are the reported wildfires in Nigeria that could potentially damage the area’s cacao crops, Citi analyst Aakash Doshi wrote. But even more than adverse weather patterns, rising cases of the cacao swollen shoot virus have impaired cocoa supply in the past six to nine months. “The prospects of ENSO [El Niño–Southern Oscillation] neutral weather conditions is long-term supportive of a production rebound. But it appears containing the spread of the swollen shoot virus as well as grappling with EUDR (de-forestation) regulation to source more environmentally friendly cocoa beginning with 2025 sales is the imminent focus right now,” Doshi said. Bernstein analyst Bruno Monteyne also thinks cocoa prices can maintain this upward trend in part due to rising emphasis on more “sustainable” chocolate, from both an environmental and human rights standpoint. “Cocoa prices are only running at half the level that you need to give the farmers a half decent life,” he told CNBC. “Cocoa prices have gone nowhere for decades … There’s been an unsustainable multi-decade decline. Pressures are coming from Europe at least, so in the long term prices need to go up anyway.” Citi’s Doshi is less sanguine on the commodity going forward. Doshi thinks cocoa prices could sell off about 20%, taking them to around $4,500 to $4,800 per ton. “Broader DM recession, demand destruction, and substitution effects should also become more meaningful by 2H’24 to balance the forward market outlook and enhance prospects of a wide 2025/26 surplus,” he wrote. Analysts stand divided on Hershey’s future Against this backdrop, Wall Street analysts are divided on how much rising cocoa prices could hurt major chocolate confectionary manufacturers, such as Hershey and Mondelez. Bernstein analyst Alexia Howard upgraded shares of Hershey last month to outperform from market perform. She cited the company’s strong pricing power, attractive share valuation, and improving volumes and market share due to new product rollouts. Howard’s price target of $235 implies the stock could rally nearly 21% over the next year. HSY YTD mountain HSY YTD chart Hershey received a boost earlier this month after the company reported a fourth-quarter earnings beat. However, the company’s full-year guidance came in below analyst expectations, and Hershey also reported a 6.6% drop in year-over-year sales for its fourth quarter. “Given where cocoa prices are, we will be using every tool in our toolbox, including pricing, as a way to manage the business,” CEO Michele Buck remarked. Bernstein’s Howard noted that the consequences of cocoa cost inflation might not be clearly notable at first due to Hershey’s long hedges on cocoa prices, which lock in prices for at least a year. “Depending upon how they adapted their forward purchasing strategy in the first half of 2023 before the cocoa prices started to take off, it could be impacting some part of 2024 or 2025,” she told CNBC. Ultimately, Howard thinks that Hershey’s strong pricing power and product lineup should protect the stock against any lasting effects in cocoa price increases. And although some investors have grown concerned how the rising usage of GLP-1 weight loss drugs could impair snack companies like Hershey, Howard says that the potential implications are smaller than one might think. “It’s unlikely to be the disastrous scenario that that I’d been worried about earlier,” she said. “With that innovation and that pricing power, Hershey will probably be able to drive decent price and mix growth from trading people up to higher price products that will help to offset the volume pressures that they might see through the GLP-1 usage coming up.” On the other hand, Bank of America analyst Bryan Spillane downgraded Hershey to neutral from buy in December. In an interview with CNBC last week, he underscored the rising cocoa price outlook as the key driver for his lower rating. He thinks the combination of demand destruction and too many price increases in the past few years could impair the company’s gross margins. Spillane’s updated price objective for the stock, decreased to $200 from $250, sees shares of Hershey rising 2.6%. Morgan Stanley also downgraded Hershey on Monday to an underweight rating, citing steepening cocoa prices and the stock’s exposure to GLP-1 weight loss drug adoption as primary headwinds. “We are cautious on HSY’s midterm outlook given outsized cocoa inflation, a tougher pricing environment & weaker consumer demand for confectionery & popcorn,” wrote analyst Pamela Kaufman. What about Mondelez? As for Mondelez, analysts think the company should be able to weather the storm. Bank of America’s Spillane and Bernstein’s Howard both have buy-equivalent ratings for Mondelez due to the company’s more diversified portfolio. In addition to manufacturing chocolate for brands such as Cadbury and Milka, Mondelez’s portfolio also includes brands such as Ritz and Sour Patch Kids. MDLZ YTD mountain MDLZ ytd chart Cost inflation in cocoa prices is “less of an issue” for Mondelez since the company has only about a third of its business in chocolates, Howard said. Additionally, the company has taking proactive measures to raise its European prices. “Mondelez has a lot of volume opportunity in the emerging markets and so on, so not too concerned”, she added. “[Rising cocoa prices] are obviously going to pressure the percentage margins but as long as the gross profit dollars remain fairly intact globally,” the stock should stand on solid footing.