Drop us a line 0116 403 0288

PayPal Standard integration and 99 item limit

If you’ve carried out a custom PayPal integration on your ecommerce website, you might find that there is a 99 item limit that can be passed via the Standard payment method. Any more than 99 products and they’ll be truncated, leaving you (and your customer) with an incomplete order.

If you wish to list items individually within the PayPal payment page then a compromise is as follows:

  1. If the customer has 99 items or less, list them individually. If the customer has 100 items or more, combine them into a single line item.

  2. Switch to Express Checkout instead.

Below is a very rough example in PHP which shows how to populate a PayPal array based on option 1 above. Please note, this example isn’t complete and your array would need elements in addition to those shown below.

[php]

define(‘PP_ITEM_LIMIT’, 100, TRUE);

if (count($basketitems) < PP_ITEM_LIMIT) { // If there are less than PP_ITEM_LIMIT, list them individually
$count = 0;
foreach ($basketitems as $product) {
++$count;
$paypal[‘item_number_’ . $count] = $product[‘productid’];
$paypal[‘item_name_’ . $count] = $product[‘productname’];
$paypal[‘amount_’ . $count] = $product[‘price’];
$paypal[‘quantity_’ . $count] = $product[‘qty’];
}
} else { // PP_ITEM_LIMIT items or more and combine them into a single line
$subtotal = 0.00;
foreach ($basketitems as $product) {
$subtotal += $product[‘price’] * $product[‘qty’];
}
$paypal[‘item_name_1’] = ‘Website Order’;
$paypal[‘amount_1’] = $subtotal;
$paypal[‘quantity_1’] = 1;
}
[/php]