Walmart (WMT) - Get Report  customers can start ordering groceries by voice using Google's smart-home assistant as soon as April as the company ramps up the competition vs. Amazon (AMZN) - Get Report , whose Echo allows customers to voice-shop for groceries from Whole Foods via its Alexa smart assistant.

Voice shoppers can add items directly to their online Walmart shopping carts by saying "Hey Google, talk to Walmart." Prior orders and brand preferences will be in the cue, said Tom Ward, Walmart's senior vice president of digital operations, in a blog post Tuesday.

Walmart shoppers will be able to order groceries for pickup (around 13% of Walmart shoppers use curbside pickup, according to Cowen), and home delivery through Google Assistant in more than 2,100 Walmart stores. They can use online delivery services at more than 800 Walmart stores.

The agreement makes for a surprising pairing since Walmart walked away from Google's shopping platform earlier this year.

Groceries make up about 50% of Walmart's annual sales, but voice-shopping makes up a tiny fraction of retail spending, according to analysts. Of that fraction, Amazon's Echo dominates, accounting for more than 60% of smart speaker sales, according to market researcher eMarketer.

Walmart shares were down slightly Tuesday to $97.90, while Amazon shares slipped 0.08% to $1,812.70.