How to hange e-mail order details information?
-
Hi guys,
I tried to change some code in email-order-details.php and I failed. What I wanted to achieve was to replace “Order: #9999” with “Something Else: #9999”, when a certain product is in “Something Else” category, so I changed these lines:
<?php if ( ! $sent_to_admin ) : ?> <h2><?php printf( __( 'Order #%s', 'woocommerce' ), $order->get_order_number() ); ?></h2> <?php else : ?> <h2><a class="link" href="<?php echo esc_url( admin_url( 'post.php?post=' . $order->id . '&action=edit' ) ); ?>"><?php printf( __( 'Order #%s', 'woocommerce'), $order->get_order_number() ); ?></a> (<?php printf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $order->order_date ) ), date_i18n( wc_date_format(), strtotime( $order->order_date ) ) ); ?>)</h2> <?php endif; ?>
to these:
<?php if ( ! $sent_to_admin ) { ?> <h2><?php printf( __( 'Order #%s', 'woocommerce' ), $order->get_order_number() ); ?></h2> <?php } else if ((!$sent_to_admin) && (is_product_category('something-else'))) { ?> <h2><?php printf( __( 'Something Else #%s', 'woocommerce' ), $order->get_order_number() ); ?></h2> <?php } else { ?> <h2><a class="link" href="<?php echo esc_url( admin_url( 'post.php?post=' . $order->id . '&action=edit' ) ); ?>"><?php printf( __( 'Order #%s', 'woocommerce'), $order->get_order_number() ); ?></a> (<?php printf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $order->order_date ) ), date_i18n( wc_date_format(), strtotime( $order->order_date ) ) ); ?>)</h2> <?php } ?>
But whenever anyone orders the “Something Else” category product the “Order” is still being displayed instead of “Something Else”.
Could anyone help me on this please?
Thanksin advance, regards.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How to hange e-mail order details information?’ is closed to new replies.