C’mon, you deserve it. (Photographer: Patrick Fallon/Bloomberg)

Online shopping, curbside pickup and self-checkout aisles have made it quicker and easier than ever for Americans to buy the things they need. That’s a huge problem for the candy and chocolate industries, which have made billions over the years off waits at the register — and customers’ last-minute impulse buys.

Those lost “instant consumable” sales, combined with “a more competitive snacking environment,” helped slow the Hershey Co.’s sales last year below expectations, the sweets company said Thursday.

So to get Americans splurging again, the country’s biggest chocolate maker is investing heavily on technology that would spread its temptations far beyond the traditional checkout, hoping to re-inspire a sweet tooth that might expand the company’s bottom line.

“Impulse, in an indulgent business, is really important. … But shopping is changing, and impulse is under threat,” said Frank Jimenez, Hershey’s senior director of retail evolution. “What happens if and when the checkout goes away?”

Shoppers moving too quickly to crave has become a worrying trend for the five “power” sectors of the supermarket checkout: sweets, snacks, drinks, magazines and health-related flotsam, like lip balm. Though tiny, the grab-and-go items are incredibly lucrative: Checkout areas account for 1 percent of a typical supermarket’s merchandising space but 4 percent of its profit, Jimenez said.

Yet few companies are leading the charge to win back impulse buys like Hershey, whose Reese’s, Kit Kat, York, Almond Joy and namesake bar account for the biggest chunk of America’s $17.7 billion chocolate market.

At a meeting of retail executives in New York earlier this month, Hershey senior manager of front-end experience Chris Witham outlined some of the ways the company planned to win back “unplanned purchases,” with tests starting this year.

For curbside grocery pickups, Hershey could upgrade kiosks or add menu boards to allow buyers one final candy grab before finishing their order. At self-checkout machines, shoppers could find a special dispenser that spits out chocolate bars on demand. The company could also dispatch an army of vending machines to grab shoppers outside the store, including, potentially, looking to “some dispensing opportunities around [gas] pumps,” Witham said.

Hershey has sponsored research into what makes the world’s shoppers reach for chocolaty gratification, and Jimenez says they created what they call the “Eight Human Truths of Impulse” to explain why people succumb to little checkout-aisle urges. The goodies can delight, indulge, recharge or “rescue”; they can spoil (“I worked hard today”) or charm (“That’s a great idea”); they can lead shoppers to aspire (as with food or fitness magazines); or they can simply convince buyers they’ve scored on a good deal.

With chocolate, “people come to the category as a ‘reward me’ category. They know it’s indulgent. It’s not a food group,” Hershey chief executive John P. Bilbrey said on a call with analysts last summer. “So as we think about the future, we’re thinking about the total snacking continuum.”

The key metric for sellers at mass retailers’ “front end” has always been “dwell time”: The longer shoppers wait at the “pay point” surrounded by a colorful hoard of snacks and sweets, the greater the chance they’ll grab one of those little treats to buy.

But that pause is getting shorter as technology erases checkout aisles’ lucrative inefficiencies. Supermarkets are rapidly expanding in-store pickup of online orders and even curbside grocery pickup, both of which skip the gossip mags, candy and gum. Kroger, America’s largest supermarket chain, has even tested high-speed, barcode-scanning “checkout tunnels” that would allow shoppers to escape largely unindulged.

Perhaps the most egregious offender of the impulse buy has been self-checkout aisles, which supermarkets first turned to for lower labor costs and now account for about 40 percent of all mass-retailer sales. The supermarket world, and the providers of its treats, have lost billions of dollars on impulse opportunities since the largely unadorned self-checkouts first beeped in 1992, Jimenez said.

Glomming back onto the end of the shopping list will take more than just one-off upgrades, and Jimenez said it would take an industry-wide effort tantamount to “retrofitting America.” Late last year, Hershey began running an experiment at a Winn-Dixie in Baton Rouge, replacing the old candy aisle with a bright, sugar-filled “store within a store” of grab-and-go sweets, placed right next to the checkout aisles.

“A majority of shoppers find the candy category the hardest to shop and the least inspiring in the store, resulting in many shoppers walking away without any confection in their basket,” said Rick Price, Hershey’s senior manager of center store evolution. The “re-imagined candy aisle,” he said, “makes candy shopping more convenient and memorable.”

There are distractions Hershey might be powerless to dispel, including the industry-wide annoyance of shoppers staring at their cellphones rather than the checkout stands. But the industry’s biggest fight is simply over visibility. All candy companies say they need to do is put the sweets within arm’s reach. Amenable shoppers will do the rest.

As Tommy Scheiman, the owner of B.A. Sweetie Candy Co., told Candy & Snack Today magazine in 2012, “People start in the produce section and see the colors, the selection and ‘boom,’ it’s in the shopping cart.”