Shoppers wait in a queue for Black Friday sales at a Target store in Newport, Ky., on Nov. 23, 2018. (John Minchillo/AP)

Laura Byrne Paquet is the author of “The Urge to Splurge: A Social History of Shopping.”

We like to tell ourselves that in some past era, humans celebrated events that had real meaning: harvest festivals and national holidays, Christmas and Yom Kippur, Diwali and Ramadan. Only in recent years, we grumble, have our big events been tainted with commerce. Americans scarf down turkey in between the Macy’s Thanksgiving Day Parade and Black Friday. Come summer, they wave a flag briefly on the Fourth of July but spend hours preparing to snag bargains on Amazon Prime Day. (Amazon’s founder, Jeff Bezos, owns The Post.)

But this halcyon past is more distant than we imagine, if it even existed at all. Shopping and religion have long been tangled up in each other, and not merely in America.

Shopping has had quasi-ritualistic overtones for much longer than most of us realize. In medieval England, markets sprang up in churchyards on Sundays. By the 1500s, the deans of St. Paul’s in London were irritated by tailors, scriveners and souvenir hawkers cluttering up the nave itself, and the Court of Common Council of London had to ban shoppers from bringing their horses into the cathedral.

Meanwhile, vendors at the annual Stourbridge Fair near Cambridge, founded in 1211 , were selling glass from Venice, iron from Spain, porcelain from Asia and a huge range of other goods. These rare products drew hordes of shoppers, and the fair grew rowdy. By 1548, the town crier was pleading with attendees to “keepe the Kings peace” and to “leave theire weapons at theire Innes.” In 1705 , when one of the recently founded newspapers announced the fair’s amusements, including an opening procession, horse races and taverns, attendance spiked.

It was a valuable lesson for later retailers: Spectacle plus publicity equals crowds. And since few human institutions have been better able to manufacture spectacle than religion — with its artworks, music, monuments and rituals — merchants learned from the masters.

Many of the enclosed shopping complexes built in the 19th century, such as Milan’s Galleria Vittorio Emanuele II, boast domes, vaulted corridors and other church-like flourishes. In Philadelphia in 1911, devout Presbyterian John Wanamaker made the connection even more overt by installing a giant pipe organ in his flagship department store (now Macy’s Center City). And when Macy’s launched its namesake parade in 1924 , it was echoing a tradition that stretched back through the Stourbridge Fair’s opening procession to the traditional Palm Sunday events that re-created Jesus’ walk into Jerusalem.

George Ritzer, a sociology professor emeritus at the University of Maryland, coined the term “cathedrals of consumption”  for places such as megamalls, theme parks and big-box retailers. Like religious sites, they often combine massive size with theatrical flair, whether you’re watching a Vitamix demonstration at Costco or fireworks exploding above Cinderella Castle at Walt Disney World. At the same time, like a priest hidden in a confessional, they maintain some mystique about how they pull off the effect; most Disney visitors don’t realize it takes an army of Imagineers to keep the crowds moving smoothly.

Ritzer notes that the virtual equivalents of Costco and Disney have taken scale and spectacle to a new level. On Amazon, the choices are endless and products arrive overnight or close to it, as if by magic. Unless prompted by a disruption such as a strike, most shoppers rarely think about the mechanics of the process.

When retailers add a dash of ritual to their events, the profits can be enormous. With its weeks of advance promotion and overnight campouts , followed by a day of celebration, Black Friday follows a rhythm that eerily recalls the Catholic pattern of Lent, Easter Vigil and Easter Sunday. Perhaps that’s why Black Friday has taken root in countries that don’t celebrate Thanksgiving but do have long Christian traditions, such as Britain and Germany.

 Similarly, Amazon Prime Day is marked by weeks of hype, followed by a midnight start and a short but intense shopping frenzy. It rang up an estimated $4.2 billion in worldwide sales in 36 hours in 2018. This year, it will last 48 hours and showcase brands endorsed by celebrities, our culture’s secular saints. Comedian Jane Lynch even kicked off a promotional concert for Prime Day by enthusing about membership in Amazon’s Prime service, as if two-day shipping bundled with music and video services represents a kind of transcendent lifestyle.

But it’s not just the trappings of religion that modern consumer culture has appropriated. Some observers believe shopping has become a substitute for belief itself. As British philosopher Julian Baggini wrote, “Preachers seduce us with the promise of a better life to come, advertisers with the promise of a better life to come right now. Both offer an escape from the mundane reality and endless striving that real life is made of.”

Throughout history, religion has also offered its followers something all humans crave: a sense of community. If you went to the right ceremonies and wore the right things, you could be on the team. These days, for many, the entry ticket into a club of like-minded believers isn’t a yarmulke, crucifix or hijab, it’s the latest Nike Adapt BBs. And if you buy them on sale, even better.