• Resolved bitting

    (@bitting)


    Hi

    I have a couple of custom placeholders, made out of custom product fields. I want to be able to add these fields to the body text. I can add the placeholders to the “additional content” section but not the “body text” section.

    I stumble acros the post below but since I’m that into php I cannot see how to make it work. And I think the post below focus on making a placeholder and then add it. My issue is that I already have placeholder, I just want it to work in the “body text” section.

    https://wordpress.org/support/topic/example-of-how-to-add-custom-placeholders/

    I gratefully accepts any help.

    BR

    Bitting

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Gilbert Hernandez

    (@ghernkadence)

    Hello @bitting

    You said you have a couple of custom placeholders. However, you said the placeholders work in the “Additional Content” but not the “Body Text.”

    How did you create the placeholders? Generally, the email designer provides the following placeholders.

    AVAILABLE PLACEHOLDERS
    {site_title}, {order_date}, {order_number}, {customer_first_name}, {customer_last_name}, {customer_full_name}, {customer_username}, {customer_email}

    Beyond the standard placeholders, you have to add custom placeholders using code. This is the example code I often provide:

    add_filter( 'kadence_woomail_order_body_text', function($body, $order) { 
       $body_text = str_replace( '{participant}', 'custom replacement.', $body ); 
       return $body_text; 
    }, 15, 2);

    The code will replace the {participant} placeholder with the text “custom replacement.” However, you can programmatically decide what to use.

    Did you use similar code to add the placeholder you said you currently have?

    Plugin Support michael-levelup

    (@michaeltarongoy)

    Hi there,

    This topic has been inactive for more than 2 months. I’ll proceed to marking this as resolved.

    If you have further questions or need additional assistance, feel free to start a new topic or refer to our Kadence Help Center here: https://www.kadencewp.com/help-center

    Thank you for your understanding!
     
    Kind Regards,
    Michael Taro

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.