• Hi all,

    how can I add more placeholders in my email templates? I would like to use additonal fileds from the checkout page which I added to order process like for e.g. billing_wooccm15

    Thanks,
    Marco

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hey,
    You would have to filter those in, see this post for an example of the code: https://www.ads-software.com/support/topic/available-placeholders-are-very-limited/#post-11813489

    Ben

    Thread Starter pommes84

    (@pommes84)

    Hi,

    I tried it but it didnd’t worked. I pasted the following via snippet in:
    add_filter( ‘kadence_woomail_order_body_text’, ‘custom_function_for_billing_wooccm12’, 10, 2 );
    function custom_function_for_billing_wooccm12( $text, $order ) {
    if ( is_a( $order, ‘WC_Order’ ) ) {
    $text = str_replace( ‘{billing_wooccm12}’, $order->get_billing_wooccm12(), $text );
    }
    return $text;
    }

    If I use the one above error is stated if I try to design templates.

    And tried also this one:
    add_action( ‘wp_enqueue_scripts’, ‘enqueue_parent_styles’ );

    function enqueue_parent_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri().’/style.css’ );
    }
    ?>

    add_filter( ‘kadence_woomail_order_body_text’, ‘custom_function_for_billing_wooccm12’, 10, 2 );
    function custom_function_for_billing_wooccm12( $text, $order ) {
    if ( is_a( $order, ‘WC_Order’ ) ) {
    $text = str_replace( ‘{billing_wooccm12}’, $order->get_billing_wooccm12(), $text );
    }
    return $text;
    }

    No error, but placeholder is not shown in the email template setup.

    Could you help?

    Hey,
    I not aware of this being a thing:

    $order->get_billing_wooccm12() Are you adding that method?

    Ben

    Thread Starter pommes84

    (@pommes84)

    Hi Ben,

    this is another plugin with whom you can extend the woocommerce checkout and build up your own needed fields. I need to show up these fields in the emails. Could you help me out? There are more of them numbered from billing_wooccm10 – billing_wooccm17.

    Thanks,
    Marco

    Hey, I suggest you contact that plugin developer and ask how you access those fields from the order object, you will likely need to pull from the meta but it’s best to talk wit them about it because I don’t know their setup.

    Ben

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adding/Using more placeholders from checkout page’ is closed to new replies.