Merge pull request #21947 from franticpsyx/issue-21845
Refine new order-again logic
This commit is contained in:
commit
ac80e6683e
|
@ -327,7 +327,7 @@ final class WC_Cart_Session {
|
|||
$cart_id = WC()->cart->generate_cart_id( $product_id, $variation_id, $variations, $cart_item_data );
|
||||
$product_data = wc_get_product( $variation_id ? $variation_id : $product_id );
|
||||
$cart[ $cart_id ] = apply_filters(
|
||||
'woocommerce_add_cart_item', array_merge(
|
||||
'woocommerce_add_order_again_cart_item', array_merge(
|
||||
$cart_item_data, array(
|
||||
'key' => $cart_id,
|
||||
'product_id' => $product_id,
|
||||
|
@ -341,7 +341,7 @@ final class WC_Cart_Session {
|
|||
);
|
||||
}
|
||||
|
||||
do_action( 'woocommerce_ordered_again', $order->get_id() );
|
||||
do_action( 'woocommerce_ordered_again', $order->get_id(), $order_items, $cart );
|
||||
|
||||
$num_items_in_cart = count( $cart );
|
||||
$num_items_in_original_order = count( $order_items );
|
||||
|
|
Loading…
Reference in New Issue