• Resolved cappeddog

    (@cappeddog)


    Hello,

    I’m currently using the Kadence WooCommerce Email Designer and am having trouble customizing the email templates to include dynamic data. Specifically, I’m trying to insert the order total into a custom email template.

    I’ve tried using {order_total} as a placeholder, but it doesn’t seem to work. I noticed that the default templates display the order total correctly, so I’m sure I’m just missing the correct placeholder or method to use.

    Could anyone provide guidance on the correct placeholder or method to use for displaying the order total in custom email templates with Kadence? Any help or pointers to relevant documentation would be greatly appreciated!

    Thank you!

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

    (@ghernkadence)

    Hello @cappeddog

    Generally, only the listed placeholders are available in the email designer. However, you can add custom placeholders using a script. You can add PHP code to your site using a plugin like Code Snippets or your functions.php file (in a child theme). For example, the following snippet could help. The code lets you use {order_total} in the body text and will show the order total. Please let us know if this helps you or if you have additional questions.

    add_filter( 'kadence_woomail_order_body_text', function($body, $order) { 
        $body_text = str_replace( '{order_total}', $order->get_total(), $body ); 
        return $body_text; 
     }, 15, 2);
    Thread Starter cappeddog

    (@cappeddog)

    Thank you very much, it worked perfectly with Code Snippets!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Placeholder for order total’ is closed to new replies.