Companies from McDonald’s to Walmart have recently flocked to cage-free eggs, fueling a national sales boom for a product many believe is more humane.

But in Iowa, the country’s largest egg-producing state, there are fears that the trend has gone too far. And this week, lawmakers there passed a bill that would require many stores to stock eggs from caged chickens — a move designed to stop retailers from phasing them out.

Although the law would only apply to stores’ Iowa locations, it’s intended to address a growing national dilemma. The country’s largest grocery chains have committed to cage-free eggs, sending shock waves through the industry — but consumers aren’t buying like they expected.

Supporters of the bill argue animal welfare groups have shamed grocery stores into offering a product consumers don’t want. They have framed the legislation as a needed counterweight to welfare groups’ growing influence.

Those groups, meanwhile, have accused lawmakers of shilling for Iowa’s agribusiness interests.

“This is definitely one of the most bizarre things I’ve seen in my years monitoring these sorts of bills,” said Cody Carlson, a staff attorney with the animal welfare group Mercy for Animals. “The idea of forcing private businesses to sell a specific product is pretty unprecedented.”

The new legislation would not literally force stores to sell conventional eggs — though people involved in drafting the bill say it could eventually have that effect. As written, the legislation requires that stores carry conventional eggs if they participate in the Special Supplemental Nutrition Program for Women, Infants and Children, better known as WIC.

That won’t have much immediate impact on retailers, said Michelle Hurd, the president of the Iowa Grocery Industry Association. Under current rules in Iowa and other states including California, Texas, New York, Florida and Illinois, WIC recipients can use their benefits only on conventional eggs. That means WIC retailers such as Walmart, Target and CVS are required to stock them already.

But in recent years, those chains and dozens of others have promised to go cage-free within the next decade, following calls by consumers and animal welfare advocates. To fulfill those promises, stores will have to withdraw from the WIC program or persuade state agencies to change the rules for WIC.

That raises the possibility that, in many stores, conventional eggs will soon no longer be available. And that has worried lawmakers and farmers, said state Rep. Lee Hein, who chairs Iowa’s House Agriculture Committee. To wit, the new bill was championed by a group called Iowans for Consumer Choice, which represents state egg producers, and endorsed by the Iowa Poultry Association.

Hein said he fears that Iowa egg-producers are being forced to convert to expensive cage-free systems, at a cost of $40 to $50 per hen. He also questions how families will afford eggs when cage-free or free-range is the only option.

According to the Department of Agriculture, a dozen large, cage-free, Grade A eggs costs $2.35, while conventional cost $1.47. The price gap appears to be taking a toll: In October, the country’s largest egg producer cut its cage-free output, citing low demand. Producers and retailers have been forced to heavily discount the eggs to move them.

“Some of our larger grocery stores have basically bowed over to the animal rights groups and committed to going cage-free only by 2022 or 2025,” Hein said. “And the consumer isn’t really having a say in it.”

Animal welfare groups dispute these claims — particularly the idea that cage-free eggs are too expensive for consumers or businesses. That may be the case now, Carlson acknowledged. But as more producers go cage-free, the price of eggs will naturally drop as a result of competition.