Create an integration

Use our Integration Boilerplate Plugin to create an integration for North Commerce. There may be some cases where you will need to verify your integration with the North Commerce team.

Setup your environment

  1. Create a local development environment for your North Commerce integration

  2. Create a folder /wp-content/plugins/north-commerce-integration-boilerplate/

  3. Remove .git and .gitignore or modify them to your own needs

  4. Change info.json

    1. Replace {variables} to your own values. E.g plugin Name, last_updated, description, etc.

Run the generator

In your browser visit your-domain.local/wp-content/plugins/north-commerce-integration- boilerplate/integration-boilerplate-generator.php

Once the generator has ran rename the plugin folder north-commerce-integration-boilerplate to north-commerce-{slug}

Remove the generator file from the project now that it is no longer needed /wp-content/plugins/north-commerce-shipstation/integration-boilerplate- generator.php

Have fun!

Modify the README.txt file and modify the plugin code to suit your needs for an integration

Plugin Structure

In the boilerplate plugin you will notice a few folders and files.

  1. admin - This folder contains files for the plugin's admin panel in WordPress

  2. assets - This folder contains css, js and image files for your integration

  3. includes - This folder contains plugin functionality files or "the business logic"

  4. includes/integrations - This folder contains examples and code to integrate with a required service. You will see examples with Shipstation

  5. integration-boilerplate-generator.php - This file is used to modify the initial plugin code according to your parameters from the info.json. It is needed only once at the beginning of plugin creation. Please dont forget to delete after running the generator from your browser.

  6. info.json - This files is required to initalize the plugin generator. This file also is necessary to specify plugin version anmd to update your plugin from a server in the future.

  7. README.txt - The plugin requires a standard README.txt file containing the plugin description and version history

Webhook Integration

File: includes/integrations/class-north-commerce-webhooks.php

  • Designed to create webhooks for required Events in the "north-commerce" plugin

  • Reference implementation available at: north-commerce-addon-boilerplate/includes/integrations/class-north-commerce-webhooks.php

REST API Integration

File: includes/integrations/class-north-commerce-plugin-rest-api.php

  • Creates new REST API endpoints for Event-triggered functionality

  • Reference implementation available at: north-commerce-addon-boilerplate/includes/integrations/class-north-commerce-plugin-rest-api.php

Service Integration

File: includes/integrations/class-north-commerce-send-order.php

  • Contains the core service integration code

Server Deployment

  1. Access the server via FTP using "north-commerce" credentials

  2. Navigate to /var/convesio/wordpress/addons

  3. Create a new folder with naming convention: north-commerce-{your-plugin-name}

  4. Copy the following files to the folder:

    • info.json (from plugin folder)

    • screenshot-1.jpg (plugin screenshot)

    • north-commerce-slug.zip (plugin archive excluding .git, .gitignore, etc.)

Integration Setup

Create Integration Placeholder

  1. Navigate to north-commerce/admin/core/integration/placeholders/

  2. Create a new placeholder class file following existing patterns

    • Set OPTIONAL_KEY = '{slug}_service'

    • Match existing placeholder implementations

Update Integration Class

  1. Open north-commerce/admin/class-north-commerce-integration.php

  2. Add new integration code block in define_integration_placeholders():

phpCopyif ( empty( $this->integration_services['{slug}_service'] ) ) {
    $this->integration_placeholders[ North_Commerce_{Name}_Placeholder::OPTIONAL_KEY ] = [
        'object' => new North_Commerce_{Name}_Placeholder(),
    ];
}
  1. Deploy updated "north-commerce" plugin to Github

Plugin Updates

Version Update Process

  1. Update version number in main plugin file header:

    Version: X.Y.Z // Increment by 0.0.1
  2. Update info.json:

    • Update version field

    • Update last_updated timestamp (format: "YYYY-MM-DD HH:MM:SS")

    • Add changelog entry

Deployment Process

  1. Push updated plugin to Github

  2. Create plugin archive (excluding .git, .gitignore, etc.)

  3. Upload via FTP:

    • Archive to /var/convesio/wordpress/addons/your-plugin/

    • Updated info.json to same directory

Update Hooks

The plugin update process utilizes three hooks in the main plugin file. Reference implementation available at: north-commerce-shipstation/north-commerce-shipstation.php

Best Practices

  • Always prefix plugin folders with north-commerce-

  • Maintain clean archives (exclude development files)

  • Follow version numbering convention (increment by 0.0.1)

  • Keep changelog entries descriptive and dated

Last updated