Skip to content

Commit

Permalink
Merge pull request #264 from woocommerce/fix/262
Browse files Browse the repository at this point in the history
Fix inventory sync for variable products when sync is enabled through quick or bulk edit.
  • Loading branch information
vikrampm1 authored Jan 17, 2025
2 parents c8d62f7 + 02e9be8 commit d29932b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions includes/Handlers/Products.php
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,11 @@ public function set_synced_with_square( $product ) {
if ( is_string( $square_synced ) ) {
$errors = $this->check_product_sync_errors( $product );
if ( 'no' === $square_synced || empty( $errors ) ) {
if ( 'yes' === $square_synced && $product->is_type( 'variable' ) && wc_square()->get_settings_handler()->is_inventory_sync_enabled() ) {
// if syncing inventory with Square, parent variable products don't manage stock
$product->set_manage_stock( false );
}

Product::set_synced_with_square( $product, $square_synced );
} elseif ( ! empty( $errors ) ) {
foreach ( $errors as $error ) {
Expand Down

0 comments on commit d29932b

Please sign in to comment.