products held stock notes variable rename
This commit is contained in:
parent
66dcd19f0d
commit
3b9be84659
|
@ -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 ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue