Rhapsody Posted April 5, 2011 Share Posted April 5, 2011 I'd like to modify the email templates so if the variable for Company and Address2 are blank, there will be no blank line displayed in the email sent, and it closes the gap currently displayed. Below is code from order_conf.html - is it possible to include some conditional statements so that the company and address2 lines are skipped and the blank line space is closed up? {delivery_company} {delivery_firstname} {delivery_lastname} {delivery_address1} {delivery_address2} {delivery_city}, {delivery_state} {delivery_postal_code} {delivery_country} {delivery_phone} {delivery_other} Link to comment Share on other sites More sharing options...
ChrisLNZ Posted April 5, 2011 Share Posted April 5, 2011 I'd like to modify the email templates so if the variable for Company and Address2 are blank, there will be no blank line displayed in the email sent, and it closes the gap currently displayed. Below is code from order_conf.html - is it possible to include some conditional statements so that the company and address2 lines are skipped and the blank line space is closed up? {delivery_company} {delivery_firstname} {delivery_lastname} {delivery_address1} {delivery_address2} {delivery_city}, {delivery_state} {delivery_postal_code} {delivery_country} {delivery_phone} {delivery_other} Try commenting out the ones you don't want to show: <!-- {delivery_address2} --> Link to comment Share on other sites More sharing options...
Rhapsody Posted April 5, 2011 Author Share Posted April 5, 2011 Sometimes these variable have values that should be displayed. It's when the customer leaves these blank that I want to close up the spaces left by blank lines. Link to comment Share on other sites More sharing options...
ChrisLNZ Posted April 5, 2011 Share Posted April 5, 2011 OK - would have been helpful if that was in your initial post then instead of commenting out you need to use an if not empty statement. <?php if (isset($delivery_address2)) { ?> {delivery_address2} <?php } ?> Note tested but you wioll get an idea of where to start Link to comment Share on other sites More sharing options...
Rhapsody Posted April 5, 2011 Author Share Posted April 5, 2011 I tested using the php code above, but it still displays the blank lines. Link to comment Share on other sites More sharing options...
Recommended Posts