Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Hybrid View

  1. #1
    Join Date
    Aug 2009
    Posts
    40
    Plugin Contributions
    0

    Default Digital Product Key?

    Hi Everyone,

    I am interested in using ZenCart, looks super! I am wondering if there is a way to make it support my business model, I searched the forums but no luck yet so thought I'd ask. Anyway here goes: I am selling software. The software is available to anyone as a download, and will function in demo mode until the user enters a valid key. So what I need is two things:

    1.) Zen cart checkout is linked to a key generator and provides the registration key upon a successful purchase (not a download, but the key!).
    2.) Zen cart registers the user and the product key in a database to be used later for activation.

    Is this possible, is there an add-on that is close to this scenario or a way to do it already? I could program it, but I do not really understand what happens on the checkout process or where those functions are handled. What happens with the information passed back to the return URL upon successful purchase? Should I just try and write my own checkout process, bypassing the Zen Cart one altogether or is there a better solution to also keep the ZenCart checkout data intact? Thanks for any help!!!

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Digital Product Key?

    There's a section in /includes/classes/order.php that allows you to insert data such as a product registration key in the customer's order confirmation email:
    PHP Code:
        $this->notify('NOTIFY_ORDER_DURING_CREATE_ADD_PRODUCTS'$custom_insertable_text);

    /* START: ADD MY CUSTOM DETAILS
     * 1. calculate/prepare custom information to be added to this product entry in order-confirmation, perhaps as a function call to custom code to build a serial number etc:
     *   Possible parameters to pass to custom functions at this point:
     *     Product ID ordered (for this line item): $this->products[$i]['id']
     *     Quantity ordered (of this line-item): $this->products[$i]['qty']
     *     Order number: $zf_insert_id
     *     Attribute Option Name ID: (int)$this->products[$i]['attributes'][$j]['option_id']
     *     Attribute Option Value ID: (int)$this->products[$i]['attributes'][$j]['value_id']
     *     Attribute Filename: $attributes_values->fields['products_attributes_filename']
     *
     * 2. Add that data to the $this->products_ordered_attributes variable, using this sort of format:
     *      $this->products_ordered_attributes .=  {INSERT CUSTOM INFORMATION HERE};
     */

        
    $this->products_ordered_attributes .= ''// $custom_insertable_text;

    /* END: ADD MY CUSTOM DETAILS */ 
    If you were to simply make a call to your custom script that returns the serial number, and add that serial number as described, the process is quite simple.
    You could pass the customer's email address to the custom script, and allow that script to either generate the serial number or pick an available one from a database of pre-generated-but-unassigned numbers and assign it to that customer all at the same time. Zen Cart would handle passing the info to the customer if you simply supply the key as described in the code comments quoted above.

    You could even go so far as to use the notifier/observer infrastructure and not have to touch the existing class file hardly at all.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Aug 2009
    Posts
    40
    Plugin Contributions
    0

    Default Re: Digital Product Key?

    DrByte,

    Thank you for this information! That sounds like an excellent solution and just what I need!

  4. #4
    Join Date
    Aug 2009
    Posts
    40
    Plugin Contributions
    0

    Default Re: Digital Product Key?

    OK, just a few more questions regarding this process:

    1.) Where does the customer's e-mail come from? I only see the following parameters that can be passed to the custom function: Product ID, quantity, Order #, Attribute Option Name ID, Attribute Option Value ID, and Attribute Filename.

    2.) If the customer has purchased multiple software products, is this held in an array products[]? Can I pass the whole array and have my custom function loop through it to return all the valid keys?

    3.)How does Zen Cart handle passing the info to the customer? Is it an e-mail or is it printed out on the confirmation page?

    Thanks for your help!

  5. #5
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Digital Product Key?

    1. $this->customer['email_address']

    2. At the point in the code which I referenced earlier, it is looping through all the attributes assigned to each product.
    So, you would refer to the following:
    $this->products[$i]['id']
    $this->products[$i]['qty']
    $attributes_values->fields['products_options_name']
    $this->products[$i]['attributes'][$j]['value']
    and if necessary:
    $attributes_values->fields['products_attributes_filename']

    3. The customer receives an order-confirmation email after the order is placed. If you add the reg key in the location I suggested, then the serial number will be added as part of each individual attribute's text in that confirmation email.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Aug 2009
    Posts
    40
    Plugin Contributions
    0

    Default Re: Digital Product Key?

    Oh I see, excellent! Thank you once again, you are a really great help!

  7. #7
    Join Date
    Sep 2010
    Posts
    32
    Plugin Contributions
    0

    Default Re: Digital Product Key?

    I want functionality in zencart similar to Template monster have like customer purchase template and he get the .zip file and 'Serial' .

    Is it possible in zen cart?

  8. #8
    Join Date
    Nov 2010
    Posts
    3
    Plugin Contributions
    0

    Default Re: Digital Product Key?

    I have just started to get into Zen Cart, and am excited. Installed the latest version fine. I'm not a heavy coder, but can do small code modifications. : } We sell software via downloads and have been using ejunkie, which is okay but we'd like to switch to Zen Cart for various reasons.

    We need to have the customer get a serial number as part of the order confirmation email, as talked about in this thread. In our case, I'd like to have a simple database (one database per product; we have about 20 products -- or one database that can handle all of the products) that lists available unassigned serial numbers per product. When the serial number is retrieved, it is removed from the queue in the database. The database <> Zen Cart connection is the part I do not understand -- how/where does Zen Cart access this database for that info? What steps would I need to take in Zen Cart to set that up? Thanks in advance for whatever insights you can provide.

    ~ Michael

  9. #9
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Digital Product Key?

    The simplest approach may be to add one or more tables to the regular Zen Cart database - then there will be no new access issues.

    A database expert could tell you how best to organize the new table(s).

  10. #10
    Join Date
    Nov 2010
    Posts
    3
    Plugin Contributions
    0

    Default Re: Digital Product Key?

    Thanks for the reply. "add one or more tables to the regular Zen Cart database" -- I understand at this early learning point for me the the database is accessed by using phpMyAdmin... but could you tell me the basics of adding a table to the database (without messing up the existing parts of it) and then the basics of pointing the serial number item in the customer email to that? Thanks.

    ~ Michael

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v154 Digital Product Upgrade
    By swguy in forum All Other Contributions/Addons
    Replies: 7
    Last Post: 17 Apr 2019, 08:26 PM
  2. v150 Digital Seller? New 2015 EU Digital VAT Affects You
    By compugen in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 58
    Last Post: 18 Dec 2015, 03:32 PM
  3. Replies: 0
    Last Post: 2 Jun 2010, 06:14 PM
  4. Licence Key delivery for digital (software) products
    By outofbandii in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 26 Feb 2010, 08:16 PM
  5. Replies: 0
    Last Post: 13 Sep 2007, 08:23 PM

Posting Permissions

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