How do I LIMIT the times a CHECKOUT button can be KLICKED?

Discussion in 'Programming' started by Frederick, Apr 11, 2011.

to remove all ads.
  1. Frederick

    Frederick New Member

    Messages:
    6
    I am trying to make a website to sell my limited edition sculptures.

    Is it possible to set a limit to the number of times the checkout button can be clicked, so that visitors to my website can't place an order after the sculptures have run out of stock? Can it be done with Javascript? (I don't intend to complete orders on my website, but instead link the checkout button to PayPal payments.)

    It would also be convenient if the last klick on the checkout button results with the text "Out of Stock" being displayed.

    Any ideas of suitable script for this?
     
  2. palme

    palme New Member

    Messages:
    12
    you cant do it with only just script but a database like mySQL or msSQL depend of you work with php or asp or else...
    and a button check over a table of your database , this means each time user will pay, first check that table if table is not empty then script go further to payment else stop the user for paying.
     
  3. Frederick

    Frederick New Member

    Messages:
    6
    Thank you. So the counter Checkout button will be dependent upon the web-server where I register my website, through PHP (or asp) script language.

    I will try to sort out som script for the commands and conditions of the button. I guess it must be a combination of JavaScript, style sheet (ss), and PHP.
     
  4. Frederick

    Frederick New Member

    Messages:
    6
    Must cookies be used to remember the count of the button?
     
  5. leroy30

    leroy30 New Member

    Messages:
    485
    You wouldn't be usig cookies for the situation you described above. What you need to do is create a database that has a table (i.e. products) then in the products table you have a record that represents your limited edition item. Now, when someone buys your limited edition item you update the record in the database so, for example, you now have 14 available. Next user to buy one you update the database record again to say there are 13 left available.

    When you are down to 0 available then you programmatically disable the button server-side (i.e. in PHP, VB.net or C#.net) before the page is rendered.

    You can't achieve this with javascript or cookies.
     
  6. Frederick

    Frederick New Member

    Messages:
    6
    Thank you. That saves me from the time of getting into how cookie scripts work.

    I learned from scratch (with the help of books and searching the internet) to build up a basic website with text, pictures, links, etc. But making the order check out page work seems a lot more difficult!

    I am going to make an effort to study the basics of PHP, but I have a feeling I won't be able to handle this. It's above my head, I think. Maybe I'll just have to settle for a link button to Ebay and sell my items through them. At least it's a start.
     
  7. mhack122

    mhack122 New Member

    Messages:
    32
    but i think you have to limit with 2 clicks.....
     
  8. computerGeek

    computerGeek Banned

    Messages:
    212

    yeah, so agree with this one.. it's a very efficient method..
     
  9. Frederick

    Frederick New Member

    Messages:
    6
    Hmm, after hundreds of hours I still can't figure out how to make a working program with PHP script that will update the number of items available in stock.

    I am considering a primitive method, for manually taking orders: The customer must first email me his interest, and if I have the item in stock, I email back a link to PayPal through which the customer can pay for the item.
    Even if this perhaps is a rather amateurish and unattractive payment method to use for a website order page, would it still be acceptable? Or is it unsafe?
     
  10. leroy30

    leroy30 New Member

    Messages:
    485
  11. Phreaddee

    Phreaddee Super Moderator Staff Member

    Messages:
    1,978
    just built it in a cms with shopping cart that has inventory control enabled. really ****ing simple. please no need to reinvent the wheel.

    if you go down the old manual path you wont get hardly anyone buying from you. plus it'll make you out to be cheap and not very professional, and that's entirely the opposite of what you would want to achieve with your art.

    Person A
    "Should I buy this sculpture from Frederick for $2800?"
    Person B
    "I dont know it looks good and all but his website is pretty cheap and tacky. He probably did his sculpture on the cheap as well..."
    Person A
    "yeah I wont bother..."
    Person B
    "haha, cheapskate artists, always skimming..."

    I think you get my point...
     
  12. Frederick

    Frederick New Member

    Messages:
    6
    Yes, paying for a ready-made system is an option I probably must consider. And if it can be exactly custommade in appearance, all the better. For me, starting out small, it is a financial question, and also a question of desire for independence. I definitely don't want to have to sell through Ebay (that would really feel cheap), and if I could I would avoid Pay Pal as well. (But I suppose PayPal also means convenience, and added trust from customers.)

    Phreaddee, yeah you're probably right. (My pricerange will likely be $200 - $300.) Or, perhaps they will think, "Hey, this guy is 100% artist, and this is so rare and unique that I must make an effort to get it."
     
  13. Phreaddee

    Phreaddee Super Moderator Staff Member

    Messages:
    1,978
    well my own experience with making websites for art galleries tells me otherwise.

    there are a lot of free cms options you can use, and most I believe have some form of cart. almost all of the carts i've used in the past have had inventory control. as long as you've got your domain and some hosting space you can implement them. It will require an overhaul of the entire website, but in the end it would be worth your while.

    ps. soz if my post sounded cranky.
     

Share This Page