• Resolved bheadrick

    (@bheadrick)


    Today, I noticed that the custom fields don’t show up in emails when resending emails.

    I see that the public hooks don’t fire in the admin, which probably makes sense for most of them, but I think most people would expect emails to be consistent between the initial send and resend.

    Here’s my fix:
    class-thwcfd.php:60

    private function define_public_hooks() {
    		if(!is_admin() || (defined( 'DOING_AJAX' ) && DOING_AJAX)){
    			$plugin_checkout = new THWCFD_Checkout();
    			add_action('wp_enqueue_scripts', array($plugin_checkout, 'enqueue_styles_and_scripts'));
    			add_action('after_setup_theme', array($plugin_checkout, 'define_public_hooks'));
    		}elseif(is_admin()){
    			$plugin_checkout = new THWCFD_Checkout();
    			add_action('after_setup_theme', array($plugin_checkout, 'define_admin_hooks'));
    		}
    	}

    class-thwcfd-checkout.php:31

    	public function define_admin_hooks(){
    		add_filter('woocommerce_email_order_meta_fields', array($this, 'display_custom_fields_in_emails'), 10, 3);
        }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom fields don’t show up when resending emails’ is closed to new replies.