Merge pull request #21947 from franticpsyx/issue-21845

Refine new order-again logic
This commit is contained in:
Claudiu Lodromanean 2018-11-20 10:53:40 -08:00 committed by GitHub
commit ac80e6683e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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 );