Created
January 31, 2018 09:19
-
-
Save kreamweb/d39220650230ab76e21c5d3fd01d2863 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( class_exists( 'YITH_YWRAQ_Order_Request' ) ) { | |
add_action( 'ywraq_add_order_meta', 'ywraq_add_order_meta', 10, 2 ); | |
function ywraq_add_order_meta( $order_id, $raq ) { | |
if ( ! isset( $raq['other_email_fields'] ) ) { | |
return; | |
} | |
$other_fields = $raq['other_email_fields']; //here you can find the custom field that you have set on CF7 | |
//your-billing_phone is the name of your custom input field | |
if ( isset( $other_fields['your-billing_phone']) ) { | |
update_post_meta( $order_id, '_billing_phone', $other_fields['your-billing_phone'] ); | |
} | |
if ( isset( $raq['your-billing_address_1'] ) ) { | |
update_post_meta( $order_id, '_billing_address_1', $other_fields['your-billing_address_1'] ); | |
} | |
if ( isset( $raq['your-billing_address_2'] ) ) { | |
update_post_meta( $order_id, '_billing_address_2', $other_fields['your-billing_address_2'] ); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment