Visual Studio 2010!

Read now >

View Now
DevSource RSS FEEDS
XML Want an easy way to keep up with breaking tech news? And the Get DevSource headlines delivered to your desktop with RSS.
ADVERTISEMENT
ADVERTISEMENT

 

DevSource.com: Your Source for Visual Studio on Facebook
ADVERTISEMENT
Building an ASP.NET Storefront with PayPal
By Paul Kimmel

Rate This Article: Add This Article To:

Building an ASP.NET Storefront with PayPal - ' Using a Shopping Cart '
( 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.

Figure 7: PayPal can manage a shopping cart for you if you use the AddToCartButton.

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.



 
 
>>> More Using Microsoft Visual Studio Articles          >>> More By Paul Kimmel