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.
?xml:namespace>
?xml:namespace>
XmlDocument myeBooksDoc = new XmlDocument();
?xml:namespace>
myeBooksDoc.Load(MapPath("~/App_Data/eBooks.xml"));
?xml:namespace>
XmlNodeList eBooks = myeBooksDoc.SelectNodes("/eBooks/book");
?xml:namespace>
foreach (XmlNode book in eBooks)
?xml:namespace>
{
?xml:namespace>
UploadCompleteCartButton1.PayPalCartItems.Add(new PayPalItem(book.Attributes["title"].Value,
?xml:namespace>
book.Attributes["id"].Value, 1,
?xml:namespace>
decimal.Parse(book.Attributes["price"].Value)));
?xml:namespace>
}
?xml:namespace>
?xml:namespace>
?xml:namespace>
And here is the xml file:
?xml:namespace>
?xml:namespace>
<?xml version="1.0" encoding="utf-8" ?>
?xml:namespace>
<eBooks>
?xml:namespace>
<book id="1" title="The magical world" author="Tomar Mary" price="14.4" />
?xml:namespace>
<book id="2" title="The Girl From Tomorrow" author="Eastwood Mary" price="18.4" />
?xml:namespace>
<book id="3" title="Man in the Iron Mask" author="Jhing Chao" price="92.4" />
?xml:namespace>
<book id="4" title="I am the Hero" author="Kagaz Myor" price="12.4" />
?xml:namespace>
<book id="5" title="The Three Man" author="George Mike" price="42.4" />
?xml:namespace>
<book id="6" title="Pirates of Atlantis" author="Harry Mike" price="16.1" />
?xml:namespace>
</eBooks>
?xml:namespace>