Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wpf_save_custom_checkout_field( $order_id ) {
- if ( ! empty( $_POST['special-offers'] ) ) {
- update_post_meta( $order_id, 'special-offers', true );
- }
- }
- add_action( 'woocommerce_checkout_update_order_meta', 'wpf_save_custom_checkout_field' );
- function get_product_data( $order_data, $order ) {
- $order_data['special-offers'] = get_post_meta( $order->get_id(), 'special-offers', true );
- if ( empty( $order_data['special-offers'] ) ) {
- $order_data['special-offers'] = null;
- }
- return $order_data;
- }
- add_filter( 'wpf_woocommerce_customer_data', 'get_product_data', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement