Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1489327

    I am using Enfold 7.1.2 with PHP 8.4 with WooCommerce as a shop.

    When a customer order the “processing email” it leaves a blank space between address 1 and the city, ST ZIP, such as the following:

    Joe Bloe
    1 Street Address

    Los Angeles, CA 90029

    It should be:
    Joe Bloe
    1 Street Address
    Los Angeles, CA 90029

    How do I update the PHP code to remove the blank space on the email if there is no copy in Address 2 field?

    I see this in WooCommerce:

    To override and edit this email template copy woocommerce/templates/emails/customer-processing-order.php to your theme folder: enfold-child/woocommerce/emails/customer-processing-order.php.

    I could use some help how and waht to change from the following:

    <?php
    /**
    * Customer processing order email
    *
    * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-processing-order.php.
    *
    * HOWEVER, on occasion WooCommerce will need to update template files and you
    * (the theme developer) will need to copy the new files to your theme to
    * maintain compatibility. We try to do this as little as possible, but it does
    * happen. When this occurs the version of the template file will be bumped and
    * the readme will list any important changes.
    *
    * @see https://woocommerce.com/document/template-structure/
    * @package WooCommerce\Templates\Emails
    * @version 9.9.0
    */

    use Automattic\WooCommerce\Utilities\FeaturesUtil;

    if ( ! defined( ‘ABSPATH’ ) ) {
    exit;
    }

    $email_improvements_enabled = FeaturesUtil::feature_is_enabled( ’email_improvements’ );

    /*
    * @hooked WC_Emails::email_header() Output the email header
    */
    do_action( ‘woocommerce_email_header’, $email_heading, $email ); ?>

    <?php echo $email_improvements_enabled ? ‘<div class=”email-introduction”>’ : ”; ?>
    <p>
    <?php
    if ( ! empty( $order->get_billing_first_name() ) ) {
    /* translators: %s: Customer first name */
    printf( esc_html__( ‘Hi %s,’, ‘woocommerce’ ), esc_html( $order->get_billing_first_name() ) );
    } else {
    printf( esc_html__( ‘Hi,’, ‘woocommerce’ ) );
    }
    ?>
    </p>
    <?php if ( $email_improvements_enabled ) : ?>
    <p><?php esc_html_e( ‘Just to let you know — we’ve received your order, and it is now being processed.’, ‘woocommerce’ ); ?></p>
    <p><?php esc_html_e( ‘Here’s a reminder of what you’ve ordered:’, ‘woocommerce’ ); ?></p>
    <?php else : ?>
    <?php /* translators: %s: Order number */ ?>
    <p><?php printf( esc_html__( ‘Just to let you know — we\’ve received your order #%s, and it is now being processed:’, ‘woocommerce’ ), esc_html( $order->get_order_number() ) ); ?></p>
    <?php endif; ?>
    <?php echo $email_improvements_enabled ? ‘</div>’ : ”; ?>

    <?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
    */
    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 $email_improvements_enabled ? ‘<table border=”0″ cellpadding=”0″ cellspacing=”0″ width=”100%”><tr><td class=”email-additional-content”>’ : ”;
    echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
    echo $email_improvements_enabled ? ‘</td></tr></table>’ : ”;
    }

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

    • This topic was modified 2 weeks, 6 days ago by Jason.
    #1489449

    Hey Jason,

    Thank you for the inquiry.

    Would you mind providing a screenshot of the order email or a test page so we can check the issue further? You can use platforms like Savvyify, ImgBB, PostImages, or Dropbox to upload and share the screenshot.

    Have you tried editing or overriding the /plugins/woocommerce/templates/emails/email-customer-details.php file?

    Best regards,
    Ismael

    #1489605

    No I have not tried modifying the template as the above PHP file I posted I didn’t see anything about the address layout in the PHP file.

    I also want to modify the layout of the My Account page in WooCommerce now as well.

    Possibly, there is a plugin that is recommended that works with Enfold to do simple modifications of the WooCommerce templates and emails so that I don’t have to handle the PHP coding that is over my head?

    #1489636

    Hi,

    Is this information under the “Customer Details” heading? Please provide a screenshot or a test page so we can properly check the issue.

    Best regards,
    Ismael

    #1489659

    I was able to modify the My Account page by changing it from the default layout to the advanced layout, and added my own buttons that I wanted, and used CSS to hide the default WooCommerce settings.

    Now on the same page I am trying to remove the “Order Again” button. Any idea on what CSS I could use to fix this. See sample page here:

    https://devgp240730.wpenginepowered.com/my-account/view-order/59670/?_wca_initiator=action#/main

    Note I did find this CSS but it is not working, maybe I am off slightly:

    .woocommerce-order-again .button {
    display: none !important;
    }

    • This reply was modified 1 week, 2 days ago by Jason.
    #1489665

    Hi,

    Thank you for the update.

    We may need to log in to view the order details. Please provide the login details in the private field so we can check further.

    Best regards,
    Ismael

    #1489668

    What email do I use for the account access and I will create a user account for you to log in.

    #1489671

    Hi,

    Please provide the admin account you’re currently logged in with. Make sure to place the information in the private field.

    Best regards,
    Ismael

    #1489673

    I have made an account and put info in.

    #1489678

    Hi,

    Thank you for the info.

    We got this error when we check the link, and we didn’t find any other items in the order history. Would you mind placing a sample order so we can check further?

    Screenshot-2025-09-30-at-1-15-32-PM

    Best regards,
    Ismael

    #1489681

    No problem, I have placed an order so you should see a product there now with the “Order Again” button I am trying to remove.

    Here is the link that is under Order History with the button:
    https://devgp240730.wpenginepowered.com/my-account/view-order/59729/?_wca_initiator=action#/main
    It is also on the order confirmation page, which I am not sure if this link will show up.
    https://devgp240730.wpenginepowered.com/checkout/order-received/59729/?key=wc_order_1fH9JioChx4Hi#/main

    • This reply was modified 1 week, 1 day ago by Jason.
    #1489705

    Hi,

    Thank you for the links.

    We added this code to the Quick CSS field.

    #top .woocommerce-order-details .order-again {
        display: none !important;
    }

    Screenshot-2025-10-01-at-11-31-11-AM

    Best regards,
    Ismael

    #1489708

    Great! Thank you so much!

    #1489713

    Hi,

    Glad we could be of help! Please don’t hesitate to open another thread if you have more questions. Have a nice day.

    Best regards,
    Ismael

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Address 2 field leaves a blank on email order conformation’ is closed to new replies.