Textpattern form for Paypal shopping-cart integration
To use, add each product as an article; in the first custom field put the name you want passed to the cart, and in the second custom field put the price of the item. Then make sure this is called by the article form:
<fieldset> <legend>Buy this product:</legend> <p>Our fine <txp:rei_show_custom /> is available for the low, low price of $<txp:rei_show_custom customid="2" />.</p> <p><label for="os0">What sort of <txp:rei_show_custom /> would you like?</label></p> <form action="https://www.paypal.com" method="post"> <p><input type="hidden" name="on0" value="variable" /><select name="os0" id="os0"> <option selected="selected" value="type1">Type 1</option> <option value="type2">Type 2</option> <option value="type2">Type 3</option> </select> </p> <p> <input type="hidden" name="cmd" value="_cart" /> <input type="hidden" name="business" value="yourbiz@yourdomain" /> <input type="hidden" name="item_name" value="<txp:rei_show_custom />" /> <input type="hidden" name="amount" value="<txp:rei_show_custom customid="2" />" /> <input type="image" id="add_to_cart" src="/path/to/your_cart_image" name="submit" alt="Add this item to your cart" /> <input type="hidden" name="add" value="1" /> </p> </form> <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <p> <input type="hidden" name="cmd" value="_cart" /> <input type="hidden" name="business" value="yourbiz@yourdomain" /> <input type="image" id="view_cart" src="/path/to/your_view_cart_image.png" name="submit" alt="View all items currently in your cart" /> <input type="hidden" name="display" value="1" /> </p> </form> </fieldset>
That'll display both an "add to cart" and a "view cart" button.
You'll want to fill in your own Paypal account address and product options, of course.