Modify PayPal "no_shipping" var via t-shirt choice
According to https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/ no_shipping has the following values: 0: prompt for an address, but do not require one 1: do not prompt for an address 2: prompt for an address, and require one The default is 0. Ideally, any time they change wantGift, even in a pure HTML form, we'd change it between 0 and 2 as appropriate (i.e., we need the address if they want the t-shirt). However, I couldn't find an easy way to make this modification in pure CSS or HTML, so it only happens in Javascript-enabled browsers. This is still graceful degradation, since the only impact is in cases where a non-Javascript user fails to give us an address, and we have to email later to get the shipping address.
This commit is contained in:
		
							parent
							
								
									e0f0ee820f
								
							
						
					
					
						commit
						6b9bdb335e
					
				
					 2 changed files with 4 additions and 0 deletions
				
			
		|  | @ -38,8 +38,10 @@ $(document).ready(function() { | |||
|         var value = input.val(); | ||||
|         if (value == "Yes") { | ||||
|             $(".t-shirt-size-selector").show(); | ||||
|             $("#no_shipping").val("2"); | ||||
|         } else { | ||||
|             $(".t-shirt-size-selector").hide(); | ||||
|             $("#no_shipping").val("0"); | ||||
|         } | ||||
|     }); | ||||
|     $('.amount').addClass("valid"); | ||||
|  |  | |||
|  | @ -139,6 +139,7 @@ internal policies</a> are published and available for scrutiny.</p> | |||
|             <input type="hidden" name="cmd" value="_xclick" /> | ||||
|             <input type="hidden" name="business" value="supporter@sfconservancy.org" /> | ||||
|             <input type="hidden" name="item_name" value="Conservancy Supporter, Annual" /> | ||||
|             <input id="no_shipping" type="hidden" name="no_shipping" value="0" /> | ||||
|   <label for="amount"><strong>Amount:</strong> $</label> | ||||
|   <input class="amount" type="text" name="amount" size="7" minimum="120" value="120" /> | ||||
|   <span class="form-error"><small>$120 is a minimum for Conservancy | ||||
|  | @ -198,6 +199,7 @@ internal policies</a> are published and available for scrutiny.</p> | |||
|             <input type="hidden" name="item_name" value="Conservancy Supporter, Monthly" /> | ||||
|             <input type="hidden" name="return" value="https://sfconservancy.org/supporter/thank-you.html" /> | ||||
|             <input type="hidden" name="cmd" value="_xclick-subscriptions"> | ||||
|             <input id="no_shipping" type="hidden" name="no_shipping" value="0" /> | ||||
|             <input type="hidden" name="lc" value="US"> | ||||
|             <input type="hidden" name="no_note" value="1"> | ||||
|             <input type="hidden" name="t3" value="M" /> | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Bradley M. Kuhn
						Bradley M. Kuhn