Only set transient when needed

This commit is contained in:
Mike Jolley 2013-01-12 13:03:00 +00:00
parent 8798ade9ca
commit 4a650b21dd
1 changed files with 2 additions and 2 deletions

View File

@ -103,7 +103,7 @@ class WC_Session_Transients extends WC_Session {
* @return void
*/
public function save_data() {
// Set cart data
set_transient( 'wc_session_' . $this->_customer_id, $this->_data, $this->_cookie_expiration );
if ( ! empty( $this->_data ) )
set_transient( 'wc_session_' . $this->_customer_id, $this->_data, $this->_cookie_expiration );
}
}