Discounted stocks are abundant these days, but just because a company looks cheaply priced in the current market doesn't make it a great buying opportunity. Beyond share price, it's important to evaluate each company on its merits to determine whether the underlying business remains poised for continued growth. It should also make sense for the composition of your personal portfolio. 

If you're going bargain shopping before the end of 2022 with $3,000 to invest, Apple (AAPL 0.52%) and Alphabet (GOOG -1.96%) (GOOGL -1.97%) are two smart stocks that you won't want to overlook. 

1. Apple

The market may be giving tech stocks like Apple a tough time right now, but there is no denying the long-term competitive advantages this tech behemoth boasts that can help it ride out near-term storms.

Apple still makes the bulk of its revenue and earnings from its popular hardware products like iPhones, iPads, Macs, and wearables/accessories. However, it's increasingly seeing consistent growth from its services segment. This segment encapsulates a wide range of products, including Apple Music, Apple TV, and advertising, and comprised $78 billion of Apple's $394 billion in reported sales in fiscal 2022.

The 12-month period was another in a lengthy track record of enviable growth for the company. Despite the challenges of the current macro environment, Apple's top and bottom lines jumped by respective percentages of 8% and 5%, respectively, on a year-over-year basis.  

While near-term consumer spending trends could slow down the trajectory of growth for Apple, it has an exceptional financial foundation to fall back on. The company generated $111 billion in free cash flow in fiscal 2022, and had $170 billion in cash and investments on its balance sheet at the end of the 12-month period.  

It also remains a faithful payer to income investors, with a payout that has risen by 143% over the trailing decade. A $3,000 investment in Apple at its current share price would add about 23 shares to your portfolio. 

2. Alphabet 

Concerns overshadowing the tech sector in general, as well as a pullback in ad spend by businesses across all industries, has made some investors bearish on Alphabet. To this day, advertising remains responsible for the the bulk of Alphabet's revenue and profits.

While a downturn in ad spend could impact its business in the imminent future, this remains outside of Alphabet's immediate control. It also isn't specific to the business itself or indicative of an underlying issue that would hamper Alphabet's growth over the long term.

Oberlo estimates that approximately $521 billion was spent on digital advertising globally in 2021, while the trajectory of digital ad spend will surge to $876 billion by 2026. Alphabet captured roughly 30% of U.S. digital ad spend in 2021. From YouTube to Google -- which remains the No. 1 search engine in the world -- Alphabet controls what is considered the most prime real estate for digital ad spend on the planet.

This is a competitive advantage few could beat if they tried, and it means that Alphabet is well positioned to continue seizing upon its dominant market position while capitalizing on the recovery of ad spend in the future. Over the past decade, Alphabet has grown its revenue and earnings by 460% and 608%, respectively.  

For investors with a long-term horizon and the ability to handle more near-term volatility, Alphabet's long-term growth story looks compelling. A $3,000 investment in Alphabet would add about 34 shares to your portfolio.