• Resolved akseven

    (@akseven)


    Hello!

    I want to customize the email of an order, which is sent to the vendor. It is necessary for me to add the payment method and delivery method to the wcfm-order-details-table.

    But now I have only figured out how to add payment method, but apparently, as shown in the picture, the payment method is not in the wcfm-order-detail-table. And I still don’t know how to add delivery method.

    For me the it is better to add the payment method under subtotal(Zwischentotal) and the delivery method under shipping(Versand). I tried a lot but still got them before this table. Is it possible to do it?

    Thanks in advance for the answer!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WC Lovers

    (@wclovers)

    Add this snippet to your site –

    add_action ( 'wcfm_order_totals_after_total', function( $order_id ) {
    	$order = wc_get_order( $order_id );
    	if ( WC()->payment_gateways() ) {
    		$payment_gateways = WC()->payment_gateways->payment_gateways();
    	} else {
    		$payment_gateways = array();
    	}
    	$payment_method = ! empty( $order->get_payment_method() ) ? $order->get_payment_method() : '';
    	
    	$td_style = '';
    	if( $payment_method ) {
    		?>
    		<tr>
    			<th class="label" colspan="2" style="text-align:right; <?php echo $td_style; ?>"><?php _e( 'Payment Method', 'wc-frontend-manager' ); ?>:</th>
    			<td class="total" style="text-align:center; <?php echo $td_style; ?>">
    				<div class="view">
    					<?php 
    					echo isset( $payment_gateways[ $payment_method ] ) ? esc_html( $payment_gateways[ $payment_method ]->get_title() ) : esc_html( $payment_method );
    					?>
    				</div>
    			</td>
    		</tr>
    		<?php
    	}
    }, 50 );

    Add custom code(s) to your child theme’s functions.php
    In case you do not have child theme then add those using this plugin – https://wordpress.org/plugins/code-snippets/

    Plugin Author WC Lovers

    (@wclovers)

    Keep this option option enable for commission setting, hence shipping will also visible – https://ibb.co/YWcShCK

    Thread Starter akseven

    (@akseven)

    Thank you, it works!

    Is it possible to add the shipping method to this email?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Customize order emails (Store new order)’ is closed to new replies.