• Hello.
    How to set number for each row in email order? (from 1 to 999999999999)
    FOR EXAMPLE:

    Line number | SKU       |Product |  QTY  | 
    ------------|-----------|--------|-------|
    1           | 235235    | Item   | 3     |
    2           | 43663     | Item   | 1     |
    3           | 4633666   | Item   | 10    |
    4           | 3556      | Item   | 5     |
    5           | 3466      | Item   | 1     |
    6           | 5555      | Item   | 44    |

    My email-order-details.php

    <thead>
                <tr>
    		        <th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Line number', 'woocommerce' ); ?></th>
                    <th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'SKU', 'woocommerce' ); ?></th>
                    <th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'PRODUCT', 'woocommerce' ); ?></th>
    				<th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'QTY', 'woocommerce' ); ?></th>
                </tr>
            </thead>

    My email-order-items.php

     <tr class="<?php echo esc_attr( apply_filters( 'woocommerce_order_item_class', 'order_item', $item, $order ) ); ?>">
    
            <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>; vertical-align:middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;">
         LINE NUMBERING
    		</td>
            <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>; vertical-align:middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;">
                <?php echo wp_kses_post( $sku ); ?>
            </td>
    		 <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>; vertical-align: middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; word-wrap:break-word;">
            <?php
    
            // Show title/image etc.
            if ( $show_image ) {
                echo wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', $image, $item ) );
            }
    
            // Product name.
            	    echo $product->get_description();
    			         echo ' <br/>';
    	    echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) ); 
    
            // SKU.
            if ( $show_sku && $sku ) {
                echo wp_kses_post( ' (#' . $sku . ')' );
            }
    
            // allow other plugins to add additional product information here.
            do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text );
    
            wc_display_item_meta( $item, array(
                'label_before' => '<strong class="wc-item-meta-label" style="float: left; margin-right: .25em; clear: both">',
            ) );
    
            // allow other plugins to add additional product information here.
            do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text );
    
            ?>
            </td>
    				<td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>; vertical-align:middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;">
                <?php echo wp_kses_post( apply_filters( 'woocommerce_email_order_item_quantity', $item->get_quantity(), $item ) ); ?>
            </td>
        </tr>

    thanks

    • This topic was modified 4 years, 9 months ago by kkkaaaqqq.
    • This topic was modified 4 years, 9 months ago by kkkaaaqqq.
  • The topic ‘line numbering in Email order’ is closed to new replies.