1and1 Help Centre Categories

print article

Sample Cart/Basket integrations.

The basket/cart link will look like: http://[shop-url]/action/order.php4http://s88227296.oneandoneshop.co.uk/action/order.php4

Example 1: Basic ItemA basic item usually consists of an item number(item_number), a name(title) and a price(price).

Item number = pen-01
Name = Parker Fountain Pen
Price = 3.0
To include this item on a web page so that it can be ordered, just insert the
following HTML form:


<form action="http://[shop-url]/action/order.php4" method="post">
<input type="hidden" name="article[item_number]" value="pen-01">
<input type="hidden" name="article[title]" value="Parker Fountain Pen">
<input type="hidden" name="article[price]" value="4.0">
<input type="submit" name="submit" value="order">
</form>
You can check FAQ: What is secure shopping cart integration?You can create the above form by following the FAQ.

The required links are generated using the function Secure Cart Integration. The
function also generates a unique check sum

article[c]

which the cart then
check against the compulsory fields that are transferred when an order is placed.

You can also use the following parameters:

Name (parameter) Content
Category (category) Contains the item's product
category and is required only for the Shop log files..
Quantity (count) You can also enter the quantity.
VAT (vat) If no tax rate is entered, then
the standard rate setup in the eShop will be used.
URL (url) Intended for the URL from which
the basket was called. This URL is mainly used for returning from the basket
ti item display.
Hint (hint) Additional information for the
item, e.g.: 'Discount given for orders of 10 or more' or 'while stocks last'
Test sum (c) A value that is calculated with
the aid of secure basket integration and that the basket compares with the
compulsory fields submitted.

Example 2: 10 items of a Category are ordered


<form action="http://[shop-url]/action/order.php4" method="post">
<input type="hidden" name="article[item_number]" value="pen-01">
<input type="hidden" name="article[title]" value="Parker Fountain Pen">
<input type="hidden" name="article[category]" value="Stationary">
<input type="hidden" name="article[count]" value="10">
<input type="hidden" name="article[price]" value="4.0">
<input type="hidden" name="article[vat]" value="10">
<input type="hidden" name="article[url]" value="http://justonedomain.com/">
<input type="hidden" name="article[hint]" value="while stocks last">
<input type="submit" name="submit" value="order">
</form>
Example 3: Item with one attributeIn this example you can order an item with an attribute. Shoppers can choose
the size of the T-Shirt they are ordering.

<form action="http://[shop-url]/action/order.php4" method="post">
<input type="hidden" name="article[item_number]" value="TS-001">
<input type="hidden" name="article[title]" value="Beach T-Shirt">
<input type="hidden" name="article[price]" value="24.0">
<select name="article[size]">
<option value="L">L</option>
<option value="M">M</option>
<option value="S">S</option>
</select>
<input type="hidden" name="article[select_size]" value="L|M|S">
<input type="submit" name="submit" value="order">
</form>
Example 4: Item with price dependent attributeIn this example you can order an item with an attribute. Different attributes have
different prices. Large (L) T-Shirt may be 27.00 and Medium (M) 25.00 and Small (S) can be priced 24.00.


<form action="http://[shop-url]/action/order.php4" method="post">
<input type="hidden" name="article[item_number]" value="TS-001">
<input type="hidden" name="article[title]" value="Beach T-Shirt">
<select name="article[size]">
<option value="L">L</option>
<option value="M">M</option>
<option value="S">S</option>
</select>
<input type="hidden" name="article[rule_size]" value="
if(article_get_field('size') == 'L'){
article_set_field('price', 27.00);
}
elseif(article_get_field('size') == 'M'){
article_set_field('price', 25.00);
}
elseif(article_get_field('size') == 'S'){
article_set_field('price', 24.00);
}
">
<input type="hidden" name="article[select_size]" value="L|M|S">
<input type="submit" name="submit" value="order">
</form>
Example 5: Item with price dependent attribute and an item numberIn this example, choosing the size results in a different price and item number.


<form action="http://nowshopbetter.com/action/order.php4" method="post">
<input type="hidden" name="article[item_number]" value="TS-001">
<input type="hidden" name="article[title]" value="Beach T-Shirt">

<select name="article[size]">
<option value="L">L</option>
<option value="M">M</option>
<option value="S">S</option>
</select>
<input type="hidden" name="article[select_size]" value="L|M|S">

<input type="hidden" name="article[rule_size]" value="
if(article_get_field('size') == 'L'){
article_set_field('price', 27.00);
article_set_field('item_number', 'TS-001-L');
}
elseif(article_get_field('size') == 'M'){
article_set_field('price', 25.00);
article_set_field('item_number', 'TS-001-M');
}
elseif(article_get_field('size') == 'S'){
article_set_field('price', 24.00);
article_set_field('item_number', 'TS-001-S');
}
">
<input type="submit" name="submit" value="order">
</form>
Some basic knowledge of programming is necessary to be able to create rules
mentioned in the above examples.