I have this code which is passed to Paypal checkout:
<?php foreach ($paypalBasket as $item): ?>
<input type='hidden' name='item_name_<?php echo $count ?>' value="<?php echo htmlspecialchars($item[0]) ?>">
<input type='hidden' name='item_number_<?php echo $count ?>' value='<?php echo htmlspecialchars($count) ?>'>
<input type='hidden' name='quantity_<?php echo $count ?>' value='<?php echo htmlspecialchars($item[1]) ?>'>
<input type='hidden' name='amount_<?php echo $count ?>' value='<?php echo htmlspecialchars($item[2]) ?>'>
All this information then appears in the Paypal checkout on the left hand side as I am sure you know. But I want to add another piece of information – ‘description’. But there is no built in variable in Paypal related to description. Description is basically just one word that represents a product such as ‘rose’, ‘ornament’, ‘furniture’. I have this in the database as prod_type which is in the $item array specified in the code.
I have this code to input the description:
<input type='hidden' name='item_name_<?php echo $count ?>' value="<?php echo htmlspecialchars($item[3]) ?>">
BUT, the variable cannot be item_name – because it is effectively a description of an item. So what do I have the variable as??? Can you create custom variables for Paypal?
Which PayPal interface are you using? Express, Direct, Flow, Mass? As far as I know, you can’t create “custom” variables for PayPal, but there are a number of optional variables that you can use. Check out this great article: http://www.binpress.com/app/php-paypal-api-class/20