How to Code Exclusivity Into Website?

by 12 replies
15
Hey Coder Warriors,

Here's a tough one:

The project: limit purchases of a product to one person per city per type of service. For example, only one house cleaning service in Boulder, CO can buy the product.

The idea is to keep an area exclusive to the first service provider to buy the product in an area. Almost all services, so no way to count how many. All cities in the USA, with major cities broken down into smaller areas. So at least 200.

Is there a way to code this into a website or payment processor (not PayPal or BrainTree) so that buyer can choose his service and area? And then after his purchase has processed, this service and area are removed, so no longer an available choice?
#programming #code #exclusivity #multiple choice #website
  • You could modify a shopping cart that draws from inventory.
    • [ 2 ] Thanks
  • Have all the areas in a database then have the buyer select their desired area from a list generated from the entries in the database.

    When the purchase has been confirmed remove that area from the database so it does not get shown as a purchase option.

    Should be easy with php so yes it can coded into a website.
    • [1] reply
    • Can the removal from the database be automated?
      • [1] reply
  • Yes, this is certainly doable. I don't know of any off-the-shelf programs that can do this but in general, I would set it up this way:

    1) have a check availability tool on your site that uses city/zipcode to search depending on how you define territories.

    2) that polls your database to see if there is availability.

    3)
    a. if it is available, then proceed to checkout
    b. if not, ask if the person wants to be notified if it comes available

    4) when someone purchases update the availability in your database

    I have a friend who has a franchise business that operates this way. Their volume is low so they just update the database manually once orders are approved - but it certainly could be automated.
    • [ 1 ] Thanks

  • Everyone is saying database, and that's fine, but you could also
    simply generate all 200 pages so that they are static.

    I guess the key that nobody is talking about is using a tracking
    pixel once the purchase has been made to update a counter.

    Most processors allow you to include a redirect upon successful
    purchase. This whole exclusivity/purchase "tough one" can be
    easily coded in php with or without a database, or any other
    language for that matter.
    • [1] reply
    • The problem with pixels is that the graphic may not be loaded; it's not the appropriate vehicle for this, and could result in double-delivery, the precise problem that the OP is trying to avoid.

      Even if it's very simple, a database is the correct answer. The shopping cart approach uses a database under the covers. (Unless I'm missing something, even pixel-tracking systems use databases, as well.)
      • [1] reply
  • Thank you MW and DB. Of course that is as clear as mud to non-developers. What kind of coder would I hire to do that?
    • [2] replies

Next Topics on Trending Feed