License Key Plugin

7 年 前
To get this latest 3.50 version to work one has to make a few changes to the source code:

Routeprovider.cs: Add this mapping

                 new { controller = "ProductKey", action = "GetProductKey" },
                 new[] { "Nop.Plugin.Misc.Licenses.Controllers" }

ProductKeyConsumer.cs: Change one line in HandleEvent(...) to match:

  string url = "../../../Plugins/ProductKey/GetProductKey?productId=" + productId;

EditProductKey.cshtl: Add a 'using' at line 2

@using Nop.Web.Framework;

Maybe I'll find some other issues later.

DNF: Uninstall and install the plugin in the nop admin!
7 年 前
actOpus Thanks a lot.

My a little contribution.
I added a button for a generation LicenceKey


@model Nop.Plugin.Misc.Licenses.Models.ProductKeyModel
@using Nop.Web.Framework;

<table class="adminContent">
        <td class="adminTitle">
            @Html.NopLabelFor(model => model.ProductKey):
        <td class="adminData">
            @Html.EditorFor(model => model.ProductKey)
            <span id="licensekey-generate" class="k-button">Generate</span>
            <span id="licensekey-save" class="k-button">@T("Admin.Common.Save")</span>
            <span id="licensekey-message" style="color:#009900"></span>

<script type="text/javascript">
    $(document).ready(function () {
        $("#licensekey-save").click(function () {
            var model = {id: $("#Id").val(), productKey: $("#ProductKey").val() };
            $.post("@(Url.RouteUrl("Plugin.Misc.Licenses.SaveKey"))", model, function() {
        $("#licensekey-generate").click(function () {

    var generateRandomKey = function(length) {
        var chars = '!#^&*()0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
        var result = '';
        for (var i = length; i > 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))];
        return result;
7 年 前
Ah nice, I was using an online key generation tool but this is much easier
7 年 前
Hi there!

Have you changed it to support multistore license?

And after customer get the key, input it as plugin settings, how to verify it in destination plugin?

7 年 前
Does this plugin allow vendors to be able to have license keys assigned out and verified, or is it only a store owner?
7 年 前
Does anyone have a compiled version of this that works with 3.50 that they could post?

UPDATE: Nevermind, I got mine to compile correctly now.
7 年 前
Has anyone changed this plugin to work with trial versions of software? If so, would you mind supplying the code to do that?
7 年 前
So, we should have:

- trial keys;
- key use in multi-store;
- how to decrypt key in plugin configuration and check if it is valid when plugin is executed;
7 年 前
ivanslater wrote:
And after customer get the key, input it as plugin settings, how to verify it in destination plugin? Thanks!

Is this what you are looking for?
7 年 前
Yes, it is, but this method should be in a core or main plugin, so all other can use it, otherwise all plugins should have same method and any change should be painful.