As online shopping has surged, traditional retailers have lost millions in sales to so-called showrooming — when shoppers check out products in stores that they then buy from Web sites like Amazon. It has gotten so bad that Best Buy even replaces standard bar codes with special Best Buy-only codes on big ticket items so they cannot be scanned and compared online.

Now some big retailers are taking a new approach to the dreaded showrooming by transforming their stores into extensions of their own online operations. Walmart, Macy’s, Best Buy, Sears, the Container Store and other retailers are stepping up efforts to add Web return centers, pickup locations, free shipping outlets, payment booths and even drive-through customer service centers for online sales to their brick-and-mortar buildings.

“We are living in the age of the customer, and you can either fight these trends that are happening — showrooming is one — or you can embrace them,” said Joel Anderson, the chief executive of Walmart.com for the United States. “We have a lot of assets, but they’re only assets if you embrace the trends of the customers.”

In making the changes, the big retailers are betting the future on shoppers like Sue Sheffer.

Ms. Sheffer, an information technology specialist in Bunker Hill, W.Va., shops for items like clothes, electronics and even coffee online. But she also likes to receive her purchases as soon as possible. When buying shelving from the Container Store, she ordered it on the Web in the morning and picked it up during her 30-minute lunch break that day. And there were no expensive shipping fees.