Red-hot inflation threw a wrench into the gears of the global economy last year, causing the S&P 500 to nosedive into a bear market. In fact, the broad-based benchmark delivered its worst performance of the past decade in 2022, and the index is currently 21% off its high. But investors can sleep a bit easier knowing that every bear market has ended in a new bull market, and there is no reason to believe this situation is any different. That means the next bull market is almost certainly on its way.

In the meantime, many magnificent stocks are begging to be bought. For instance, Shopify (SHOP 0.92%) and Cloudflare (NET 1.60%) saw their share prices plunge 79% and 80%, respectively, from all-time highs and both stocks currently trade at sizable discounts to their historical valuations.

1. Shopify: The leading e-commerce software

Shopify makes omnichannel commerce easy. Its platform supports sales across physical and digital storefronts, including online marketplaces, social media, and direct-to-consumer (DTC) websites. The company also provides adjacent merchant solutions for payment processing, marketing, financing, and many other aspects of commerce. That broad product offering has carried Shopify to the top of the industry. It ranks as the most popular e-commerce software vendor in terms of market presence and user satisfaction, according to research company G2.

Like many retailers, Shopify struggled amid the inflationary environment. Rising prices simultaneously caused a deceleration in consumer spending and an acceleration in operating expenses, leading to disappointing financial results. Third-quarter revenue increased just 22% to $1.4 billion -- a material deceleration from 46% growth last year -- and the company reported a non-GAAP loss of $0.02 per share, down from a non-GAAP profit of $0.08 per share.

Not all the news was bad, though. Shopify's merchant attach rate -- merchant solutions revenue as a percentage of gross merchandise volume (GMV) -- rose to a record 2.14%, indicating that merchants are deepening their relationships with Shopify. Also noteworthy, offline GMV rose 35% as Shopify continued to gain share in physical retail, and Shopify Plus GMV once again outpaced total GMV as the company continued to gain momentum with larger sellers.

Looking ahead, Shopify shareholders should expect growth to reaccelerate as inflation cools and the economy strengthens. Global retail e-commerce sales will increase by 10% annually to reach $7.4 trillion by 2025, according to eMarketer. That puts Shopify in front of a big opportunity. More importantly, as the leader in e-commerce software, and the second-largest digital retailer in the U.S. behind Amazon, Shopify should be able to grow much faster than the broader market.

With that in mind, shares currently trade at 8.6 times sales, a discount to the five-year average of 29.5 times sales. That's why this growth stock is worth buying today.

2. Cloudflare: The fastest cloud network

Cloudflare provides a broad range of cloud services that accelerate and secure applications and networks. Its platform benefits customers in two ways: It makes their IT infrastructure more performant and reliable, and it helps them cut costs and complexity by eliminating expensive network hardware.

Cloudflare distinguished itself as the fastest cloud network in the world, an achievement derived from tremendous scale and superior technology. That advantage translated into strong demand. Cloudflare powers more than 20% of the internet, and it ranks as the market leader in content delivery network software and web application protection.

Not surprisingly, Cloudflare is growing at a rapid clip. Its customer count rose 18% to 156,000 in the third quarter, and average spending per customer increased 24% over the past year. In turn, third-quarter revenue climbed 47% to $254 million, and the company reported positive cash from operations of $43 million, up from a loss of $7 million in the prior year.

Looking ahead, investors have plenty of reasons to be confident. While Cloudflare began as a security-centric content delivery network, it expanded into many other cloud verticals. In 2021, Cloudflare was recognized as the leader in edge development platforms by Forrester Research, and it has since reinforced its competitive position with object storage and database solutions that simplify application development on its network.

Additionally, Cloudflare bolstered its zero-trust security offering with Cloudflare One, a secure access service edge (SASE) platform. SASE refers to an architecture that blends cloud-based network and security services, enabling users to quickly and securely access corporate resources from any device or location. According to IT specialist Gartner, 80% of enterprises will rely on SASE products by 2025, up from 20% in 2021. Cloudflare should benefit from that powerful tailwind.

Collectively, management estimates the company's addressable market will hit $135 billion by 2024, and a significant portion of that total comes from newer products like storage solutions and Cloudflare One. Shares currently trade at 15.6 times sales, a bargain compared to the three-year average of 41.8 times sales. That creates a reasonable buying opportunity for patient investors.