Setting up your web page to interface with Mal's shopping cart can be done in different ways depending on how you want your page to look. One way is to just define a button that includes all of the production information. This works for simple products, but doesn't give you the ability to have drop down boxes for selection of scents/colors/whatever.
Another way is to use HTML forms to send the information to the shopping cart. There are two variations on this - one is to buy one product per button, the other is to buy multiple products at a time with one button.
When you first get set up with Mal's, you will receive a user number and the name of the server where your cart will be located. Your user name will be a 7 digit number, and your server name will be wwX, where X is a number. You will need this information in the instructions below.
Also, in the code below, I have used square brackets [] in place of the actual angle brackets <>. When entering your code, replace all [ with <, and replace all ] with >
You basically need to create a one line definition of a button with all of the product information in it. This is why it cannot include any type of selected information - it must be defined when you build your page.
In this method, you will need to set up a 'form' on your web page. This will allow you to create a drop down box to allow your customers to select different options. Anything in bold is something that you will need to change.
First, here's the full form for one product with scent options. After this we'll describe each line:
---------------------------------------------------------------
01:
02: [form method="POST" action="http://wwX.aitsafe.com/cf/add.cfm"]
03: [input type="hidden" name="userid" value="1234567"]
04: [input type="hidden" name="return" value="www.yoursite.com/pagename.html"]
05: [input type="hidden" name="product[]" value="description of product"]
06: [select name="product[]"]
07: [option value="desc to cart"]desc on page[/option]
08: [option value="desc to cart"]desc on page[/option]
09: [option value="desc to cart"]desc on page[/option]
10: :
11: :
12: [option value="desc to cart"]desc on page[/option]
13: [/select]
14: [input type="text" name="qty" value="0" size="3" maxlength="3"]
15: [input type="hidden" name="price" value="7.50"]
16: [input type="hidden" name="units" value="1.5"]
17: [input type="submit" name="add" value="Buy"]
18: [/form]
---------------------------------------------------------------
01: Just a blank line to keep the code apart and easy to read.
02: This is the beginning of the form, and actually defines the call to Mal's shopping cart. Make sure you change the wwX to use the number of the server you were given when you signed up.
03: This let's Mal's know that you are a valid user.
04: This will create a 'continue shopping' button on the shopping cart page. Usually, you set it to the same page that this code is on - that way the customer will return to the page they just purchased from.
05: This is the first part of the description of the product. The square brackets after the product ( product[] ) need to stay square - don't substitued <> for these. You use product[] instead of product because you are going to be adding another piece to the description with the scent selection. When Mal's sees multiple product[] in a form, it adds them together on one line of the cart, separating them with a comma.
06-13: This section defines the drop down box where you scents are defined.
07: Each option is defined in this way. The cart can receive different text than what you show on your page. The order you define the options is the order it shows up on your page.
14: This defines the box on your page where your customer enters the quantity.
15: This is a hidden field (doesn't show on your page), where you define what price to send to the shopping cart.
16: This is another hidden field that can optionally be used to send the product weight. Useful for shipping calculations, but not necessary.
17: The definition that shows the buy button on your page
Notice that many of these fields are hidden - the only ones that actually show up on your page are the option selections, the quantity entry box, and the submit button. How do you get the rest of the information to show up on your page?
You will need to actually put some of that hidden information on the page. You can embed HTML commands like TABLE, TD, TR (definitions of rows and cells) within a form - the form doesn't care. Use basic HTML and repeat the information like the main description, price, maybe code for an image.
-------------------------
This method is basically the same as method 2A above, but allows you to have multiple products purchased with one click of a buy button.
Duplicate lines 5-16 above for each product, putting them after line 16. For each name product[], qty, price, units, change them to productX[], qtyX, priceX, unitsX, where the X is a number 1-30. You can only sell 30 products per buy button. The first set would be product1[], qty1, price1, units1. The second set would be product2[], qty2, price2, units2