NOD CONNECTOR

WordPress plugin for woocommerce –

Contents hide

Revisions

  1. 2020-04-27
  2. 2020-09-09
  3. 2020-10-23
  4. 2020-11-06
  5. 2020-12-29
  6. 2021-04-26
  7. 2021.07.02
  8. 2022.02.23
  9. 2022.03.11
  10. 2022.06.15
  11. 2025.04.07

Use case

This wordpress plugin allows NOD partners to sync their wordpress based ecommerce websites with NOD API in terms of products and orders. The main features of the plugin are:

  • Products import 
    • Available data: Title, description (html), category, attributes (woocommerce attributes), images, price and stock.
    • Custom category mapping
    • Multiple levels of specifying price commision (% from NOD price):
      • Global commision
      • At category level
      • At category-brand level
      • At product level
  • Products Sync
    • Updating title and description from  NOD API
    • Updating price and stocks from NOD API (both can be disabled)
    • Updating attributes
      • Only first set of attributes
    • Updating images
      • Only first image set
  • Order sync
    • Sends orders to NOD API and delivers with NOD Dropshipping. 
    • Sending supports both manual mode and / or auto mode.
    • Sync order status and AWB from NOD 

General settings

API credentials

In order for the NOD-CONNECTOR plugin to work, NOD API credentials are required:

The API User and API Key can be found in your b2b.nod.ro account.

Info: After saving the credentials, all the existing crons will start their execution but as no mappings are made at this point, no products data will be imported.

Smartbill settings: Settings that you can customize from here:  Setari Smartbill

Shop settings


All the options regarding products import and orders sync will be handled in this tab:

1. Default product status: how a product will be imported: private or public.

2. Product action when deleted from NOD API: when a product doesn’t exist anymore in the NOD API, what action should be made: 

  • Delete: product will be moved to trash
  • Disable sync: all the sync options will be disabled: price, stock and product details.
  • Unpublish: the product status will be set to private
  • Out of stock: stock will be set to 0

3. Products import/sync daily at: once a day a cron will be executed that will:

  • Import new products 
  • Update data on existing products (if NOD product version changes)

And this option will set the hour of this execution.
Warning: intensive cron, may take hours. We recommend it be executed at 01:00 (AM).

4. Prices update daily at: once a day a cron will be executed that will:

  • Update the regular price according to the NOD API final price plus the % commission.
  • Update the stocks of the products

And this option will set the hour of this execution.
Warning: intensive cron, may take hours. We recommend it be executed at 04:00 (AM).

5. Round final prices: useful in calculating the regular price. If set to yes, it increases the % commission so that on the frontend, with (hardcoded) VAT tax the regular price will be displayed as .99 .

For example considering this setting is set to NO for a regular price of 4.50 the frontend price would be: 5.35. (4.50 * 1.19).
When setting this to YES, at the next price calculation, it would have set the regular price to 5.03 so that the final price will be 5.99.

In other words, it slightly increases the % commission in order to get that .99.

6. General commercial additions: This value will be used as a default value for the commission per category, at the import data tab:



7. Import products strategy :

Option to skip importing products without images from NOD B2B.

This option is available in the NOD connector → Settings → SHOP → Product Import Strategy.

Functionality:

  • Import all products: will include in the import process any product from the selected categories, regardless of whether it has images in NOD B2B or not.
  • Import only products with available images: will filter out, during the import process, based on the selected categories, the products that do not have images in NOD B2B and will not import them.
  • Later on, if a product from a selected category (via the import wizard), which was initially skipped due to missing images, receives images in NOD B2B, it will be automatically imported during the next scheduled product import cron run.
  • The option to import only products with available images is not retroactive, meaning that enabling it after products have already been imported will not remove previously imported products.


Dropshipping Settings:

1. Order sending mode: how the orders received in woocommerce will be sent to NOD API.

  • Manually: the admin will have to manually send the order to NOD by clicking on the “Send order to NOD” button:
  • Automatically: the orders will be sent to NOD automatically every 5 minutes (depending on the payment methods – dropshipping settings mapping). 

Reserved products

From the version 1.5.8 Nod connector we offer the possibility for the administrators of the site to import and display reserved products from NOD.

You can setup this in Nod connector->Settings->Shop:

