I recently converted my site to use OpenCart. My site sells digital software downloads (Mac Desktop App). The software I am selling has an activation procedure that contacts my web server to validate a user, and count the number of purchases made of a specific product. The user is allowed to activate the software on 3 computers per purchased license. So if they have bought 1 license, they are allowed 3 activations.
With my old store/cart, during a post-purchase hook, I was storing the activation data in 2 custom tables (licenses and activations). The reason I store licenses in a separate tables, (rather than counting them from invoice purchases) is because if I ever delete or archive invoices, I still need the activation data to remain intact.
So, now I need to rewrite my software activation.php script to work with OpenCart. Here are my questions:
1) If I delete an order via OpenCart Admin, does it delete/affect a users associated downloads?
In other words, should I be pulling a users total licenses for a product directly from order_download table, or do I still need to maintain a completely de-normalized table (licenses) to store a users purchased quantity as I was doing with my old cart?
2) Similar question as above, but regarding activations table... Should I (still) keep all the activation data in my own table or would I be better to add the mac_addr, version, and date_activated fields to some existing table?
3) In my old store/cart, after a successful purchase (ipn success), I would add the license data to my custom table. Then whenever the App contacts server for activation, I would 1st validate the user, then get the total purchased product count for member_id. I would then retrieve that member_id/product_id combination from the activations table to confirm they have not exceeded allowed activations. Do I ultimately have to reproduce this exact behavior in OpenCart, or is there a better way?
My custom tables are:
licenses [license_id, invoice_id, member_id, product_id, product_qty, date_purchased]
activations [member_id, product_id, version, mac_addr, date_activated]
In OpenCart IPN success, I will need to add a record to licenses table. Is the data available in IPN success so I can add a record, given table structure above? Field names please :-)
In my new OpenCart activation.php script I need to:
a) Check for valid user given First Last, and email address, and retrieve the member/user id. How?
b) Use member_id/product_id to check activations table. I got this :-)
Any tips or psuedo-code would be a great help.
Thanks,
Chris
RGB World - FREE and Commercial Extensions
For custom work or support, please use our Contact Form or visit our Support Forum.
Favorite Quote: There are 10 types of people in the world. Those who understand binary and those who don't.
The only thing I need help with is the post-purchase IPN portion.
When a successful order is placed, I need to fill in a record in this table...
licenses [license_id, invoice_id, member_id, product_id, product_qty, date_purchased]
What file do I add my post-purchase handling code to?
Is the information that I need in order to add a record to the table above available in the IPN success function?
Thanks again,
Chris
RGB World - FREE and Commercial Extensions
For custom work or support, please use our Contact Form or visit our Support Forum.
Favorite Quote: There are 10 types of people in the world. Those who understand binary and those who don't.
Is the data available to add the record to my table?
licenses [license_id, invoice_id, member_id, product_id, product_qty, date_purchased]
Thanks!
RGB World - FREE and Commercial Extensions
For custom work or support, please use our Contact Form or visit our Support Forum.
Favorite Quote: There are 10 types of people in the world. Those who understand binary and those who don't.
Here's purchase process video - http://youtu.be/tbHF4cmOO3o
IPN processing for PayPal Standart resides at catalog\controller\payment\pp_standard.php
Some of the data you need may be not accessible thru variables there, but it's easy to get it with simple SQL query.
Yes, I saw the PayPal Digital downloads, and I was tempted to use it, but the instructions say it replaces ALL buttons with the instant checkout buttons, and I have some products that still need to use a cart. A demo of the admin would be helpful.
Will your extension allow only replacing the buttons for "some" products?
If so, I will consider using it in the future.
Regarding my questions... when querying OC tables for additional info while in pp_standard.php callback() function, I only need 5 values, and only for items purchased that have a digital download. Any assistance on where to get the other values is appreciated.
invoice_id - looks like I have this already in $order_id
customer_id
product_id
product_qty
date_purchased - can just be today, so that's easy
Thanks,
Chris
RGB World - FREE and Commercial Extensions
For custom work or support, please use our Contact Form or visit our Support Forum.
Favorite Quote: There are 10 types of people in the world. Those who understand binary and those who don't.
Users browsing this forum: No registered users and 61 guests