• Resolved pelicanpaul

    (@pelicanpaul)


    Hi,

    Since a plugin update the email templates stopped being customized. File names changed. Not sure what else.

    In the latest version simply want to add some order info. This throws an error.

    <?php
    echo '<p>';
    echo 'Email: ' . esc_html( $order->get_billing_enail() )  . '<br />';
    echo 'Phone: ' . esc_html( $order->get_billing_phone() )  . '<br />';
    echo 'Country: ' . esc_html( $order->get_billing_country() )  .'<br />';
    echo 'State: ' . esc_html( $order->get_billing_state())  . '<br />';
    echo 'Company: ' . esc_html( $order->get_billing_company() )  . '<br />';
    echo 'Notes: ' . esc_html( $order->get_billing_note() )  . '<br />';
    echo '</p>';
    ?>

    $order in my phpstorm says it is not an object but is used in the email. I think this is a global?

    thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter pelicanpaul

    (@pelicanpaul)

    Figured it out…

    <?php
    
    $order_data = $order->get_data(); // The Order data
    
    $order_billing_company = $order_data['billing']['company'];
    $order_billing_state = $order_data['billing']['state'];
    $order_billing_country = $order_data['billing']['country'];
    $order_billing_email = $order_data['billing']['email'];
    $order_billing_phone = $order_data['billing']['phone'];
    $order_customer_note = $order_data['customer_note'];
    
    echo '<p style="margin: 0 0 25px; line-height: 1.65;">';
    echo '<strong>Email:</strong> ' . $order_billing_email . '<br />';
    echo '<strong>Phone:</strong> ' . $order_billing_phone . '<br />';
    echo '<strong>Country:</strong> ' . $order_billing_country . '<br />';
    echo '<strong>State:</strong> ' . $order_billing_state . '<br />';
    echo '<strong>Company:</strong>  ' . $order_billing_company . '<br />';
    echo '<strong>Notes:</strong>  ' . $order_customer_note . '<br />';
    echo '</p>';
    
    ?>
    Thread Starter pelicanpaul

    (@pelicanpaul)

    The land of emails…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Email Template Customizations’ is closed to new replies.