Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter grantdailey

    (@grantdailey)

    For anyone having issues with this, I was able to modify the “conditional-woo-checkout-field.php” file to correct the problem. Navigate to the section of the code that is commented to “Add Conditional Field to Email” and delete or comment out whatever is there. Paste the following:

    // Add Conditional Field to Email
    add_action( 'woocommerce_email_after_order_table', 'add_payment_method_to_admin_new_order', 15, 2 );
    
    function add_payment_method_to_admin_new_order($order){
    echo '<br /><strong>';
        if (get_post_meta( $order->id, get_option('oizuled_conditional_fields_title'), true )) {
    		echo get_option('oizuled_conditional_fields_title') . ':</strong><br />' . get_post_meta( $order->id, get_option('oizuled_conditional_fields_title'), true );
    	}
    }

    That does it. I know that this is not the best way to fix things, what with updates and such, but it will do the trick.

    Plugin Author Scott DeLuzio

    (@scottdeluzio)

    Thanks for taking a look at this. I’m updating the plugin now with the fix you provided. I’m also including the conditional check to see if the “add to order email” box is checked in the settings. As your code is now it will add the info to the order email regardless of whether or not that box is checked.

    Thread Starter grantdailey

    (@grantdailey)

    Thanks for the update Scott.

    While you’re looking into it, I’ve had one more error I’ve been unable to figure out. I have my field set as “Required.” However, when I have a product in my cart that is not the product ID for the conditional field, it prints the conditional error message that the field is required, even though it is not displayed in the checkout fields. Any thoughts?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Conditional Field Not in Emails’ is closed to new replies.