The market is volatile these days, but make no mistake: We are still in a bull market. Of course, there's no telling how much longer this bull will run. After all, looking at average returns over the past 50 years, the market has outright declined in one out of every five years. Therefore, if you're an investor, it's always good to be mentally prepared for a substantial pullback. That said, e-commerce is a megatrend worth investing in no matter what the market or the economy is doing. More and more, physical retail is ceding ground to its digital counterpart. While the following stocks might underperform in a bear market, rest assured the underlying trend will likely remain strong, making these three e-commerce stocks great buys for the long haul. Image source: Pinterest. 1. Pinterest: The visual e-commerce player Whether we're perusing social media, streaming video, or reading a blog, advertisements are everywhere. And frankly, most of us are probably annoyed by the ubiquity of ads. So why would I recommend Pinterest (NYSE: PINS), a company that generates all of its revenue from displaying ads? Pinterest's users are browsing ideas in picture form. Therefore, the company hopes its ads don't feel like they're in the way. Rather, ads are present so users can access the products they were looking for anyway. Therefore, it could be a superior ad experience. To be clear, Pinterest isn't typically seen as an e-commerce company because it doesn't have a checkout feature native to the platform and it doesn't plan on adding one anytime soon. However, retail brands are increasingly seeing the value of uploading their product catalogs to the platform. This includes many small and medium-sized businesses (SMBs), thanks to Pinterest's partnership with e-commerce enabler Shopify. Pinterest's management intends to prioritize international SMBs in 2021, which is where over 78% of its monthly active users live. While the company's revenue grew 48% year over year to almost $1.7 billion in 2020, its international user base remains incredibly under-monetized. International revenue was only 16% of total revenue last year. Because of the pandemic, Pinterest wasn't able to educate international companies on the benefits of its platform like it originally intended. But in 2021, it plans to spend big to push adoption, which could position the business for another bumper year of growth. Image source: Etsy. 2. Etsy: The niche powerhouse I was personally an early adopter of Etsy (NASDAQ: ETSY), attempting to sell just a few handcrafted, wooden items over a decade ago. While I tried to succeed as a seller with quality products, professional pictures, and competitive pricing, I never made a single sale. There just weren't very many buyers on the platform in those days. Eventually I gave up and gifted my stuff to family and friends. The Etsy I experienced is nothing like the Etsy of today. At some point, it became a top-of-mind platform, as was clearly demonstrated when the COVID-19 pandemic started one year ago. Consumers immediately swarmed Etsy is search of face masks, but don't call this a pandemic stock. Revenue was up 36% year over year in 2019, long before the coronavirus. And in the fourth quarter of 2020, gross merchandise sales increased 118% year over year when excluding mask sales from those results. Face mask sales merely illustrated Etsy's top-of-mind presence. And this reality favors the company's more than 4.3 million active sellers. They won't be disappointed like I was. Rather, consumers are flocking to Etsy -- there are almost 82 million active buyers, which is a 77% increase from 2019. And this buyer growth will help drive an additional influx of quality sellers looking to make money from their crafts. At this point, I don't believe another company will displace Etsy from its niche position. And, to me, it seems this e-commerce platform still has plenty of opportunity for growth. With the stock trading at 16 times trailing sales, I believe it provides good value relative to its growth. Image source: Getty Images. 3. Dominos: Wait... how is this e-commerce? I'm having a little fun with this one, but think about it: When you boil it down, e-commerce is just ordering a product digitally and having it delivered to your home. Dominos Pizza (NYSE: DPZ) does this as good as anybody. In 2020, 75% of all sales came through digital channels. And when it comes to delivery pizza, the company estimates it had 36% market share in the U.S. in 2020. Dominos is, therefore, e-commerce pizza. Here's why that could matter going forward: Consumers used food-delivery services like never before during 2020 because of the COVID-19 pandemic. Whether the shift to food delivery is permanent or temporary is up for debate. However, in my opinion, third-party food delivery services won't be long-term winners because they're expensive for restaurants and consumers alike. The high cost causes friction for the e-commercialization of food. By contrast, Dominos' delivery is kept in-house, allowing it to simply provide this valuable service at cost. Even if delivery takes a backseat as the pandemic fades from memory, Dominos is still a clear long-term winner to me. Over the next few years, management expects 6% to 10% annual sales growth, it's authorized to repurchase $1 billion in stock, and it has a modest (but fast-growing) dividend. These factors can combine to provide market-beating stock returns, just as they have over the past decade. Buy e-commerce stocks While e-commerce seems like old news in 2021, the reality is the shift from brick-and-mortar retail is ongoing. Pinterest, Etsy, and Dominos are riding the e-commerce trend in different ways and I believe each provides long-term upside for investors today. Of course, they're not the only e-commerce stocks out there. So if these ideas don't work for you, keep looking! This is a trend you want to invest in. Find out why Pinterest is one of the 10 best stocks to buy now Motley Fool co-founders Tom and David Gardner have spent more than a decade beating the market. After all, the newsletter they have run for over a decade, Motley Fool Stock Advisor, has tripled the market.* Tom and David just revealed their ten top stock picks for investors to buy right now. Pinterest is on the list -- but there are nine others you may be overlooking. Click here to get access to the full list! *Stock Advisor returns as of February 24, 2021 Jon Quast owns shares of Pinterest. The Motley Fool owns shares of and recommends Etsy, Pinterest, and Shopify. The Motley Fool recommends Dominos Pizza. The Motley Fool has a disclosure policy.Source