The products that have the reserved product label in b2b NOD and have 0 stock, will have the text that you set in the Reserved stock text field, displayed in the front-end, where you can add, for example, the phone number to be contacted.

For the products that are reserved in NOD and also have stock greater than 0, the label will not be displayed.

Alerts section

In this section you can set an email addres where the alerts regarding the orders that cannot be sent to NOD from various reasons will be sent, and also how many times a day you want to receive them (once at 10 minutes, 15 minutes, once an hour, once a day/twice a day).

This alert system is developed to inform site administrators of the reasons why certain orders cannot be sent to NOD for the following reasons:

– lack of stock in NOD

– sale at a loss (due to non-updated prices)

– timeout errors from the NOD API when sending the command

Orders reporting email:


You can set this from Nod connector->Setari->Shop -> section Debugging And Logging

Completing the Orders reporting email with an email address will make a report with all the finalized orders in NOD from the past 2 weeks.

Category shipping mapping

In this tab there are all the transport taxes mapped on different woocommerce categories so that you can set different shipping classes on new or existing products according to their categories. See example below.

The categories can be added in order to map it to a new or an existing shipping class.

The shipping class can be reapplied or deleted on all the categories or just the selected ones.

Any product that will be imported after that the shipping class was mapped, will automatically receive that shipping class. 

If the shipping classes reapplied to categories, all the products from that category will have that shipping class. 

If you want to change more shipping classes you can press the button “Reapply for all”

Products

General info


NOD-Connectors’ main feature is to import NOD products into your woocommerce online shop and keep them in sync.

The products import process consists on three steps:

  1. Selecting what to import (category / brand mapping).
  2. Products creation (automatically via cron, once a day)
  3. Products sync (automatically via cron, once a day generic and once every 3 minutes for stocks)

1. Selecting what to import

Click on the import data (main menu entry in nod-connector item).

The first mandatory step in having the NOD products on your woocommerce online shop is to select which categories and brands you want to be imported from NOD.

This can be achieved in two ways:

Knowing the difference between the two import modes and the fact that the cloning mode is just an extension of the mapping one, we will focus just on the latter.

Assuming that you have selected the Manual Mapping here, click next:

In the next screen, click on Step1: get nod categories and then wait for the list to be created. 

You can select now what categories that will be available on the next step: selecting brands for each category.

You can also change the commission previously added on the settings page as global. This can be further changed per each brand as well.

Important: If you have already saved the categories before, on this page some checkboxes and commissions will be completed by default based on your previous choices.

Also, if you want to update your commissions at a later point, you can go back to the brand or category mapping, save the new commission, then trigger a new product import. This will update your prices.

Retroactive commission application

The product commission can be applied retroactively for all products:

To apply a retroactive commission, you need to add the new value in the “General business additions” field and click the “Aplica retroactiv” button. Product commission and prices will be updated after running the cron update_price_and_stock (* Cron runs twice a day) 

Note:Pressing the “Apply Retroactively” button will change the commission for all imported products and the new products will be imported with the current commission.

Now hit Step2: Save selected categories, wait for the “Saved with success!” message and then hit next.

Click on Step1: get NOD brands:


Now you can select from a list of available brands, for each of the categories previously saved.

You have to choose which brands will be imported from NOD for each of the NOD categories and the preferred commission.

Important: If you have already saved the brands before at this step, on this page some checkboxes and commissions will be completed by default based on your previous choices.

Important: After this step, you will have to create the mappings if you are on the Manual Mapping mode. If the mappings do not exist, no products will be imported. 

Now hit Step2: Save selected brands, wait for the “Saved with success!” message and then hit next.

If you were on the “clone” mode, then click “start import”


If you were on the “manual mapping” mode, then click on the “Go to the mapping page”. 

1.1.1 Nod Mapping Categories Page

On this page you can choose what NOD categories you want to map to your woocommerce categories

If you don’t have woo categories in your shop corresponding to particular nod categories, or you don’t have any woo category at all, you can use the Auto match button. 

Pushing the Auto match button will create woo categories based on the NOD category selected in the left input (it will create woo child categories and also parent categories for those children, also based on the NOD parent category) and map them to the corresponding NOD category from the left input.

After you are done mapping your NOD – woo categories hit the save button, to persist your preferences in the Database. This is important, otherwise the mapping won’t be saved !

