Results 1 to 3 of 3
Thread: Javascript Cart Button
Hybrid View
-
09-27-2009, 01:56 PM #1Web Hosting Evangelist
- Join Date
- Aug 2007
- Location
- Oakham England
- Posts
- 503
Javascript Cart Button
Hey,
I am a photographer, I have a website with a gallery. The gallery is ran by Javascript, when you click the thumb nail the script will take the t off the same so say it was 001t.jpg it will make it 001.jpg and put that file in the div tag called image
However I want to be able to sell them using paypal's shopping cart...
however I need to put the gallery name and image name in the name on the button but I cant code javascript so can someone code me one that will update this for me and then put the code it makes into a div tag called cart?
PLEASE HELP!!!
Here is the paypal code
Code:<form target="paypal" 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="EMAIL"> <!-- Specify an Add to Cart button. --> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="add" value="1"> <!-- Specify details about the item that buyers will purchase. --> <input type="hidden" name="item_name" value="Gallery - '.$gal.' / Photo - 002"> <input type="hidden" name="currency_code" value="GBP"> <!-- Provide a dropdown menu option field. --> <input type="hidden" name="on0" value="Color">Color<br /> <select name="os0"> <option value="Select a color scheme"> -- Select a color --</option> <option value="Colour">Colour</option> <option value="B+W">Black and White</option> </select> <br /> <!-- Provide a dropdown menu option field with prices. --> <input type="hidden" name="on1" value="Size">Size <br /> <select name="os1"> <option value="Select a size">-- Select a size --</option> <option value="2x4">2 x 4 - £3.95</option> <option value="3x5">3 x 5 - £4.95</option> <option value="4x6">4 x 6 - £5.95</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="2x4"> <input type="hidden" name="option_amount0" value="3.95"> <input type="hidden" name="option_select1" value="3x5"> <input type="hidden" name="option_amount1" value="4.95"> <input type="hidden" name="option_select2" value="4x6"> <input type="hidden" name="option_amount2" value="5.95"> <input type="hidden" name="shopping_url" value="http://www.roizer.com"> <input type="hidden" name="shipping" value="1.00"> <input type="hidden" name="shipping2" value="0.50"> <!-- Display the payment button. --> <input type="image" name="submit" border="0" src="https://www.paypal.com/en_US/i/btn/btn_cart_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>
Streama - Your WordPress Friend
http://www.streama.co.uk
-
09-28-2009, 02:00 AM #2Junior Guru Wannabe
- Join Date
- Sep 2009
- Posts
- 45
Maybe I'm misunderstanding the problem, but you see this line here:
<input type="image" name="submit" border="0" src="https://www.paypal.com/en_US/i/btn/btn_cart_LG.gif" alt="PayPal - The safer, easier way to pay online">
I'm pretty sure that's the paypal button. If you want to use a different button with the name of your image on it, just make the button and replace the "https://www.paypal.com/en_US/i/btn/btn_cart_LG.gif" with something like "http://www.mysite.com/mybutton.gif"
If you do that, everything should function identical, but your button will be there in place of the paypal one...
-
09-29-2009, 10:32 PM #3New Member
- Join Date
- Sep 2009
- Posts
- 1
you user NetBear fix error!!!
Similar Threads
-
JavaScript (AJAX) Radio button weird behaviour
By monilchheda in forum Programming DiscussionReplies: 1Last Post: 05-22-2006, 01:19 PM -
JavaScript: determing which mouse button was pressed
By fozzy in forum Programming DiscussionReplies: 0Last Post: 03-29-2006, 11:04 AM -
Javascript Back button clears previous page's form
By jon31 in forum Programming DiscussionReplies: 9Last Post: 02-02-2006, 03:01 PM -
[Javascript] Submitting 4 forms with one submit button... Is it possible?
By jonathanbull in forum Programming DiscussionReplies: 15Last Post: 01-04-2005, 08:18 PM