products held stock notes variable rename

This commit is contained in:
Abdalsalaam Halawa 2023-04-20 00:55:04 +02:00
parent 66dcd19f0d
commit 3b9be84659
1 changed files with 3 additions and 3 deletions

View File

@ -72,7 +72,7 @@ final class ReserveStock {
return; return;
} }
$order_notes = array(); $held_stock_notes = array();
try { try {
$items = array_filter( $items = array_filter(
@ -115,7 +115,7 @@ final class ReserveStock {
$item_quantity = apply_filters( 'woocommerce_order_item_quantity', $item->get_quantity(), $order, $item ); $item_quantity = apply_filters( 'woocommerce_order_item_quantity', $item->get_quantity(), $order, $item );
$rows[ $managed_by_id ] = isset( $rows[ $managed_by_id ] ) ? $rows[ $managed_by_id ] + $item_quantity : $item_quantity; $rows[ $managed_by_id ] = isset( $rows[ $managed_by_id ] ) ? $rows[ $managed_by_id ] + $item_quantity : $item_quantity;
$order_notes[] = $product->get_formatted_name() . ' : ' . $rows[ $managed_by_id ]; $held_stock_notes[] = $product->get_formatted_name() . ' : ' . $rows[ $managed_by_id ];
} }
if ( ! empty( $rows ) ) { if ( ! empty( $rows ) ) {
@ -129,7 +129,7 @@ final class ReserveStock {
} }
// Add order note after successfully holding the stock. // Add order note after successfully holding the stock.
if ( ! empty( $rows ) ) { if ( ! empty( $held_stock_notes ) ) {
$order->add_order_note( sprintf( __( 'Stock is held for %s minutes for payment:', 'woocommerce' ), $minutes ) . ' ' . implode( ', ', $order_notes ) ); $order->add_order_note( sprintf( __( 'Stock is held for %s minutes for payment:', 'woocommerce' ), $minutes ) . ' ' . implode( ', ', $order_notes ) );
} }
} }