Once the matches are saved, you can start the import process to get woo products based on your nod categories and brands.

To find a certain category you have to write the name of the category in the field below (see picture)

1.1.2 Nod Unmapped Categories

If you have a lot of (unmapped) nod categories (like in the image below) you will save a lot of time with the mapping process if you go to the Unmapped Categories page and clicking the Auto Match button on the bottom of the page.

This will create woocommerce categories for all of the unmapped NOD categories and map them accordingly to each of the corresponding NOD categories. 

Hit the save button to store the mapping preferences. After saving, you will be taken back to the main Mapping Categories page where you can start the import process from.

Products creation

NOD Products are created in woocommerce only if the SKU of the nod product does not already exist in the shop. In case it does exist, it will just update its properties if the nod version of that respective product changes.


Product fields mapping with NOD API: 

Product title

Is the “title” field from NOD API /products endpoint. 

Product description

Is the “long_description” field from NOD API /products endpoint. If that does not exist, then the “description” is used. 

Brand 

Is the “manufacturer_name” field from NOD API /products endpoint. This is created as a woocommerce attribute and will be displayed on the attributes tab.

Warranty

Is the “warranty” field from NOD API /products endpoint. This is created as an woocommerce attribute and will be displayed on the attributes tab.

Product attributes

Is the “properties” field from NOD API /products endpoint. These are created as woocommerce attributes and will be displayed on the attributes tab along with Brand and Warranty.

Important: If NOD changes the attributes, no updates are made to the product. With other words it imports only the first found set of attributes.

Main image

Is the first element in the “pictures” field from NOD API /products endpoint.

The rest of the elements in the “pictures” field from NOD API /products endpoint.

Important: If NOD changes the images, no updates are made to the product. With other words it imports only the first found set of images. Same as with attributes. 

Picture update strategy for NOD products

A) dropdown

with a new setting in the products tab / node connector:

  1. Default option: upload only the first set of pictures available on the NOD API.
  1. New option: always upload photos from the NOD API
  1. New option: do not load pictures from API NOD

B) a button next to this dropdown: “Apply retroactively for all NOD products”

When you press that button, the selected option applies to all NOD products.

Please note that the option “do not load pictures from API NOD” apply retroactively, won’t  delete photos already imported if they exist.

The option “apply retroactively” for any chosen strategy, they will change along the way with the change of version of the product / products in NOD API

C) dropdown with a new setting in the product page, general tab, after the check sync details: the dropdown above so we can have these options applied for each product individually.

Product version

Is the “version” field from NOD API /products/ID?delta=1 endpoint. Using this we can detect if changes are made to the product and trigger an woocommerce product update. 

Product SKU

Is the “code” field from NOD API /products endpoint. Using this we can detect if the product was already imported in woocommerce.

Product  NOD ID

Is the “id” field from NOD API /products endpoint. Using this we can call the API  /products/ID endpoint to get information for a specific product. 


Product regular price



Starting with the “ron_promo_price” field from NOD API /products endpoint the cron will add the commission that was previously set at the import step. This represents the price without TAX.

The commission can be changed per each product individually but the change will take effect only on the next price calculation: once per day.

If you want to change the commission for multiple existing products at once, it’s possible by editing the commission on the import wizard.

Important: We recommend to use the prices without TAX in admin so this field can work properly. All the prices from NOD are imported as regular prices. You can specify special prices for promotions and that won’t interfere with the regular price calculation.

If the Sync price with NOD checkbox is active, this will be updated each time the nod_update_prices_and_stock cron is executed. Usually once a day.

Product  stock

Is the “stock_value” field from NOD API /products endpoint.

If the Sync stock with NOD checkbox is active, this will be updated each time the nod_update_stocks cron is executed. Usually at 3minutes. 

Product status

At creation, the status defined in setting (1) on the Shop settings will be used.
After creation, it will change if the product:
A) was imported from NOD and
B) is not present in the NOD API anymore
According to the setting (2) from Shop settings.

Product tax class

If there are any mappings defined at “Category Shipping Mappings” it will be set accordingly.

You can also apply the tax classes on demand using this feature (reapply):

Product commision

The commision can be added on products manually:

* when saving a new commission on a product, if you don’t adjust the price manually in the same update, it will be changed only on the daily price update cron.


