
|
Max Shop Cart HTML Code You'll want to put shopping cart buttons on your webpages where you have products for sale. Here's the two I like to use: Of course, you can use any graphic image you like, or even a text link that says Add to Cart, or whatever. Specifications: GET or POST to cart.php An input variable called "prod_id" is the Product ID. And an input variable called "addorview" is set to 1 for Add to Cart. Or set to 2 for View Cart. Or 3 for User Input of purchase description and price. That's the short version. Here's the long version. This is the recommended HTML code for the above Add to Cart and View Cart buttons: Add to Cart: <form
action="http://www.yourdomain.com/maxcart/cart.php"
method="post" target="_blank"> View Cart: <form
action="http://www.yourdomain.com/maxcart/cart.php"
method="post" target="_blank"> Note that the POST is to cart.php. And I recommend using a target="_blank" so that the shopping cart will come up, in a new window. The hidden variable called "addorview" is set to 1 when adding to the cart. Or 2 just to view the cart contents. The "prod_id" hidden variable is the Product ID that you entered in the Add Product section of the Products Control Panel. It's how you identify which product is being added to the cart. Both of the above HTML samples use a button. If you want to setup a simple text link for Add to Cart, this will work: <a href="http://www.yourdomain.com/maxcart/cart.php?prod_id=3&addorview=1" target="_blank">Add to Cart</a> Or a View Cart: <a href="http://www.yourdomain.com/maxcart/cart.php?addorview=2" target="_blank">Add to Cart</a> Simple, eh?
Donations -- Another Cart Method: <form
action="http://www.yourdomain.com/maxcart/cart.php"
method="post" target="_blank"> When 'addorview' is 3, this means that the product description and product price are to be entered by the customer. When the customer clicks the button, a window comes up where the customer is asked to enter a description of the purchase, plus the price of the purchase. This is useful for donations and for hourly fees.
Advanced Cart Methods: <form
action="http://www.yourdomain.com/maxcart/cart.php"
method="post" target="_blank"> These fields are used in conjunction with a donation, as the addorview value is still a 3. You may use all these fields or pick and choose. Default values will be chosen for fields not included. Suppose you are seeking a donation, but you will also give the donor a product if they donate a certain amount. If so, then fill in the prod_id field with the product number. And the minamount field with the minimum amount that they must donate, in order to get the product. (Which is usually a downloadable item, but it doesn't have to be...) The enteramount and whatfor fields are simply captions that are used on the pop-up form where the donor is asked to fill in the amount. The values given above are the default if these fields are not used. And finally, the paytitle field is a line that will appear as a title on the pop-up. Recommended: play around with these fields and see what you get, when you create such a button.
Now, let's look at what happens when a customer Checks Out: |