If you have an e-commerce site selling products, at some point you likely run out of stock. Or sometimes, you will likely stop carrying certain products -- like that automated banana peeler that isn't selling so great.
At the same time, however, your customers are likely still searching for these products, leaving you with some decisions to make on how to handle these situations. Ignoring the issue is the riskiest strategy, as the experience on your site and in search engines is determined by the default settings of your shopping cart.
Out of Stock Items
With an out of stock item, it's better not to redirect it from the normal product page.
First, it's a different and unexpected user experience if you send users to a default "we're sorry, this is out of stock" page -- this is practically a "go away" sign on your website.
Second, by changing the URL, you risk search engines dropping the rankings on a product that may be back in stock in a few days (or even hours). It would be much better to allow users to go to the normal product page, but include a message that the product is out of stock with the expected return date.
If you can still sell the product, but merely delay the shipping, even better. However, your normal confirmation e-mail and "thank you" page should make it clear that shipping will be delayed. If this isn't possible, make it easy for the customer to find the product later, by allowing them to be e-mailed when the item is back, or to add the product to their wish list for later.
Unlike an out of stock page, the experience has to change somewhat for products that won't be sold again. If possible, use the same product URL for search engines here, as well when you have the ability to change certain elements needed for out of stock items.
Some of the elements you'll want to include on these discontinued product pages are related products, accessories, product details (not price though), pictures, and support options. You'll also want a clear message that the item will no longer be sold.
Another option for obsolete items: redirect (301 type) users to a similar product. The benefit? A user may be more likely to buy, and you could improve the natural search rankings on new products.
One downside is that a customer may be confused or upset. Adding a message box about the obsolete item, and a way to find information on that item, could alleviate that problem. Another downside is searches for the obsolete product could return your new product listing, which may drive down CTRs -- or may not return your site at all.
From a customer perspective, the redirect option works better for smaller items, like pencils, where the difference in products is negligible. Leaving the URL the same works better for bigger products, like a car model. From an SEO perspective, obsolete product brand names that are still highly searched, like the car model, should be left at the same URL as well.
If this will be the first time your obsolete models can be found, you may want to prepare for an increase in support phone calls, as an electronics client of ours found out.
Internal Searches and Browsing
Outside of search engines, how can users find these pages through your site? If you're simply out of stock, there shouldn't be a change in listings of these items (it would be nice to allow users to filter for only in stock items though).
For obsolete items, you likely won't want to list those on a category page, but you may consider adding a list of obsolete items buried somewhere on the site for search engines and determined visitors. Additionally, you should certainly allow a user to reach the obsolete item if they enter the model number in your on-site search.
In an extreme case, if you sell such a massive amount of products that it's simply not feasible to retain them all indefinitely, you may have to drop the products after a certain amount of time. In that case, drop lower traffic products without accessories or support first.
Taking a little time in ensuring your customers (and search engines) can find what they're looking for, whether or not you're still selling those items, is a great way to keep customers happy, loyal, and likely to continue shopping in the future.