Mass update:
That commision can be changed later by saving the categories and brands with new commission values. (only changed values will be mass updated on products)

The commision on products will be updated shortly after saving the categories and the brands.


Note: When adding a category commission, the brands under that category will get by default the same amount. Editing the category commission will not edit the existing brand commission. You have to go through the category-brand page in order to successfully mass update commissions for those products.

Product EAN

If EAN is present in NOD, it will appear in the product page on the backend in the general tab.

Sync products

After the products are created in woocommerce, you can select how to further synchronize with NOD:

Product details

If the Sync details from NOD checkbox is active for a product, then once per hour the update-attributes cron checks if the NOD product version is different from the one in woocommerce and if so then it checks for changes and updates the following:

You can also change this via woocommerce CSV upload, by importing a column called Meta: product_nod_sync. Empty cell for unchecking it or yes for having the checkbox active. 

Product price

If the Sync price from NOD checkbox is active for a product, once per day, the nod-update-prices cron updates all the regular prices as per the rule specified here

You can also change this via woocommerce CSV upload, by importing a column called Meta: product_price_nod_sync. Empty cell for unchecking it or yes for having the checkbox active. 

Product stock

If the Sync stock from NOD checkbox is active for a product, once at 3 min, the nod-update-stocks cron updates the product stock as per the rule specified here

You can also change this via woocommerce CSV upload, by importing a column called Meta: product_stock_nod_sync. Empty cell for unchecking it or yes for having the checkbox active. The nod-update-prices cron will also update the stock.


Product Categories

Sometimes the product categories from B2B Nod Webshop change and email notification will be sent. 

Products that had their category changed will still receive price and stock updates if the respective checkboxes are ticked, but will no longer receive product data updates (title, description, attributes, etc).

To restore the product data updates functionality you need to access NOD Connector -> Import Data and add the changed categories into wordpress and remake the category mapping from NOD Connector -> Mapping Categories menu and start the import after.

The products will get updated with the changed categories and product data update functionality will be restored.

Product Tools

We have the possibility to set sync/unsync everything or a certain category. After choosing the desired option, click apply and save.

Updating categories and brands

From time to time NOD adds new brands in their catalog and creates new categories. You have to regularly walk through the import data process (manual mapping mode) to check what’s new from NOD and add it to your shop to stay up to date.


Sometimes NOD also moves the existing products to new categories and you have to make sure the new category is selected on the import data step and also a mapping exists for it.

Importing NOD special prices: 

Special prices listed in NOD are now imported in Woocommerce, if you have the “Importa preturi reduse” setting active (Nod connector->Settings->Shop): 

More details, here: Preturi promo

Orders 

General info

The plugin can send Dropshipping orders to NOD API by clicking on a button or automatically every 5 minutes. See specific setting for that above (7).

After sending an order to NOD API, it’s status is synced once per hour with NOD API. When the status changes to BILLED in NOD API, the woocommerce status is set to Completed.

The AWB info will be saved in woocommerce as well. 

!Important:  We do not recommend the backend modification of orders placed by customers both on the website and in the marketplace.

The actions you can perform are only: placement at NOD or cancellation. Any other action of editing products/quantities can lead to price destabilization.
At the same time, we recommend sending the orders on the same day they were placed in order to keep the price in Nod, which changes daily.

Order canceled

A canceled order that already has a NOD ID in the store will have the status “Canceled”.
!important:  Canceled orders in Woocommerce won’t cancel NOD orders.

In order to truly cancel the order you must contact the NOD team.

Stop orders with loss potential

We have implemented a method to block the sending to NOD of woocommerce orders in the case where the order may generate money loss.

If you have an order with some products that have changed their price in NOD after the price-import in woocommerce, the order will not be sent to NOD and a note will appear on the order:

In this case, you will need to manually add the dropshipping order in the NOD portal.

Requirements

The sending order to NOD feature has some requirements:

Once these requirements are met, an attempt to send the order on NOD API is made. If success, a NOD order id will be populated in the order page:

All the NOD API transactions for an order are stored on the order notes:

Prices that are sent on NOD API are identical with the ones the user saw on the frontend and the ones displayed in the woocommerce admin:

* woocommerce admin prices

* NOD Webshop order

Recommendations:

* failing to follow these recommendations could result in some unexpected behaviour regarding prices that are sent to NOD. 

