0
votes

We are using a custom payment gateway where the shipping and address information are provided by the payment gateway. Because this information are available through payment gateway we have removed the customer details form from the woocommerce checkout page.

The payment gateway we are using is custom gateway.

Through gateway, customer doesn't have to fill in all information in checkout page, instead they can fill in all information in the mobile, and once they confirm the order, the informatin they have registered sent to woocommerce listener. So we are getting shipping info and billing information from gateway.

Now the problem is, when the order succeed, we are not getting the billing details and shipping detalis in cutomer order email or admin order email.

The question is, how can I set those information from the gateway to woo-commerce using code, so that the information can be populated in the email.

thanks

2
This seems like a good time to hire a developer. The best I could say at this point is that you should capture the billing/shipping info from PayDunk and store it in the database. And/or PayDunk's API should have a way to retrieve the data which you could then add to the email.helgatheviking
Hi, we have captured the data, but how can I add it to email?user2374740

2 Answers

1
votes

From my tutorial on customizing checkout fields this is an example of how you'd add data to emails:

function kia_display_email_order_meta( $order, $sent_to_admin, $plain_text ) {
    $some_field = get_post_meta( $order->id, '_some_field', true ),
    $another_field = get_post_meta( $order->id, '_another_field', true ),
    if( $plain_text ){
        echo 'The value for some field is ' . $some_field . ' while the value of another field is ' . $another_field;
    } else {
        echo '<p>The value for <strong>some field</strong> is ' . $some_field. ' while the value of <strong>another field</strong> is ' . $another_field;</p>;
    }
}
add_action('woocommerce_email_customer_details', 'kia_display_email_order_meta', 30, 3 );
-1
votes

Here is a plugin that adds everything you need out of the box, including shippped custom order status and tracking number information in order page, account page and notification emails: https://wordpress.org/plugins/woo-advanced-shipment-tracking/