• Hi All

    I have a brainer… basically I have a Woocommerce site and a custom made catalog system where I keep all stock levels of all products, call it MasterSite.
    My MasterSite is selling products, so stock levels in it changes.
    I want to keep Woocommerce site level synced with MasterSite levels.

    WP Woocommerce site and MasterSite is in the same MYsql database, so I can put a script in MasterSite to be executed as a cron job periodically and make changes in woo and mastersite mysql entries.

    My original plan was to set
    – every 5 minutes check if there is a stock quantity change in MasterSite since last check, CURRENT_STOCK == LASTCHECKED_STOCK ?
    – – If there is no change in MasterSite but there is a change in Woo Woo_LastChecked_Stock!=Woo_Current_Stock, then update MasterSite stock with correct stock from Woo.
    – – If there is a change in Master Site (CURRENT_STOCK != LASTCHECKED_STOCK), then
    – – – is change in stock at Woo ?
    – – – – YES – do some decision making……
    – – – – NO – then update Woo with CURRENT_STOCK

    Also check if there is change in Woo stocks, and then adjust Master Site stock quantities.

    The problem is that this is not very efficient way, there is loads of different scenarios to be covered, and maybe someone had similar issue or want to share how they would approach this problem ?

    Maybe there is a plugin that could do this for me?

    • This topic was modified 4 years, 11 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Synchronize WooCommerce product stock with external source’ is closed to new replies.