How do I add a custom textfield to the payment page?

Diamons
New Community Member

I want to sell products on my page. When people go to checkout, I want them to be able to add a "referrer" or a salesperson that sold it to them basically. How do I do this? I read about os1 and os2 but got really confused. I want this to be stored in the payment info.

Login to Me Too
1 REPLY 1

PP_MTS_Volker
PayPal Employee
PayPal Employee

Hi,

 

Yes for this purpose you could use the on0 and os0 fields. These variables are the  option field name/label and the Option selection of the buyer for the first option field. Both parameters needs to be added to the paypal button code you've already integrated. I your case you could name the option "referrer" and then give your customers a textfield where the can input a value. Here is an example Code of what you need to add to your Button:

 

<table>
	<tr>
	<td>
		<input type="hidden" name="on0" value="Referrer">Referrer:
	</td>
	</tr>
	
	<tr>
	<td>
		<input type="text" name="os0" value="">
	</td>
	</tr>
</table>

 

 

 In an complete Button it would look like this:

 

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
		<input type="hidden" name="cmd" value="_xclick">
		<input type="hidden" name="business" value="here your email address">
		<input type="hidden" name="currency_code" value="EUR">
		<input type="hidden" name="amount" value="1.00">
		<input type="hidden" name="item_name" value="Test Artikel">
		<input type="hidden" name="item_number" value="111111111">
			
			<table>
			<tr>
			<td>
			<input type="hidden" name="on0" value="Referrer">Referrer:
			</td>
			</tr>
				<tr>
			<td>
			<input type="text" name="os0" value="">
			</td>
			</tr>
			</table>
		<input type="hidden" name="notify_url " value="http://www.mystore.com/ipn.php">

		
		<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
		<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

 

 

 Here you can see all variables you can use with our Button, just in case you need more information:

 

https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_Appx_websit...

 

Hope this helps,

 

Regards,

 

Volker

 

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.