Payment methods

When an order is placed in NOD API, the reseller payment method is the first one that is received on the /payment-options endpoint:

Example:  in postman:

In webshop, after placing an order with NOD-Connector:

Cash on delivery

Beside the payment method for the reseller, NOD-Connector decides if the DropShipping order should be sent with the cash_on_delivery option which makes the cash payment to be mandatory for the end user, upon delivery. 


If the woocommerce payment method is COD (cash on delivery – woocommerce default) then it sends the order with cash_on_delivery=1.

Example for an online payment order in woocommerce:


Then, in webshop, you won’t see the payment info for the end customer.

Example for a Cash On Delivery order in woocommerce:



Then in webshop, you will see the specific cash_on_delivery=1 information, Payment: cash:

Shipping methods

When an order is placed in NOD API, the reseller shipping method is the first one that is received on the /transport-options endpoint. 

Sync orders statuses


A cron that runs once per hour checks all the open orders on NOD API and syncs their status with NOD status as per the following mapping:

Webshop statusWoocommerce status
PROCESSINGwc-processing
DELIVERY_READYwc-processing
CREDIT_LIMITwc-processing
BALANCE_OUTSTANDINGwc-processing
DELIVEREDwc-completed
BILLEDwc-completed
NOT_ACCEPTEDwc-failed
DELETEDwc-cancelled
EXPIREDwc-cancelled

Coupons

Starting with nod-connector 1.2.3 we added the logic that handles coupons in Woocommerce orders and how they are being sent to NOD.

For Cash on delivery orders that contains coupons with free delivery we have two situations:

  1. When the order total is 0.
    1. In this case we send the full amount (your selling price + shipping) to NOD but we remove the “cash on delivery” option when sending it to NOD. So the courier won’t ask for COD payment upon delivery and the products are fully assured.
  2. When the order total is greater than zero.
    1. In this case we send the remaining difference to NOD by subtracting the voucher amount from each product proportionally. We keep the “cash on delivery” option but the customer will pay only the remaining amount: total – voucher amount.
      Important: the assured amount is equal to the remaining amount in this case.

For the rest of the payment methods we send the full amount to NOD ignoring coupons. This way the full amount will be assured by your courier.

For Cash on delivery orders that contain coupons which are not offering free delivery we will send to NOD the remaining amount (as per above) and the full delivery amount.

Please check some examples here.

If you want to create coupons for your users, check this guide along with our recommendations. 

Manual send to NOD

If you have problems with sending the order from  WooCommerce to  NOD, there is the possibility to send the order manually through the b2b.nod.ro interface and then connect it to the WooCommerce order by completing the meta.

You can check a more detailed process in this guide.

Automated processes

Automatically send orders to NOD

It is possible to automatically send orders to NOD, using the “send orders” cron, that runs every 5 minutes and tries to send all the orders that contain NOD products.

Attention! 

In order to automatically send orders to NOD, you need to set the payment method- automatically, by accessing: Nod connector->Settings->Shop.

Attention: Only orders with the “processing” status will be sent automatically to NOD, if the payment methods associated with those orders are set to “automatic” in the NOD connector → Settings → Shop.

Also, changes have been made to the previously mentioned settings in NOD connector → Settings → Shop, so that orders paid by check or bank transfer can no longer be set for automatic submission to NOD.

Orders with these payment methods can only be sent to NOD manually, by clicking the “Send order to NOD” button.

This was done to avoid cases where the order is sent to NOD although the payment has not yet been completed.

Automatically generate NIRs using Smartbill

You can now generate NIRs using Smartbill, using the nod_generate_nir cron. This cron will iterate over all your completed woocommerce orders that have been successfully sent to nod (have a nod id) and also have a nod awb, and will try to generate an NIR invoice type in smartbill.

Attention! In order to generate NIRs automatically, you have to use these settings here: Smartbill Settings-Nod connector

Automatically generate invoices using Smartbill

You can now generate invoices automatically, using Smartbill, with the cron nod_generate_invoice. This cron will iterate over all your completed woocommerce orders that have been successfully sent to nod (have a nod id) and also have a nod awb, and will try to generate an invoice in smartbill.

Attention! In order to generate invoices automatically, you have to use these settings here: Smartbill Settings-Nod connector

Feeds

General info

