Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #537993

    Hi

    I have added this code to my functions.php which has results in me being able to display a SKU and Product Image against each line in the auto email.

    // Display product images in WooCommerce Emails 
    
    // Edit order items table template defaults
    function sww_add_wc_order_email_images( $table, $order ) {
      
    	ob_start();
    	
    	$template = $plain_text ? 'emails/plain/email-order-items.php' : 'emails/email-order-items.php';
    	wc_get_template( $template, array(
    		'order'                 => $order,
    		'items'                 => $order->get_items(),
    		'show_download_links'   => $show_download_links,
    		'show_sku'              => true,
    		'show_purchase_note'    => $show_purchase_note,
    		'show_image'            => true,
    		'image_size'            => $image_size
    	) );
       
    	return ob_get_clean();
    }
    add_filter( 'woocommerce_email_order_items_table', 'sww_add_wc_order_email_images', 10, 2 );

    However, the email displays like this…

    http://screencast.com/t/kKI9gpIgod

    The product title/sku etc wraps underneath the image.

    Ideally I want them in their own <TD> within my email template.

    Does anyone have any tricks to help me with this?

    My current email template is this …

    <?php
    
    /**
    
     * Customer processing order email
    
     *
    
     * @author 		WooThemes
    
     * @package 	WooCommerce/Templates/Emails
    
     * @version     1.6.4
    
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    
    	exit; // Exit if accessed directly
    
    }
    
    ?>
    
    <?php do_action('woocommerce_email_header', $email_heading); ?>
    
    <P style="font-family: Arial, Helvetica, sans-serif; color: #060606; font-size:12px;"><?php _e( "Thank you for your Quotation Request which is now being processed by the next available member of our Sales Team. The details are shown below for your reference:", 'woocommerce' ); ?></P>
    
    <!-- DEV Payment method -->
    
    <!-- <?php do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text ); ?> -->
    
    <h2><?php printf( __( 'Online Quotation Reference %s', 'woocommerce' ), $order->get_order_number() ); ?></h2>
    
    <H2> </h2>
    
    <table cellspacing="0" cellpadding="6" style="width: 600px; border: 1px solid #eee; margin: auto;" border="1" bordercolor="#eee">
    
    	<thead>
    
    		<tr>
    
    			<th scope="col" style="text-align:left; border: 1px solid #eee; font-family: Arial, Helvetica, sans-serif; font-size:12px; vertical-align: text-bottom;"><?php _e( 'Product', 'woocommerce' ); ?></th>
    
    			<th scope="col" style="text-align:left; border: 1px solid #eee; font-family: Arial, Helvetica, sans-serif; font-size:12px; vertical-align: text-bottom;"><?php _e( 'Quantity', 'woocommerce' ); ?></th>
    
    		</tr>
    
    	</thead>
    
    <BR>
    
    	<tbody>
    
    		<?php echo $order->email_order_items_table( $order->is_download_permitted(), true, $order->has_status( 'processing' ) ); ?>
    
    	</tbody>
    
    	<!-- CT Removed Footer Section -->
    
    <!-- <tfoot>
    		<?php
    			if ( $totals = $order->get_order_item_totals() ) {
    				$i = 0;
    				foreach ( $totals as $total ) {
    					$i++;
    					?><tr>
    						<th scope="row" colspan="2" style="text-align:left; border: 1px solid #eee; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['label']; ?></th>
    						<td style="text-align:left; border: 1px solid #eee; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['value']; ?></td>
    					</tr><?php
    				}
    			}
    		?>
    	</tfoot> -->
    </table>
    
    <!-- DEV NOTES Order Table -->
    
    <P><?php do_action( 'woocommerce_email_after_order_table', $order, $sent_to_admin, $plain_text ); ?></P>
    
    <!-- DEV Additional details such as notes, need by date, job title etc -->
    
    <span style="font-family: Arial, Helvetica, sans-serif; color: #060606; font-size:12px;"><?php do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text ); ?></span>
    
    <!-- DEV Your Details section including email, tel, addressess -->
    
    <span style="font-family: Arial, Helvetica, sans-serif; color: #060606; font-size:12px;"><?php do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text ); ?></span>
    
    <?php do_action( 'woocommerce_email_footer' ); ?>
    
    #538375

    Hey richardelectrix!

    This is bordering on custom work. It would be best to hire a freelancer to help you out with advanced customizations like this or contact Woocommerce support.

    Cheers!
    Elliott

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.