Below are 2 possible alternatives (options) for setting up a simple shopping cart without using the Drupal Commerce or Ubercart modules (as in your question title).
Option 1: A lightweight e-shop
If you're only looking for a simple and lightweight e-commerce solution, Then have a looking at the Light Shop module (for D7, not for D6, not (yet?) for D8). Here is a quote from its project page:
- Session-stored basket.
- Node based shopping. As the product can be assigned to any node type. One or more. With full support Field API features (regarding nodes).
- Orders history. For each order will be created a separate node.
- There is no dependence on other modules.
- Full support for working with anonymous users
- Integration with Views.
Option 2: A simple shopping cart
If you're only looking for a shopping cart (as in your title), Then have a looking at the Basic Cart module (for D7, not for D6, not (yet?) for D8). Here is a quote from its project page:
Basic cart is a very simple shopping cart / checkout process for Drupal, that just sends 2 emails after each order. Along with the shopping cart, this module also provides a block where you can view your cart's content. It's ideal for small websites with only a few products or other content types being sold, for example touristic offers.
Main difference from Ubercart and Commerce:
The main difference from Ubercart and Commerce is the possibility of choosing the content types that can be added to the cart. It also doesn't bother you with the Product SKU, that can be a pain when you have just a few products.
- The possibility of choosing the content types that can be added to the cart.
- The possibility of sending, or not, an email to the customer once an order is placed.
- Custom email messages for both the site administrator and the customer, along with the order details.
- Order registration and listing in the administration area using Views module.
- Integration with Rules module.
- A block with the contents of your shopping cart.
Here is a screenshot of it (note the "Checkout" button also ...):