SpiceLogic Inc.
                                                                                                     SpiceLogic Inc. Home PageProductsJournalMy AccountHelp DeskContact Us
 
Knowledge base  : ASP.NET PayPal Control for Website Payments Standard    - Standard Edition
Welcome Guest   Login

Skip Navigation Links. ASP.NET PayPal Control for Website Payments Standard

Documentation  Documentation

Download   Download the latest version

Back to the home of knowledgebase forum Can the 'add to cart' work transparently before completing the checkout?

An user   3/20/2009 3:15:31 PM

My main purpose is that the paypal checkout is at the end
 
can the 'add to cart' work transparently before completing the checkout?



Resolution:
- [SpiceLogic Support Technician]   3/20/2009 3:16:01 PM

Yes, absolutely possible. For your case, you would need “Upload Complete Cart” button instead of “Add to Cart” button. In this way, you can allow your users to select some products in your website and finally your customer will click the Upload Complete Cart button. Then, in the Click event handler of the “Upload Complete Cart” button, you add the items to the items collection property of the button. The download setup.exe file contains sample application of using Upload Complete Cart Button. The following snippet shows how you can add items from an xml file to the items collection property of the “Upload Complete Cart” button. Instead of xml file, the items can be your selected items what your customer selected.  Then, the “Upload Complete Cart” button will take your customer to the PayPal website and in that PayPal page, your customer will see the selected items individually as the cart items.

 

        XmlDocument myeBooksDoc = new XmlDocument();

        myeBooksDoc.Load(MapPath("~/App_Data/eBooks.xml"));

        XmlNodeList eBooks = myeBooksDoc.SelectNodes("/eBooks/book");

        foreach (XmlNode book in eBooks)

        {

            UploadCompleteCartButton1.PayPalCartItems.Add(new PayPalItem(book.Attributes["title"].Value,

                                                                         book.Attributes["id"].Value, 1,

                                                                         decimal.Parse(book.Attributes["price"].Value)));

        }

 

 

And here is the xml file:

 

<?xml version="1.0" encoding="utf-8" ?>

<eBooks>

  <book id="1" title="The magical world" author="Tomar Mary" price="14.4" />

  <book id="2" title="The Girl From Tomorrow" author="Eastwood Mary" price="18.4" />

  <book id="3" title="Man in the Iron Mask" author="Jhing Chao" price="92.4" />

  <book id="4" title="I am the Hero" author="Kagaz Myor" price="12.4" />

  <book id="5" title="The Three Man" author="George Mike" price="42.4" />

  <book id="6" title="Pirates of Atlantis" author="Harry Mike" price="16.1" />

</eBooks>




Home  || Products  || Journal  || My Account  || HelpDesk  || Contact Us

Website and Software Copyright ©2010, SpiceLogic Inc., All Rights Reserved.