Viewing 5 replies - 16 through 20 (of 20 total)
  • I’m going based on modifying whatever code produced this screenshot, since it essentially did 12345678910111213:
    https://imgim.com/292inciw7895190.jpg

    Thread Starter ibrahmduman

    (@ibrahmduman)

    this table is woocommerce admin new order mail.

    https://imgim.com/9385incih2142354.jpg

    i want to give sequence number for each products.

    ———————-
    1 |
    ———————-
    2 |
    ———————-
    3 |
    ———————-
    .
    .
    .
    .
    .
    .
    .

    this is my table codes.

    <?php
    /**
     * Email Order Items
     *
     * @author 		WooThemes
     * @package 	WooCommerce/Templates/Emails
     * @version     2.1.2
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	exit; // Exit if accessed directly
    }
    
    foreach ( $items as $item_id => $item ) :
    	$_product     = apply_filters( 'woocommerce_order_item_product', $order->get_product_from_item( $item ), $item );
    	$item_meta    = new WC_Order_Item_Meta( $item['item_meta'], $_product );
    	?>
    	<tr>
    
    	<td style="text-align:left; vertical-align:middle; border: 1px solid #eee;">
    
    <<<<<<<<<<<<<<<<< SHOULD BE HERE >>>>>>>>>>>>>>>>>>>>><
    
    	</td>
    
    	<td style="text-align:left; vertical-align:middle; border: 1px solid #eee;"><?php echo $item['qty'] ;?></td>
    
    	<td style="text-align:left; vertical-align:middle; border: 1px solid #eee;">
    
    	<?php
    
                echo $_product->list_attributes();
             ?> 
    
    	</td>
    
    	<td style="text-align:left; vertical-align:middle; border: 1px solid #eee;">
    
    	<?php echo ' #' . $_product->id . '';  ?>
    
    	</td>
    
    <td style="text-align:left; vertical-align:middle; border: 1px solid #eee; word-wrap:break-word;"><?php
    
    			// Product name
    			echo apply_filters( 'woocommerce_order_item_name', $item['name'], $item );
                         ?>
    		</td>
    
    <td class="product-price">
    
    						<?php
    							echo apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key );
    						?>
    					</td>
    
    		<td style="text-align:left; vertical-align:middle; border: 1px solid #eee;"><?php echo $order->get_formatted_line_subtotal( $item ); ?></td>
    
    	</tr>
    <?php
    /**
     * Email Order Items
     *
     * @author 		WooThemes
     * @package 	WooCommerce/Templates/Emails
     * @version     2.1.2
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	exit; // Exit if accessed directly
    }
    
    $sira = 0;
    
    foreach ( $items as $item_id => $item ) :
    	$_product     = apply_filters( 'woocommerce_order_item_product', $order->get_product_from_item( $item ), $item );
    	$item_meta    = new WC_Order_Item_Meta( $item['item_meta'], $_product );
    	?>
    	<tr>
    
    	<td style="text-align:left; vertical-align:middle; border: 1px solid #eee;">
    
    <?php echo ++$sira; ?>
    
    	</td>
    
    	<td style="text-align:left; vertical-align:middle; border: 1px solid #eee;"><?php echo $item['qty'] ;?></td>
    
    	<td style="text-align:left; vertical-align:middle; border: 1px solid #eee;">
    
    	<?php
    
                echo $_product->list_attributes();
             ?> 
    
    	</td>
    
    	<td style="text-align:left; vertical-align:middle; border: 1px solid #eee;">
    
    	<?php echo ' #' . $_product->id . '';  ?>
    
    	</td>
    
    <td style="text-align:left; vertical-align:middle; border: 1px solid #eee; word-wrap:break-word;"><?php
    
    			// Product name
    			echo apply_filters( 'woocommerce_order_item_name', $item['name'], $item );
                         ?>
    		</td>
    
    <td class="product-price">
    
    						<?php
    							echo apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key );
    						?>
    					</td>
    
    		<td style="text-align:left; vertical-align:middle; border: 1px solid #eee;"><?php echo $order->get_formatted_line_subtotal( $item ); ?></td>
    
    	</tr>
    Thread Starter ibrahmduman

    (@ibrahmduman)

    Thank you so much for all answers . Especially ” csloisel ” thank you.

    finally ??

    https://imgim.com/8363inciv6780692.jpg

    Thread Starter ibrahmduman

    (@ibrahmduman)

    Problem SOLVED

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘PHP Count’ is closed to new replies.