Support » Plugin: WooCommerce » Display input information of fields horizontally in shipping address

  • Resolved topsan123

    (@topsan123)


    Hello,

    I enter information to a Company field, City field and State field and the result displays vertically like this:

    mycompany
    mycity
    mystate

    How can I remove the <br> and make them display horizontally and separated with comma like this: mycompany, mycity, mystate? I would like to apply this change to all the places that display shipping address. What template do I have to edit? I’ve been to wp-content/plugins/woocommerce/templates/order/order-details-customer.php but I couldn’t find it.

Viewing 1 replies (of 1 total)
  • This topic helps me https://stackoverflow.com/questions/33739602/how-do-i-remove-the-br-in-billing-address-and-display-address-and-city-text-be

    I copy the template “order-details-customer.php” from “wp-content/plugins/woocommerce/templates/order” and place it in
    the “Child theme folder>Woocommerce folder>order folder”. I edit the “order-details-customer.php” and replace the “<address></address>” part with this one:

    <address>
    	    <?php //echo wp_kses_post( $order->get_formatted_billing_address( esc_html__( 'N/A', 'woocommerce' ) ) ); ?>
    	    
    	   <?php echo $order->billing_first_name; ?>&nbsp;
    <?php echo $order->billing_last_name; ?>
    <br><?php echo $order->billing_company; ?>, <?php echo $order->billing_city; ?>, <?php echo $order->billing_state; ?>
    
    	   <?php if ( $order->get_billing_phone() ) : ?>
    			<p class="woocommerce-customer-details--phone"><?php echo esc_html( $order->get_billing_phone() ); ?></p>
    	   <?php endif; ?>
    
    	   <?php if ( $order->get_billing_email() ) : ?>
    			<p class="woocommerce-customer-details--email"><?php echo esc_html( $order->get_billing_email() ); ?></p>
    	   <?php endif; ?>
    </address>
Viewing 1 replies (of 1 total)
  • The topic ‘Display input information of fields horizontally in shipping address’ is closed to new replies.