Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2007
    Oakham England

    Javascript Cart Button


    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?


    Here is the paypal code
    <form target="paypal" action="" 
    <!-- 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"> 
    value="Select a size">-- Select a size --</option> 
    <option value="2x4">2 x 4 - &pound;3.95</option> 
    <option value="3x5">3 x 5 - &pound;4.95</option> 
    <option value="4x6">4 x 6 - &pound;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="">
    <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="" alt="PayPal - The safer, easier way to pay online"> 
    <img alt="" border="0" width="1" height="1" src="" > 
    Streama - Your WordPress Friend

  2. #2
    Join Date
    Sep 2009
    Maybe I'm misunderstanding the problem, but you see this line here:
    <input type="image" name="submit" border="0" src="" 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 "" with something like ""

    If you do that, everything should function identical, but your button will be there in place of the paypal one...

  3. #3
    you user NetBear fix error!!!

Similar Threads

  1. JavaScript (AJAX) Radio button weird behaviour
    By monilchheda in forum Programming Discussion
    Replies: 1
    Last Post: 05-22-2006, 01:19 PM
  2. JavaScript: determing which mouse button was pressed
    By fozzy in forum Programming Discussion
    Replies: 0
    Last Post: 03-29-2006, 11:04 AM
  3. Javascript Back button clears previous page's form
    By jon31 in forum Programming Discussion
    Replies: 9
    Last Post: 02-02-2006, 03:01 PM
  4. [Javascript] Submitting 4 forms with one submit button... Is it possible?
    By jonathanbull in forum Programming Discussion
    Replies: 15
    Last Post: 01-04-2005, 08:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts