Hershey may have gotten a boost as we stockpiled Halloween candy, but the outlook for the near future becomes cloudy as a confluence of events impacts prices.

The ebola virus may yet eviscerate the chocolate market if not brought under control, and the ripple effect it will have on confectioners like Hershey (NYSE:HSY), Mars, and Tootsie Roll (NYSE:TR) could be significant.

The 8% price hike Hershey announced this past summer, unrelated to the virus's spread, weighed on the disappointing earnings results the chocolate maker reported last week, and it expects that pressure to continue with lower volumes through the fourth quarter and on into 2015.

The ebola virus has played a minimal role so far in the candy industry's fortunes, but that doesn't mean it won't take a significant lead in the very near future, so it's critical that every dividend investor understand these six things about Hershey.

 1. Three quarters of global production comes from west and central Africa
According to the World Cocoa Foundation, the four west African countries of Cameroon, Cote d'Ivoire, Ghana, and Nigeria account for 73% of the world's cocoa production, and though Nigeria was hit with a few cases of Ebola, it was able to quickly snuff out the virus's spread. The Ivory Coast, which alone is responsible for 40% of production, or 1.65 million metric tons, hasn't had a single case reported yet.

The higher prices being felt now are the result of a lack of modern farming techniques because 80%-90% of cocoa is produced on small, family farms. It's not cost efficient for them to introduce such practices.

2. The ripple effects of the Ebola virus will soon be felt though.
Farming practices explain the current de minimis impact the virus has had on chocolate prices and the fact the vast bulk of Ebola cases are in Sierra Leone, Liberia, and Guinea. But the Ivory Coast just sealed its borders to protect against the contagion entering the country and that's keeping cocoa farm workers from getting to their jobs. Without the workers to harvest the crop, prices will rise.

The price of cocoa gives no indication of melting anytime soon. Data: International Cocoa Organization.

Further, neighboring Ghana is responsible for another 880,000 metric tons of cocoa, about 15% of global production. Like Ivory Coast, it also hasn't had a confirmed Ebola case yet, but should one be found in either country, expect to see the price of cocoa spike.

3. Higher dairy costs are a more immediate problem for the chocolate makers.
A gallon of milk is now more expensive than a gallon of gas as oil prices have fallen through the floor with U.S. crude prices falling as low as almost $75 a barrel. Fluid milk prices, on the other hand, are 19% higher than they were last year, and production, though down from recent highs, remains 4% above the year ago level.

Dairy was the primary factor driving Hershey's costs higher, and they were able to offset much of the expense increase by raising its prices, though even management admits there remains a "risk element" to the commodity.

4. Nut prices are also higher, making it a commodity triple play.
The Agriculture Dept. says September almond prices are more than 13% higher than they were in 2013, which was a month when they were 24% above the level they traded at the year before. Walnuts are almost 18% higher.

A persistent drought out west has hampered the ability of farmers to water their nut trees, and though they've been diverting water from annual crops like tomatoes to their trees, which take a much longer time to grow and produce, it has been applying pressure to the industry.

5. Chocolate makers are financing Ebola relief efforts.
Because the Ebola virus represents a long term threat to their profitability, chocolate companies have been financially supporting the fight against the virus. The World Cocoa Foundation, representing the likes of Hershey, Mars, Ghriadelli, and Nestle (OTC:NSRGY) announced more than $700,000 in donations have been made.

But Hershey maintains that cocoa stocks remain sufficiently supplied that even if there is a worsening situation with Ebola, it would be able to maintain its supply into 2015 and will source cocoa beans from Ecuador, Mexico, Peru, or the Dominican Republic if needed.

6. Hershey has paid dividends for over 80 years
Starting in 1931, the chocolate maker has continuously made quarterly payouts to investors without fail and even in the face of a ravaging disease there is no risk to the payout at present. Indeed, for 25 consecutive years, Hershey has increased its dividend and there is no indication it doesn't have the financial wherewithal to continue doing so.

HSY Dividends Paid (TTM) Chart

HSY Dividends Paid (TTM) data by YCharts

No longer a chocolate mess
Still there is no relief in sight on any of Hershey's cost fronts. The Ebola virus remains a constant threat and the U.N.'s special envoy on the contagion says in certain areas "the outbreak is continuing to expand rapidly." The dairy market suffers from overcapacity as consumption declines because of the price support program kept in place by the government. Coupled with a drought that's also impacting nut production, and it's a perfect confluence of conditions that will cause chocolate prices to rise.

If the past is any indication of a future course of action, expect Hershey and the others to raise prices to protect their profits, but we'll likely see that hurt volumes again.

Hershey has contracts in place that protected its cocoa prices through the end of the year and with rising global demand for chocolate -- another factor affecting prices -- the confectioner remains in good stead and still holds a lot of promise as a key stock for dividend investors.