Merge pull request #15961 from electrokit/order_again_merge_option

Feature: Add option for merging when using 'Order Again'
This commit is contained in:
Mike Jolley 2017-07-11 11:23:33 +01:00 committed by GitHub
commit ba2063efa4
1 changed files with 3 additions and 2 deletions

View File

@ -569,8 +569,9 @@ class WC_Form_Handler {
return;
}
// Clear current cart
WC()->cart->empty_cart();
if ( apply_filters( 'woocommerce_empty_cart_when_order_again', true ) ) {
WC()->cart->empty_cart();
}
// Load the previous order - Stop if the order does not exist
$order = wc_get_order( absint( $_GET['order_again'] ) );