A Walmart in-store pick-up tower.

While other retailers are having trouble luring shoppers to their stores, Wal-Mart Stores Inc. on Thursday said its comp-store traffic for second-quarter 2018 rose 1.3 percent and comparable-store sales increased 1.8 percent for the period ended July 28, marking the 12th consecutive quarter with positive comp sales.

The world’s largest retailer beat Wall Street estimates of $1.06 a share, posting on Wednesday adjusted earnings per share of $1.08. Revenues rose 2.1 percent to $123.4 billion in the second quarter ended July 28, from $119.4 billion in the 2016 period. Net income fell 23.2 percent to $2.9 billion in the second quarter from $3.8 billion in the 2016 period.

Sam’s Club delivered comp-store sales growth of 1.2 percent, while traffic increased 2.1 percent. Nine out of 11 of the company’s international markets posted positive comp sales, with five markets growing comps by more than 5 percent.

Wal-Mart’s U.S. sales growth of 3.3 percent in the second quarter lags behind July’s retail sales year-over-year increase of 3.5 percent, reported by the National Retail Federation.

Wal-Mart president and chief executive officer Doug McMillon said the retailer continues to gain traction in e-commerce, with walmart.com gross merchandise volume up 67 percent in the U.S., with an expanded assortment that surpassed 67 million sku’s.

“Our recent acquisitions such as Moosejaw, Shoebuy and Bonobos have further improved our assortment and provided critical category expertise in higher-margin categories like shoes and apparel,” McMillon said, adding that he recently visited in Boston the Shoebuy team — now known as Shoes.com. “They were very engaged and really impressive,” he said. “In addition, I was excited to visit in July with the Moosejaw team in Detroit. This talented group is thriving in their creative culture and it was great to hear what they’re working on.”

Wal-Mart has rolled out online grocery capabilities to 900 stores, McMillon said, adding that it’s expanding the service to several international markets.

Craig R. Johnson, president of Customer Growth Partners, said Wal-Mart’s high penetration in grocery — 56 to 57 percent — leaves the retailer “highly vulnerable to Aldi and Lidl.”

“Wal-Mart’s been struggling with apparel,” said Johnson. “It’s been losing share to TJX, Ross Stores, Costco, Gap, Old Navy and Target, which has done a great job with kids with Cat & Jack. It’s replacing two big brands that were tired, Merona and Mossimo, with new labels. Wal-Mart needs to step up the pace.”

Wal-Mart’s acquisitions of Shoebuy, Moosejaw, Modcloth and Bonobos are a good idea, Johnson said, adding, “That’s how Amazon got ramped up, with Zappos. Those acquisitions will help, but apparel is just 7 to 8 percent of the total business.”

Chief financial officer Brett Biggs made a pointed dig at Amazon, saying, “Customers love not having to pay a membership fee to get Wal-Mart’s free two-day shipping on millions of items. Marc Lore, [president and ceo of Wal-Mart U.S. e-commerce,] and his team delivered another quarter of robust top-line growth. The majority of this growth was organic, through Walmart.com, as customers are finding a broader assortment and more options to receive what they want at their convenience.”

One such option offers discounts to shoppers who buy online and pick up their nonstore items at local stores. “We’re seeing a nice increase in customers receiving discounts,” Biggs said.

Gross profit margin in the second quarter decreased 11 basis points. Strategic price investments in key markets and the growing mix of the e-commerce business reduced the gross margin rate. SG&A de-levered by 10 basis points in the period, primarily due to increased technology spending and impairment charges related to Sam’s Club.

Wal-Mart U.S. for the third quarter ending Oct. 27 is expected to increase comps between 1.5 and 2 percent, while Sam’s Club comps will rise 1 to 1.5 percent. The retailer raised its full-year adjusted EPS forecast to $4.30 to $4.40, which includes a range of 90 cents to 98 cents for the third quarter. This compares to previous EPS guidance of $4.20 to $4.40 for the full year.

Wal-Mart stock closed at $79.70, down $1.28 or 1.58 percent on the New York Stock Exchange.