• Plugins
  • Support
  • Blog
  • About
  • FAQ
Menu
  • Plugins
  • Support
  • Blog
  • About
  • FAQ
$0.00 0 Cart

Hooks that Product Sync Monitors

Plugin: WooCommerce Product Sync Pro

WooCommerce Product Sync Pro uses the following action to monitor product changes:

woocommerce_after_product_object_save

This action has to be triggered in order for Product Sync Pro to detect product changes and synchronize them. The hook is automatically run by WooCommerce itself and most other 3rd party plugins. However, if you have developed a custom solution that updates products, make sure to trigger the action appropriately.

Code that won’t work:

function update_product_stock( $product, $stock_quantity ) {
  update_post_meta( $product->get_id(), '_stock', $stock_quantity );
}

This code won’t work because it doesn’t trigger the action after it has updated the product.

Code that works:

function update_product_stock( $product, $stock_quantity ) {
  update_post_meta( $product->get_id(), '_stock', $stock_quantity );
  do_action( 'woocommerce_after_product_object_save', $product, false );
}

This will work because it triggers woocommerce_after_product_object_save.

« Back to docs
« Back to plugin
30 DAY MONEY BACK GUARANTEE
+6000 HAPPY CUSTOMERS
SUPPORT FROM THE DEVELOPER

WP Trio / BitBot Oy
Flätbackantie 1, 04150 Sipoo
FINLAND
VAT ID: FI28269925

WP Trio

  • Support
  • Blog
  • About
  • FAQ
  • My account
  • Support
  • Blog
  • About
  • FAQ
  • My account

Plugins

  • Plugins
  • Docs
  • Plugins
  • Docs