Sync parent stock status with the status of all children and save.
public static sync_stock_status ( WC_Product | integer $product, boolean $save = true ) : WC_Product | ||
$product | WC_Product | integer | Product object or ID for which you wish to sync. |
$save | boolean | If true, the prouduct object will be saved to the DB before returning it. |
return | WC_Product | Synced product object. |