woocommerce_empty_cart_when_order_again

woocommerce_empty_cart_when_order_again

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.5.1

apply_filters('woocommerce_empty_cart_when_order_again') is found 1 times:

  • /includes/class-wc-cart-session.php line 447
    		if ( ! $order->get_id() || ! $order->has_status( apply_filters( 'woocommerce_valid_order_statuses_for_order_again', array( 'completed' ) ) ) || ! current_user_can( 'order_again', $order->get_id() ) ) {
    			return;
    		}
    
    		if ( apply_filters( 'woocommerce_empty_cart_when_order_again', true ) ) {
    			$cart = array();
    		}
    
    		$inital_cart_size = count( $cart );
    		$order_items      = $order->get_items();