weevilofdoom Posted November 26, 2013 Posted November 26, 2013 I am looking for a way to create a custom file download where the file does not exist until the person has checked out. This file will be an auto-generated code that will be used for different things including support (phone in and key in your code rather than answering a bunch of questions type thing) where it can be looked up in a database and matched for validity. Are there any suggestions how this can be accomplished? I know you can specify a filename to download as a product attribute - but re-writing this file every time somebody orders is not the solution I am looking for. Quote
burt Posted November 26, 2013 Posted November 26, 2013 (edited) Hmm, you need to give far far more detail. - how is the code generated - how should it be delivered to the client - how is it checked for validity Write down the perfect procedure from start to finish as if: - you were the one buying the code - you were the one answering the phone/email when a person calls with the code Edited November 26, 2013 by burt Quote
weevilofdoom Posted November 26, 2013 Author Posted November 26, 2013 (edited) The person buys said product - the code is generated (dynamically with php) at purchase and presented on the success page (as well as email/file download) The person calls the phone number, and is asked to verify their code via automated system - once verified, the call is routed. This generated code needs to be stored in a database table for validation. When they key in their code to the phone system, it will look this up. Nobody answers a phone until it is checked as valid. A call is not routed if the code is not valid. Not sure if there is any more detail I can provide that will be useful. Basically, it is an "extended support by phone" product. Note: The phone system is already setup and working. Just need to add this special product type to osCommerce. Looking for tips on where to start. Edited November 26, 2013 by weevilofdoom Quote
burt Posted November 27, 2013 Posted November 27, 2013 Without thinking about it, I suggest to store the code in a new table: customers_id orders_id pin_code date_added Creation of this record can be done at checkout_process.php You presumably can access this as you wish. You can check for date_added to see if it is within the last 12 months. It doesn't need to be a special product type, just get the product_id and if it the "buy a code" product, insert the record. Add it to the outgoing email. Done. You can make it more complicated, but what's the point ? Quote
weevilofdoom Posted November 27, 2013 Author Posted November 27, 2013 (edited) Thanks for the reply - I had actually come to that same conclusion not 10 minutes ago! Cheers. Come to think about it - I'm going to leverage the "Product Attributes" instead of "Product ID" so I can assign this to multiple products - but the rest of the idea is the same. Thanks! Edited November 27, 2013 by weevilofdoom Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.