So It's hard to write a proper title, I will do my best to explain.
The thing I'm looking for, is a simple way to Directly load the top link google present's my as if I would google a certain term.
Imagine this -> User gives the input "BMW x5" in the text box and clicks on "submit".
As a result I have an Iframe on my webpage that will have it's source set to the url that is the top result in google.com .
To make clear my Iframe will not load google.com with as search parameters "BMX x5" instead it will directly load the top listed page.
Is this possible?
Have a look at this code:
https://productforums.google.com/forum/#!topic/customsearch/Iyv7_wswlqk
You need to copy this to a page of its own and target your iframe - however it is possible that google will not allow that.
If that is the case, then you need to have a proxy on your server that parses the search result and redirects to the first link
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" align="center" valign="bottom">
<form name="f" action="Your results page address" id="cse-search-box" method="get" target="_blank">
<input type="hidden" name="cx" value="Your cx value here" />
<input type="hidden" name="cof" value="FORID:9" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="text" name="q" id="q" autocomplete="off" size="51" class="txbx" />
</form>
</td>
</tr>
<tr>
<td style="height:35px;" width="45%" align="right" valign="middle">
<form name="s" action="Your results page address" method="get">
<input type="hidden" name="cx" value="" />
<input type="hidden" name="cof" value="" />
<input type="hidden" name="ie" value="" />
<input type="submit" name="sa" value="Search" class="btn" onClick="document.s.cx.value=document.f.cx.value; document.s.cof.value=document.f.cof.value; document.s.ie.value=document.f.ie.value;" />
</form>
</td>
<td width="55%" align="left" valign="middle">
<form name="g" action="http://www.google.co.uk/search" method="get">
<input type="hidden" name="q" value="">
<input name="btnI" type=submit value="I'm Feeling Lucky" class="btn" onClick="document.g.q.value=document.f.q.value;" />
</form>
</td>
</tr>
</table>
I'm having some trouble with a form I'm trying to create in PayPal for a WordPress website. It's a form that allows for different types of registrations and quantities - both of these work. At the end, my client also wants an option to donate any amount - this is not working.
The code at the bottom is only adding the amount entered as a 'note' to paypal, not as an actual monetary value to the amount being paid. I've tried 'name="amount"' as well.
<table>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input name="business" type="hidden" value="EMAIL" />
<input name="cmd" type="hidden" value="_xclick" />
<input name="item_name" type="hidden" value="Camper Registration" />
<input name="currency_code" type="hidden" value="USD" />
<!-- Provide a dropdown menu option field with quantity. -->
<tr>
<td><input type="hidden" value="Quantity" />How Many Campers?</td>
<td><select name="quantity">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select></td></tr>
<!-- Provide a dropdown menu option field with prices. -->
<tr>
<td><input name="on1" type="hidden" value="Payment Type" />Payment Amount</td>
<td><select name="os1">
<option value="deposit">Nonrefundable Deposit $100</option>
<option value="Before1/1">(Before 1/1/15) $210</option>
<option value="Before4/1">(Before 4/1/15) $225</option>
<option value="After4/1">(After 4/1/15) $250</option>
</select></td></tr>
<!-- Specify the price that PayPal uses for each option. -->
<input name="option_index" type="hidden" value="1" />
<input name="option_select0" type="hidden" value="deposit" />
<input name="option_amount0" type="hidden" value="100" />
<input name="option_select1" type="hidden" value="Before1/1" />
<input name="option_amount1" type="hidden" value="210" />
<input name="option_select2" type="hidden" value="Before4/1" />
<input name="option_amount2" type="hidden" value="225" />
<input name="option_select3" type="hidden" value="After4/1" />
<input name="option_amount3" type="hidden" value="250" />
<!-- Provide place for other donations. -->
<tr>
<td>Other Amount:</td>
<input type="hidden" name="on0" value="Other Amount">
<td><input name="os0" type="text" value="0"></td></tr>
<!-- Provide place for notes. -->
<tr>
<td>Child's Name(s) and Comments:</td>
<input type="hidden" name="on3" value="Notes">
<td><textarea name="os3" rows="4" cols="50" wrap></textarea></td></tr>
</table>
<!-- Display the payment button. -->
<input alt="PayPal - The safer, easier way to pay online" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynow_LG.gif" type="image" />
<img src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" alt="" width="1" height="1" border="0" />
</form>
this is the code in question:
<tr>
<td>Other Amount:</td>
<input type="hidden" name="on0" value="Other Amount">
<td><input name="os0" type="text" value="0"></td></tr>
Ok, the code below works. But the thing is that it doesn't allow the user to alter the amount purchased.
I'm trying to figure out how to have the user, once they've purchased a ticket and get to paypal page, to be able to alter the amount of tickets they would like to have.
As it is, once you land on the paypal page, it shows what you purchased, and that's it, pretty much.
Any advice?
EDIT
If anyone needs an example of what I'm talking about, here's one: Paying for multiple items (at once) via paypal
Look at the image at bottom. Do you see the quantity column? That's what I meant. But when I tried what they did in that one, it doesn't work. I think it's because in that one, it uses _cart, wheres mine is _donation?
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<!-- Specify a Donate button. -->
<input type="hidden" name="cmd" value="_donations">
<!-- Specify details about the contribution -->
<input type="hidden" name="item_name" value="Name Of Business">
<input type="hidden" name="item_number" value="Tickets">
<select name="amount">
<optgroup label="Sponsorship">
<option value="15000" name="platinum">$15,000 - Platinum Sponsorship</option>
<option value="10000">$10,000 - Gold Sponsorship</option>
<option value="5000">$5000 - Silver Sponsorship</option>
<option value="2500">$2,500 - Bronze Sponsorship</option>
</optgroup>
<optgroup label="Individual Seating">
<option value="500">$500 per seat</option>
</optgroup>
<optgroup label="Program Book Tribute Journal Ad">
<option value="600">$600 - Half Page</option>
<option value="1000">$1000 - Full Page</option>
</optgroup>
</select>
<input type="hidden" name="currency_code" value="USD">
<br /><br />
<!-- Display the payment button. -->
<input type="image" name="submit" border="0"
src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif"
alt="PayPal - The safer, easier way to pay online">
<img alt="" border="0" width="1" height="1"
src="https://www.paypal.com/en_US/i/scr/pixel.gif" >
</form>
EDIT TWO
Ok, kinda confused about how to get the item increments to show up.
Advice would be appreciated.
These are the changes I've added to the post above:
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
Then to have the increment ability added ... I'm really confused by these lines and how to make it work for mine.
<input type="hidden" name="item_name_1" value="Item Name 1">
<input type="hidden" name="amount_1" value="1.00">
So, for the first item in my drop-down box (ie, the platinum ticket), I've modified it slightly, adding the name value:
<option value="15000" name="platinum">$15,000 - Platinum Sponsorship</option>
And then,
<input type="hidden" name="item_name_1" value="platinum">
<input type="hidden" name="amount_1" value="15000.00">
But as far as I can tell, that doesn't allow the user to change the quantity to what they want.
End of EDIT TWO
EDIT THREE Based on Jared's code beneath but posting a full version of it.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="BLAHBLAH">
<!-- Specify a Donate button. -->
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<!-- Specify details about the contribution -->
<input type="hidden" name="item_name" value="Corporation">
<input type="hidden" name="item_number" value="Ticket Purchase">
<select name="amount">
<optgroup label="Sponsorship">
<option value="Platinum Sponsorship">$15,000 - Platinum Sponsorship</option>
<option value="Gold Sponsorship">$10,000 - Gold Sponsorship</option>
</optgroup>
</select>
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="option_select0" value="Platinum Sponsorship">
<input type="hidden" name="option_amount0" value="15000.00">
<input type="hidden" name="option_select1" value="Gold Sponsorship">
<input type="hidden" name="option_amount1" value="10000.00">
<input type="hidden" name="option_index" value="0">
<br /><br />
<!-- Display the payment button. -->
<input type="image" name="submit" border="0"
src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif"
alt="PayPal - The safer, easier way to pay online">
<img alt="" border="0" width="1" height="1"
src="https://www.paypal.com/en_US/i/scr/pixel.gif" >
</form>
All I get from this form is Your shopping cart is empty.
END OF EDIT THREE
EDIT FOUR
1. <input type="hidden" name="item_name" value="Donation">
2. <input type="hidden" name="button_subtype" value="products">
3. <input type="hidden" name="no_note" value="1">
4. <input type="hidden" name="no_shipping" value="2">
5. <input type="hidden" name="currency_code" value="USD">
6. <input type="hidden" name="weight_unit" value="lbs">
7. <input type="hidden" name="add" value="1">
8. <input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHosted">
Do we need 2, 3, 4, & 6?
I get one, it's a way to label it, right?
2, what is button_subtype?
3, that's to say that there is no more additional info included, right?
4, is that needed? it's just purchase of a ticket online.
5, obviously needed.
6, is weight_unit really needed? as mentioned previously, it's just an online ticket.
7, is? I'm guessing a way for the incrementation to happen?
8, is to denote that the button is not hosted from paypal, right?
You don't have to answer any of those questions, and your answer has been accepted. Just wondering, is all.
Thank you again, Jared.
END OF EDIT FOUR
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" >
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="Your Email Here">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Donation">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="weight_unit" value="lbs">
<input type="hidden" name="add" value="1">
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHosted">
<table>
<tr><td><input type="hidden" name="on0" value="Sponsorship"></td></tr><tr><td><select name="os0">
<optgroup label="Sponsorship">
<option value="Platinum Sponsorship">Platinum Sponsorship $15,00.00 USD</option>
<option value="Gold Sponsorship">Gold Sponsorship $10,000.00 USD</option>
</optgroup>
</select> </td></tr>
</table>
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="option_select0" value="Platinum Sponsorship">
<input type="hidden" name="option_amount0" value="15000.00">
<input type="hidden" name="option_select1" value="Gold Sponsorship">
<input type="hidden" name="option_amount1" value="10000.00">
<input type="hidden" name="option_index" value="0">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
This is how your button should look, this is from paypal.
The donation button does not allow you to use a quanity because its intended for a donation, not a purchase. You can, however have the function of the add to cart button but appear as a donation button. Simply:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<!-- Specify a Add to Cart button. -->
<input type="hidden" name="cmd" value="_cart">
<!-- Specify details about the contribution -->
<input type="hidden" name="item_name" value="Name Of Business">
<input type="hidden" name="item_number" value="Tickets">
<select name="amount">
<optgroup label="Sponsorship">
<option value="15000" name="platinum">$15,000 - Platinum Sponsorship</option>
<option value="10000">$10,000 - Gold Sponsorship</option>
<option value="5000">$5000 - Silver Sponsorship</option>
<option value="2500">$2,500 - Bronze Sponsorship</option>
</optgroup>
<optgroup label="Individual Seating">
<option value="500">$500 per seat</option>
</optgroup>
<optgroup label="Program Book Tribute Journal Ad">
<option value="600">$600 - Half Page</option>
<option value="1000">$1000 - Full Page</option>
</optgroup>
</select>
<input type="hidden" name="currency_code" value="USD">
<br /><br />
<!-- Display the Donation payment button. -->
<input type="image" name="submit" border="0"
src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif"
alt="PayPal - The safer, easier way to pay online">
<img alt="" border="0" width="1" height="1"
src="https://www.paypal.com/en_US/i/scr/pixel.gif" >
</form>
<input type="hidden" name="Ticket"><select name="os0">
<optgroup label="Sponsorship">
<option value="Platinum Sponsorship">$15,000 - Platinum Sponsorship</option>
<option value="Gold Sponsorship">$10,000 - Gold Sponsorship</option>
</optgroup>
</select>
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="option_select0" value="Platinum Sponsorship">
<input type="hidden" name="option_amount0" value="15000.00">
<input type="hidden" name="option_select1" value="Gold Sponsorship">
<input type="hidden" name="option_amount1" value="10000.00">
<input type="hidden" name="option_index" value="0">
Hi I am creating a form where I want to pass the prices to paypal. I have copied one of the sauce examples but I just keep getting the above error. Does any one have any ideas?
PayPal cannot process this transaction because of a problem with the seller's website.
thanks in advance Mikemc.
code is below
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="my details">
<!-- Specify a Buy Now button. -->
<input type="hidden" name="cmd" value="_xclick">
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name" value="my Product">
<input type="hidden" name="currency_code" value="GBP">
<!-- Provide a dropdown menu option field with prices. -->
<input type="hidden" name="on0" value="test">test<br />
<select name="os0">
<option value="1page">1 page £40.00 GBP</option>
<option value="4page">4 page £100.00 GBP</option>
<option value="6page">6 page £130.00 GBP</option>
</select> <br />
<!-- Specify the price that PayPal uses for each option. -->
<input type="hidden" name="option_index" value="1">
<input type="hidden" name="option_select0" value="1page">
<input type="hidden" name="option_amount0" value="40">
<input type="hidden" name="option_select1" value="4page">
<input type="hidden" name="option_amount1" value="100">
<input type="hidden" name="option_select2" value="6page">
<input type="hidden" name="option_amount2" value="130">
<!-- Display the payment button. -->
<br>
<input type="image" name="submit" border="0"
src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif"
alt="PayPal - The safer, easier way to pay online">
<img alt="" border="0" width="1" height="1"
src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>
I'm using the MediaWiki:Secure_HTML extension, and trying to render a Google Checkout button I generated.
The button code is this:
<form action="https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/XXXXXXXXX" id="BB_BuyButtonForm" method="post" name="BB_BuyButtonForm" target="_top">
<table cellpadding="5" cellspacing="0" width="1%">
<tr>
<td align="right" width="1%">
<select name="item_selection_1">
<option value="1">$80.00 - Freeside Membership Dues (Standard)</option>
<option value="2">$40.00 - Freeside Membership Dues (Starving Hacker)</option>
<option value="3">$65.00 - Freeside Membership Dues (Joint-MIC)</option>
</select>
<input name="item_option_name_1" type="hidden" value="Freeside Membership Dues (Standard)"/>
<input name="item_option_price_1" type="hidden" value="80.0"/>
<input name="item_option_description_1" type="hidden" value=""/>
<input name="item_option_quantity_1" type="hidden" value="1"/>
<input name="item_option_currency_1" type="hidden" value="USD"/>
<input name="item_option_name_2" type="hidden" value="Freeside Membership Dues (Starving Hacker)"/>
<input name="item_option_price_2" type="hidden" value="40.0"/>
<input name="item_option_description_2" type="hidden" value=""/>
<input name="item_option_quantity_2" type="hidden" value="1"/>
<input name="item_option_currency_2" type="hidden" value="USD"/>
<input name="item_option_name_3" type="hidden" value="Freeside Membership Dues (Joint-MIC)"/>
<input name="item_option_price_3" type="hidden" value="65.0"/>
<input name="item_option_description_3" type="hidden" value=""/>
<input name="item_option_quantity_3" type="hidden" value="1"/>
<input name="item_option_currency_3" type="hidden" value="USD"/>
</td>
<td align="left" width="1%">
<input alt="" src="https://checkout.google.com/buttons/buy.gif?merchant_id=XXXXXXXXX&w=121&h=44&style=white&variant=text&loc=en_US" type="image"/>
</td>
</tr>
</table>
</form>
I am able to get the button to show up on my page edit just fine - however, the formatting is completely off. It appears that the <input type="hidden"> items for each of my drop-down options is being rendered, which is adding a lot of whitespace. The items aren't visible, but in the generated Secure HTML it appears like this, more or less:
I'm hoping to either use some CSS to correct the mess, or maybe there's another extension that's more appropriate or handles <input> better?
Turns out putting in whitespace may generate artifact <pre> tags via the Markdown, so there's some bugs with respect to formatting the code within the <shtml>. Removing a lot of the whitespace in code that gets hashed by the Secure_HTML resolves the problems.
Wrap the chunk of hidden inputs in a block element. To neaten up a bit you can move that block to the top of the form -above the table. Since the input tags will still be inside a block-level element (the fieldset tags) it will remain valid XHTML.
<form action="https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/XXXXXXXXX" id="BB_BuyButtonForm" method="post" name="BB_BuyButtonForm" target="_top">
<fieldset style=”display: none”>
<input name="item_option_name_1" type="hidden" value="Freeside Membership Dues (Standard)"/>
<input name="item_option_price_1" type="hidden" value="80.0"/>
<input name="item_option_description_1" type="hidden" value=""/>
<input name="item_option_quantity_1" type="hidden" value="1"/>
<input name="item_option_currency_1" type="hidden" value="USD"/>
<input name="item_option_name_2" type="hidden" value="Freeside Membership Dues (Starving Hacker)"/>
<input name="item_option_price_2" type="hidden" value="40.0"/>
<input name="item_option_description_2" type="hidden" value=""/>
<input name="item_option_quantity_2" type="hidden" value="1"/>
<input name="item_option_currency_2" type="hidden" value="USD"/>
<input name="item_option_name_3" type="hidden" value="Freeside Membership Dues (Joint-MIC)"/>
<input name="item_option_price_3" type="hidden" value="65.0"/>
<input name="item_option_description_3" type="hidden" value=""/>
<input name="item_option_quantity_3" type="hidden" value="1"/>
<input name="item_option_currency_3" type="hidden" value="USD"/>
</fieldset>
<table cellpadding="5" cellspacing="0" width="1%">
<tr>
<td align="right" width="1%">
<select name="item_selection_1">
<option value="1">$80.00 - Freeside Membership Dues (Standard)</option>
<option value="2">$40.00 - Freeside Membership Dues (Starving Hacker)</option>
<option value="3">$65.00 - Freeside Membership Dues (Joint-MIC)</option>
</select>
</td>
<td align="left" width="1%">
<input alt="" src="https://checkout.google.com/buttons/buy.gif?merchant_id=XXXXXXXXX&w=121&h=44&style=white&variant=text&loc=en_US" type="image"/>
</td>
</tr>
</table>