• I used this code, but it does not work:
    https://pastebin.com/KiCCSPF4

    Hello. I would like to add my terms and conditions and privacy policy to woocommerce processing orders.
    Is my file path format correct? I tried this code out but it does not work.

    add_filter( ‘woocommerce_email_attachments’, ‘webroom_attach_to_wc_emails’, 10, 3);
    function webroom_attach_to_wc_emails ( $attachments , $email_id, $order ) {
    // Avoiding errors and problems
    if ( ! is_a( $order, ‘WC_Order’ ) || ! isset( $email_id ) ) {
    return $attachments;
    }
    $file_path = get_template_directory() . ‘wp-content/uploads/2020/12/aszf.pdf’; // directory of the current theme
    $file_path_2 = get_template_directory() . ‘wp-content/uploads/2020/12/adatketkezeles.pdf’; // directory of the current theme
    // if you are using a child theme, use this line instead to get the directory
    // $file_path = get_stylesheet_directory() . ‘/file.pdf’;
    $attachments[] = $file_path;
    $attachments[] = $file_path_2;
    return $attachments;
    }

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hello,

    Please try to switch to the default theme like twentytwenty and check if it is working with that or not.
    or it specifically doesn’t work with OceanWP? I don’t think it is a theme issue.

Viewing 1 replies (of 1 total)
  • The topic ‘woccomerce order TOS PDF attacment’ is closed to new replies.