Hi. How can we help?

How to change pdf filename of Gift Cards

You can use the filter 'yith_ywgc_pdf_new_file_path' to change the pdf filename, put this code in your functions.php:

if (class_exists('YITH_WooCommerce_Gift_Cards_Premium')){
if(!function_exists('yith_ywgc_pdf_new_file_path_custom')) {
function yith_ywgc_pdf_new_file_path_custom( $new_file, $object_id ) {

$new_file = YITH_YWGC_SAVE_DIR . "custom_name-" . $object_id . "-" . uniqid() . ".pdf";

return $new_file;
add_filter( 'yith_ywgc_pdf_new_file_path', 'yith_ywgc_pdf_new_file_path_custom', 10, 2 );
On the code, you can replace the "custom_name-" string with the new string you want.
Was this article helpful?
4 out of 4 found this helpful

Back to Help Center >