if shoppingcart APIv2 request fails, unset session variable
This commit is contained in:
		@ -111,6 +111,9 @@ function fulcrm_shoppingcart_get_session_cart( $create = true ) {
 | 
				
			|||||||
            if ( ( $api_data[ 'data' ][ 'completed' ] === null ) && ( $api_data[ 'data' ][ 'abandoned' ] === null ) ) {
 | 
					            if ( ( $api_data[ 'data' ][ 'completed' ] === null ) && ( $api_data[ 'data' ][ 'abandoned' ] === null ) ) {
 | 
				
			||||||
                return $api_data[ 'data' ];
 | 
					                return $api_data[ 'data' ];
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            if ( $api_data[ 'code' ] === 404 )
 | 
				
			||||||
 | 
					                unset( $_SESSION[ 'fulcrm_shoppingcart_id' ] );
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user