• Resolved Cezar Ayran

    (@ayrancd)


    I’m trying to hide the Delivery address if the Delivery option is takeout but it is not bringing anything…

    <?php /* translators: %s: Customer billing full name */ ?>
    <p><?php printf( esc_html__( 'You’ve received the following order from %s:', 'woocommerce' ), $order->get_formatted_billing_full_name() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
    <?php
    
    /*
     * @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 );
    
    /*
     * @hooked WC_Emails::order_meta() Shows order meta data.
     */
    do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
    
    /*
     * @hooked WC_Emails::customer_details() Shows customer details
     * @hooked WC_Emails::email_address() Shows email address
     */
    
    echo $order->get_formatted_shipping_address();
    //do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
    
    /**
     * Show user-defined additional content - this is set in each email's settings.
     */
    if ( $additional_content ) {
    	echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
    }
    
    /*
     * @hooked WC_Emails::email_footer() Output the email footer
     */
    do_action( 'woocommerce_email_footer', $email );

    That’s the line I’m trying to customize:

    echo $order->get_formatted_shipping_address();

    That’s the line I removed:

    do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );

    • This topic was modified 4 years, 9 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WOOCOMMERCE – Change order email’ is closed to new replies.