If you can't beat 'em, partner with Google.

Walmart (WMT) is getting ready to go toe-to-toe with Amazon (AMZN) on voice shopping, teaming up with Google (GOOGL) to enable people to order its products through Google Assistant.

Walmart is trying "to simplify people's lives and help them shop in ways they've not yet imagined," Marc Lore, who heads Walmart's e-commerce efforts, said in a statement Wednesday.

The partnership is a direct challenge to Amazon's voice shopping with Alexa, which the company has been heavily pushing with promotions and discounts. It's also the latest example of how online shopping is forcing tech firms and traditional retailers to pool their resources.

Related: Walmart is buying Bonobos

Shoppers on Google Express, the tech company's online shopping mall, will soon have access to hundreds of thousands of Walmart products that they can buy through voice using devices equipped with Google Assistant, like Android phones and Google Home.

The two companies are betting that voice shopping will play a key role in the future of online retail. The idea is that busy shoppers will happily allow artificial intelligence to sort out their shopping carts for them.

Like Amazon shoppers who use Alexa, Walmart shoppers who link their accounts to Google will be handing over data on their shopping habits, making it easier for Google Assistant to anticipate what you're trying to buy based on past purchases.

Teaming up with Google is part of Walmart's larger strategy to expand its online footprint in the fight against Amazon. The approach appears to be paying off: Walmart reported a 60% jump in e-commerce sales last quarter compared to the same period last year.

Related: Germany's Aldi takes on Amazon in food delivery fight

In another direct challenge to Amazon, Walmart also said Wednesday it will be introducing voice shopping to fresh grocery purchases across the U.S. sometime next year.

Amazon shocked the retail world by announcing its $13.7 billion purchase of Whole Foods in June. Whole Foods shareholders vote Wednesday on Amazon's offer to buy the organic foods grocer.

And Germany's Aldi, which operates nearly 1,700 stores in America, said last week it's partnering with San Francisco's Instacart to deliver groceries in Los Angeles, Atlanta and Dallas.