Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Hi, I am trying to make a custom button for a site...

    Hello, I hope somebody can help me out.

    I am trying to create a PAYPAL 'buy now' button which does the following (it's vaguely like an auction):

    - When clicked on and item bought the price will be, for example, 1.00. Once the sale is complete, the item may not be bought again for 1.00.

    - Automatically when the next user clicks on the button and completes a purchase it will automatically be for 2. For the third, 3 and so on.

    - I would like this to occur so no two people can buy for the same price, it will be ever increasing.

    Any ideas? With basic designing I am ok, but this is out of my depth.

    Thank you in advance everyone

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    3,763
    Thanks
    23
    Thanked 548 Times in 547 Posts
    Lets say four people are looking at the same item for 1.00 and user A clicks buy now. How do the others know the price went up even if we do program the button for you?

    Look at ajax push here: http://www.ape-project.org/

  • #3
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hi,
    if more than one person clicked buy the button when it said 1.00 then the first payment processed would be succesful and the second/third/fourth would be redirected with the button saying an updated number.

  • #4
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    3,763
    Thanks
    23
    Thanked 548 Times in 547 Posts
    OK that works for me.

    Your page probably will have a picture of the item, a description of it, the price, and the button. You get this info from a DB called merchandise. These items are written into a form alone with a hidden item id number so they will be sent to the php file when the button is clicked.

    When the buy me button is clicked the php it calls looks at the cost(price) in DB merchandise. If it's the same as the page we change it to the next higher value in the DB and proceed to write data to a purchase DB - that being the item, item number, cost and buyer with buyerID to link to his account.

    If the price that was sent to the php via a $_POST method and the DB cost are different then we rewrite the page with the new price.

    That should work.

  • Users who have thanked sunfighter for this post:

    adamfitch (08-31-2012)

  • #5
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Wow, thank you!

    Would you say this would be particularly difficult to produce? Really good information there.

  • #6
    Regular Coder nomanic's Avatar
    Join Date
    Feb 2009
    Location
    United Kingdom
    Posts
    255
    Thanks
    9
    Thanked 33 Times in 33 Posts
    what about this

    I press buy now and spend 20minutes flapping around on paypal

    before I've actually paid for the item someone else has pressed buy now

    if you increment simply by pressing the button before going to paypal, the price will go up regardless of whether it has been bought or not

    if you only increment after payment has been received from paypal, then others can buy while you are in paypal, and multiple people can buy at each level of price

    theoretically
    <DmncAtrny> I will write on a huge cement block "BY ACCEPTING THIS BRICK THROUGH YOUR WINDOW, YOU ACCEPT IT AS IS AND AGREE TO MY DISCLAIMER OF ALL WARRANTIES, EXPRESS OR IMPLIED, AS WELL AS DISCLAIMERS OF ALL LIABILITY, DIRECT, INDIRECT, CONSEQUENTIAL OR INCIDENTAL, THAT MAY ARISE FROM THE INSTALLATION OF THIS BRICK INTO YOUR BUILDING."
    <DmncAtrny> And then hurl it through the window of a Sony officer
    <DmncAtrny> and run like hell

    Portfolio, Tutorials - http://www.nomanic.biz/

  • #7
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Yes, that is very very true indeed... something that seemed quite simple to me clearly isn't at all.

  • #8
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    3,763
    Thanks
    23
    Thanked 548 Times in 547 Posts
    Would you say this would be particularly difficult to produce?
    Depends on if you know php and can work with a database. If you can it's not difficult.

    And nomanic
    and multiple people can buy at each level of price
    was not in the original specs.
    - I would like this to occur so no two people can buy for the same price,
    Last edited by sunfighter; 08-31-2012 at 06:13 PM.

  • #9
    Regular Coder nomanic's Avatar
    Join Date
    Feb 2009
    Location
    United Kingdom
    Posts
    255
    Thanks
    9
    Thanked 33 Times in 33 Posts
    yes, so if you implement that route, people can buy at the same price and break the specs
    <DmncAtrny> I will write on a huge cement block "BY ACCEPTING THIS BRICK THROUGH YOUR WINDOW, YOU ACCEPT IT AS IS AND AGREE TO MY DISCLAIMER OF ALL WARRANTIES, EXPRESS OR IMPLIED, AS WELL AS DISCLAIMERS OF ALL LIABILITY, DIRECT, INDIRECT, CONSEQUENTIAL OR INCIDENTAL, THAT MAY ARISE FROM THE INSTALLATION OF THIS BRICK INTO YOUR BUILDING."
    <DmncAtrny> And then hurl it through the window of a Sony officer
    <DmncAtrny> and run like hell

    Portfolio, Tutorials - http://www.nomanic.biz/

  • #10
    Regular Coder nomanic's Avatar
    Join Date
    Feb 2009
    Location
    United Kingdom
    Posts
    255
    Thanks
    9
    Thanked 33 Times in 33 Posts
    one possible way round this -

    buy credits upfront for buying power through paypal

    then you have credits to spend

    when you press buy now, it reduces the amount of credits you have by the price, but the purchase is instant, and price can go up by say $1

    that way, all your specs are met, but they have to buy credits beforehand through paypal to participate
    <DmncAtrny> I will write on a huge cement block "BY ACCEPTING THIS BRICK THROUGH YOUR WINDOW, YOU ACCEPT IT AS IS AND AGREE TO MY DISCLAIMER OF ALL WARRANTIES, EXPRESS OR IMPLIED, AS WELL AS DISCLAIMERS OF ALL LIABILITY, DIRECT, INDIRECT, CONSEQUENTIAL OR INCIDENTAL, THAT MAY ARISE FROM THE INSTALLATION OF THIS BRICK INTO YOUR BUILDING."
    <DmncAtrny> And then hurl it through the window of a Sony officer
    <DmncAtrny> and run like hell

    Portfolio, Tutorials - http://www.nomanic.biz/


  •  

    Posting Permissions

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