Added conditional to unset session itself

Closes #7182
This commit is contained in:
Mike Jolley 2015-01-26 11:42:21 +00:00
parent 2a95402d22
commit 0b252d03f4
1 changed files with 3 additions and 1 deletions

View File

@ -1037,7 +1037,9 @@ class WC_Cart {
private function reset( $unset_session = false ) {
foreach ( $this->cart_session_data as $key => $default ) {
$this->$key = $default;
unset( WC()->session->$key );
if ( $unset_session ) {
unset( WC()->session->$key );
}
}
do_action( 'woocommerce_cart_reset', $this, $unset_session );
}