• I’ve tried to edit the new-request-sent-customer.php to include the customers billing details & specific order meta from the product fields but I can’t get the code right. Do you code to include the customers billing information and order meta in email received by the customer like it’s shown in the woocommerce customer invoice email template?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author pinal.shah

    (@pinalshah)

    Hi @pervasiveconcierge,

    Please share your code and I’ll try to help you out.

    Regards,
    Pinal

    Thread Starter pervasiveconcierge

    (@pervasiveconcierge)

    Hello sorry about the delayed message. I had deleted the code that I had tried. I’ve tried several variations still cannot figure it out. After I updated the coding in my child theme email template, it still defaulted to the original plugin email version.

    I would love to include the specific product/meta information in the emails sent to both the customer and admin like in the “Send Quote” email template.

    Here’s one of the codes I’ve tried:
    <?php
    /**
    * Request New Quote email
    */
    ?>

    <?php do_action( ‘woocommerce_email_header’, $email_heading ); ?>

    <?php
    $order_obj = new WC_order( $order->order_id );
    $display_price = false;
    if ( $order_obj ) :
    $billing_first_name = ( version_compare( WOOCOMMERCE_VERSION, “3.0.0” ) < 0 ) ? $order_obj->billing_first_name : $order_obj->get_billing_first_name(); ?>
    <p><?php printf( __( ‘Hello %s’, ‘quote-wc’ ), $billing_first_name ); ?></p>
    <?php endif; ?>

    <p><?php printf( __( ‘You have made a request for a quote on %s. The details of the same are shown below.’, ‘quote-wc’ ), $order->blogname ); ?></p>

    <?php if ( $order_obj ) : ?>

    <?php endif; ?>

    <?php
    }

    /**
    * Hook for the woocommerce_email_order_details.
    *
    * @hooked WC_Emails::order_details() Shows the order details table.
    * @hooked WC_Structured_Data::generate_order_data() Generates structured data.
    * @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
    * @since 2.5.0
    */
    do_action( ‘woocommerce_email_order_details’, $order, $sent_to_admin, $plain_text, $email );

    /**
    * Hook for the woocommerce_email_order_meta.
    *
    * @hooked WC_Emails::order_meta() Shows order meta data.
    */
    do_action( ‘woocommerce_email_order_meta’, $order, $sent_to_admin, $plain_text, $email );

    /**
    * Hook for woocommerce_email_customer_details.
    *
    * @hooked WC_Emails::customer_details() Shows customer details
    * @hooked WC_Emails::email_address() Shows email address
    */
    do_action( ‘woocommerce_email_customer_details’, $order, $sent_to_admin, $plain_text, $email );

    /**
    * Show user-defined additonal content – this is set in each email’s settings.
    */
    if ( $additional_content ) {
    echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
    }

    /**
    * Executes the email footer.
    *
    * @hooked WC_Emails::email_footer() Output the email footer
    */
    do_action( ‘woocommerce_email_footer’, $email );

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show Customer Details & Order Meta’ is closed to new replies.