plugin updates

This commit is contained in:
Tony Volpe
2024-07-16 13:57:46 +00:00
parent 41f50eacc4
commit 8f93917880
1529 changed files with 259452 additions and 25451 deletions

View File

@@ -296,6 +296,7 @@ function wc_increase_stock_levels( $order_id ) {
$item_name = $product->get_formatted_name();
$new_stock = wc_update_product_stock( $product, $item_stock_reduced, 'increase' );
$old_stock = $new_stock - $item_stock_reduced;
if ( is_wp_error( $new_stock ) ) {
/* translators: %s item name. */
@@ -306,7 +307,18 @@ function wc_increase_stock_levels( $order_id ) {
$item->delete_meta_data( '_reduced_stock' );
$item->save();
$changes[] = $item_name . ' ' . ( $new_stock - $item_stock_reduced ) . '→' . $new_stock;
$changes[] = $item_name . ' ' . $old_stock . '→' . $new_stock;
/**
* Fires when stock restored to a specific line item
*
* @since 9.1.0
* @param WC_Order_Item_Product $item Order item data.
* @param int $new_stock New stock.
* @param int $old_stock Old stock.
* @param WC_Order $order Order data.
*/
do_action( 'woocommerce_restore_order_item_stock', $item, $new_stock, $old_stock, $order );
}
if ( $changes ) {