I would like to customize the function that handles the redirect to the virtual product purchase page.
This is the method:
/**
* Redirect to a file to start the download
* @param string $file_path
* @param string $filename
*/
public static function download_file_redirect( $file_path, $filename = '' ) {
header( 'Location: ' . $file_path );
exit;
}
How can I update this without modify the core class in this way?
public static function download_file_redirect( $file_path, $filename = '' ) {
header( 'Location: ' . $file_path . '&order=' . $_GET['order'] );
exit;
}
Updating the class works as I would like. But I will not change the woocommerce core. Is there a way to filter this method? So you do not have any time to modify the core with each update