2005-02-17
| Table of Contents: |
| Rate This Article: | Add This Article To: |
( Page 3 of 3 )
Using a Shopping Cart
While an instant purchase is useful, there's plenty of times that a customer wants to buy multiple items. (And who I am to object, if the money's coming into my pocket?)
Use the AddToCartButton to permit the customer to select several items before paying. I used precisely the same properties for the AddToCartButton, except that the AlternateText and the ImageUrl values are appropriate for the AddToCartButton.
What is distinctly different is that we are routed to a shopping cart page in PayPal each time we use the AddToCartButton.
From the shopping cart page (shown in Figure 7) you can update the quantity, remove items, continue shopping, or checkout. If the user clicks Continue Shopping they are redirected to your store.
Other PayPal Controls
There are other controls for viewing a cart, uploading an entire cart — if you are tracking the cart — and checking out. These controls are equally easy to use.
The most difficult remaining feature is the one permitting you to upload an entire, self-managed cart. The key for uploading a cart is to simply iterate through all of the selected items and send them all to PayPal.
The e-commerce starter kit demonstrates several more features, including a self-managed cart and uploading an aggregate cart. To find these code elements in the e-commerce starter kit, find the PayPal control that supports the behavior you are interested in, and explore its properties and the code associated with that control's events.
Beyond The Basics
This article is a good place to start to begin discovering the PayPal ASP.NET Web controls. In this article, you learned how to display your wares, add and use both the BuyNowButton and AddToCartButton. These two controls in conjunction with a PayPal account are all you need to create a custom e-commerce site. If you need even more specialized control then you can build on the samples in this article, or use the e-commerce starter kit based on the IBuySpy portal and PayPal's controls.
![]() |
|


