Drugstore chain Walgreens reached a deal with Attorney General Eric Schneiderman on Thursday after duping customers into paying more on certain products than was advertised.

The drugstore giant, which owns 465 Walgreens and Duane Reade stores throughout the city, will pay $500,000 in penalties and has agreed to reform its advertising process.

“Businesses are required to ensure that their advertisements are truthful and not misleading,” Schneiderman said in a statement. “When consumers purchase products at retail stores in New York, they should be able to rely on the prices displayed in advertisements and on shelf tags and not have to worry about being overcharged when they get to the register.”

The store was accused of playing with pricing in several ways, including displaying one price for products on shelves and in print ads as one price, but then charging a different one at the register. They would claim that deal had expired, but not been taken down.

They also would advertise to customers that a certain product was a “last chance” or “clearance” item, but keep it up on the shelf at that price for as long as 8 to 10 months in some cases, according to the AG’s office. The company agreed to no longer do this, as well as take down expired shelf tags.