Plugin upgrades

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 anni tempo fa
Hi, I think I'm missing a really obvious feature with regards to plugin development and  I'm hoping someone can tell me where to look.

I have created a plugin, resources have been added and tables installed.
I have users data in the tables and don't want to lose that.
Now I have added extra functionality, I saw the "Version" number in plugin.json and assumed incrementing that would display an "update" button. It has not.

If I uninstall and reinstall I would lose all user data, what steps need to be taken to update a plugin in nopCommerce?
3 anni tempo fa
There should be green button “Upload plugin or theme” up the top of the Local Plugins page
This uploads and overwrites the current plugin - it does not run the install / unistall again
The install / unistall functions need to be manaully requested  
Changing the version number does not force an update as such - but how did you change the version number ?
Or are you running in Visual Studio ?
3 anni tempo fa
Actually "Changing the version number" can "force an update".   I vaguely recall tracing this through when 4.30 first came out.  I think the system will check the version in your plugin.json compared to the version in the \App_Data\plugins.json entry (for your plugin in the InstalledPlugins section), and if the different, then your Upgrade() is performed (if you have overridden the Update() of the abstract class BasePlugin).

a) At the database (based on Migration, i.e. if you have an updated NopMigration['key'] .)

b) If you have  overridden the Update()  - e.g.

public override void Update(string currentVersion, string targetVersion)
{
    if (currentVersion.CompareTo(targetVersion) < 0)
    {
        if (currentVersion.CompareTo("2.10") < 0)
            UpdateVersion210();
        if (currentVersion.CompareTo("2.20") < 0)
            UpdateVersion220();
    }
}
3 anni tempo fa
@Yidna thanks for your response. Yes I am running VS. I made the update by by changing the json version number.

@NewYork I had not found update, that looks like what I need, thank you
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.