Mail: [email protected] Phone: +1(424)231-4091

Installing And Updating A Module

NexoPOS 4.x modules aim to provide more features to it. It's provided as a ZIP file that needs to be updated on NexoPOS 4.x. Some require as installed just by uploading a zip file, others require further configuration that can only be performed from the command line. But before elaborating on the installation and update, let's see the difference between installing and updating a module.

# Difference Between Installing And Updating a Module

For NexoPOS 4.x there is no difference in terms of process. Either the installation and the update is performed from the same UI. NexoPOS 4.x will be responsible to detect if there is a similar module exists and if the version of the new uploaded module is greater to perform an update.

# Where To Download NexoPOS 4.x extensions

At the moment, the most recommended website to download NexoPOS 4.x extensions is on the marketplace of NexoPOS 4.x.

These are official and approved modules reviewed by the NexoPOS team. Some of these modules might be available for free, others after a payment.

# Where Do Modules Are Installed On NexoPOS 4.x

During the installation of a module, NexoPOS 4.x creates a folder with the module namespace (identifier) within the "modules" folder. In case you would like to install a module from Github, you'll need to change the directory to the "modules" folder and then perform the git clone command.

Modules can also be dragged and dropped and extracted to that folder, but you'll need to manually create a symlink for that module. Let's assume your module identifier is "NsGastro" (for Gastro 4.x), and you copy and paste the module (for the first time). You'll need to run the following command on the CLI.

php artisan modules:symlink NsGastro

Doing that will create a symbolic link to the public folder of the module.

# How To Install / Update A Module On NexoPOS 4.x

We need to make sure the module management is not disabled on the .env file located at the root of NexoPOS 4.x (it's disabled by default). In case you receive a warning related to the module management being disabled, make sure to check if the "NS_MODULES_MANAGEMENT_DISABLED" is set to "false" or delete the key-value pair. If you can't find that key-value pair, then you can proceed.

Now, we assume you have the zip file of the module you would like to install/update. Let's now head to the modules list.

Click on "Upload" on that UI or you can click on the sub-menu "Upload Module". This should takes you to a UI where you can upload your zip file.

You just have to click on Upload now. If the module is recently updated and has migrations, it will run automatically. If it's an update and if that update includes new migrations, these will also run automatically.

# Additional Configurations For Modules

Some modules might rely on external packages that can be installed using composer, others might need to have their frontend build or some might need both. Usually, the developer will provide instructions on what needs to be performed for a better update. Most of the time, if your module includes a composer.json file, you can run the following command :

composer install

If the module you've installed doesn't come with assets built (this should be clearly stated by the module author). You'll probably need to run :

npm install

And other configurations that might be necessary to build the assets (should be provided by the module author).

# Troubleshooting

These will help to debug the issue you might face while uploading a module.

# Wrong File Permissions

While uploading a module to NeoxPOS 4.x, you need to make sure that the folder "modules" is owned by the user that runs the php process. On Ubuntu the user is usually "www-data" on Centos it's "apache", but it might be different according to the Linux distro and hosting you're using.

Typically you'll give ownership like so :

sudo chown www-data modules -R

If the issue persists, please let us know with an appropriate screenshot.

# Modules Management Is Disabled

As we have mentioned at the beginning of this guide, you need to make sure the key "NS_MODULES_MANAGEMENT_DISABLED" is either set to false or deleted from your .env file.