Starting with version 4.2 my Paypal IPN script now allows you to set up one purchase form to allow for the purchase of multiple products at once. There are a number of things you have to do to set this up.
To make it easier to explain how this all works we'll imagine that there are three products A, B, and C.
So for this last step we delete the line that reads:
<input type="hidden" name="prod" value="A">
That now gets replaced with checkboxes so that the appropriate combination of products can be seleted.
<input type="checkbox" name="prods" value="A">
You would of course have a checkbox with the value for each product that can be purchased in combination so for our example we'd have two further checkboxes for products B and C.
Now the form will pass a prods array instead of the single prod field when it is submitted. The prods array will contain all of the checked values from the form. The code for the paypal.php and paypal1.php scripts were updated in version 4.2 so that if a prods array is received then the prod field is generated by imploding the array. What this means is that if the A and C checkboxes are checked and the B checkbox isn't then the product code ends up being AC. Since you created that product and added it to the product table in steps one and two the same processing for the rest of the product purchase can take place as if a single product were selected (since as far as the rest of the script is concerned this is a single product).
This article written by Stephen Chapman, Felgall Pty Ltd.