Language Switcher
Account Menu

Sync Once, Sell Everywhere

Multi-Platform Stock Sync: The Ultimate Inventory Solution for E-commerce Entrepreneurs

MPSS Core Plugin

Stock Synchronization

The stock synchronization process is at the heart of the MPSS plugin, ensuring that inventory levels are consistently updated across all connected platforms. This section explains how MPSS manages the synchronization process.

Synchronization Process Overview

  1. Cron Job Trigger: The synchronization process is initiated by a WordPress cron job at scheduled intervals.

  2. Sub-plugin Notification: MPSS notifies all registered sub-plugins to report their stock changes.

  3. Stock Change Collection: Each sub-plugin reports its stock changes back to MPSS.

  4. Aggregation and Processing: MPSS aggregates and processes the reported changes.

  5. Update Distribution: MPSS distributes the final stock updates to all platforms.

Detailed Process

1. Cron Job Execution

  • At the scheduled time, WordPress runs the MPSS cron job.
  • This triggers the main synchronization function in the MPSS core.

2. Sub-plugin Notification

  • MPSS triggers an action called mpss_calculate_%s_stock_change where %s is the platform slug.

3. Stock Change Collection

  • Sub plugins should subscribe to that filter and return their changes.
  • The stock change calculation method may vary between plugins, depending on the platform's specific requirements and data structures.
  • The reported changes should be in a standardized format:

4. Aggregation and Processing

  • MPSS collects all reported changes from sub-plugins.
  • Taking the stock amount in WooCommerce as a base value, we deduct all changes coming from external platforms.
  • A final list of stock updates is prepared.

5. Update Distribution

  • MPSS sends the final stock updates back to all platforms. MPSS fires the action mpss_update_%s_stock and passes the changes to it. Sub plugins should subscribe to this action and update accordingly.

However, the $calculated_changes structure is a bit different. Here is a sample:

Previous
Platform Registration