One of the properties of the Nod-connector is to generate feeds, at the moment we have the integration with the sites you see below. To access this feed it is necessary to follow the steps below for each feed and access the end of the attached link

Doraly.ro

In cron managers run the crons :nod_export_products_xml,

Then you can access the feed by following the end of link /wp-content/products.xml

Compari.ro

To generate the feed of compari.ro and price.ro it is necessary to go to Nod-connector / feeds settings and to change the setting on enablet.

By enabling it, the following crons will be scheduled :nod_update_feeds-compari_ro, nod_update_feeds-price_ro

After execution, you can access the feed by following the end of link: /wp-content/feeds/compari_ro.csv

Price.ro

You can see instructions above and then you can access the feed by following the end of link: /wp-content/feeds/price_ro.txt

Favi.ro

To generate the feed of favi.ro it is necessary to go to Nod-connector settings and select the searched category slug, after in cron managers run the cron nod_update_feeds-favi_ro.

Then you can access the feed by following the end of link: /wp-content/favi-products.xml

Shopmania.ro

To generate the feed of shopmania.ro it is necessary to go to Nod-connector / feeds settings and to change the setting on enabled.

By enabling it, the following cron will be scheduled :nod_update_feeds_shopmania_ro.

After execution, you can access the feed by following the end of link: /wp-content/feeds/shopmania.xml

Crons

nod_import_products

Cron that runs daily that imports products from NOD based on imported NOD categories that have been matched with woo categories and that have also imported and associated NOD brands to them.

You can set up the cron run time from the settings page of this plugin.

If products already exist, it will just update their properties (title, desc, attributes, pictures etc.) if the nod version of the product changes.

nod_update_prices_and_stock 

Cron that runs twice a day that updates the prices for products that have been imported from nod and are in sync for prices. It also refreshes the stocks for each product in sync for stocks.


nod_sync_prices_and_stocks


Cron that runs hourly and updates the prices and the stocks directly in the database for products that have been imported from nod and are in sync for the prices. 

nod_update_stocks

Cron that runs every 3 minutes and updates the stocks of the products that have been 

imported from NOD and are in sync.

nod_update_attributes

Cron that runs hourly to update product data (title, description, images, attributes) for products imported from nod and in syncUpdates product data:

nod_update_product_prices_percentages

This cron runs every minute and goes over changes in the brand percentages and then updates the price for each product from that brand / category with the new prices. 

nod_delete_product_duplicates

Sometimes the import products process might create duplicate products in woocommerce for the same nod product. This crons purpose is to find those duplicates that have no orders attached to them and delete them. 

nod_export_products_xml

Cron that runs hourly and generates a products xml feed for doraly online marketplace. It can be found in wp-content/products.xml

nod_favi_exports_products_xml

Cron that runs hourly and generates a products xml feed for favi online marketplace. It can be found in wp-content/favi-products.xml


nod_update_feeds-price.ro

nod_update_feeds-compari_ro

nod_send_orders

Runs every 5 minutes to send all orders that contain only nod products to nod. Logs will be added to orders so that you can check their statuses. 

nod_update_orders

Cron that runs hourly and imports the status of the OPEN woocommerce orders from NOD webshop API if were placed in NOD.

Misc crons

nod_cron_checker

Runs every 5 minutes and checks the status of the nod_import_products and nod_update_prices_and_stock crons. Because these processes are very intensive and take a long time to complete, sometimes they get stuck without finishing. The purpose of the cron checker is to monitor their status and unlock the crons if they are blocked. 

nod_delete_logs

Runs once a day to delete log files older than 15 days or whatever setting you have added in the nod general setting page for logs retention. 

Diagrams

Schematics of table diagrams and cron use cases also in whimsical here

Logs

The plugin has a logging system integrated in all crons and within the rest of the system. To access the logs you first have to enable logging.

Put the debug level option to a different value than Off.

After that, you will begin to see logs appear in the logs tab of the plugin.

Select a file from the list on the left side to inspect logs.

Change history:

We have implemented a log that records the changes made recently in the settings of the Nod connector here: 

The logs can be found in Nod connector->Logs->settings->change_history: 

Fullfeed products:

The last price/stock or other product informations are kept for 14 days in Nod connector->Logs->backups->fullfeed:

You can view the fullfeed data in the logs, or you can save it as a json file.