wc_autoship_checkout_order_data (filter)

Alter order data used for checkout when processing an Autoship Order.

Example

<?php
/**
* @param array $order_data
* @param int $customer_id
* @param string $shipping_method
* @param string $payment_gateway_id
* @param string $payment_token_id
* @return array 
*/
function wc_autoship_checkout_order_data_example( $order_data, $customer_id, $shipping_method, $payment_gateway_id, $payment_token_id ) {
  // Add a custom field to order_data
  $order_data['my_custom_field'] = 'my_custom_value';
  return $order_data;
}
add_filter( 'wc_autoship_checkout_order_data', 'wc_autoship_checkout_order_data_example', 10, 5 );

Still need help? Contact Us Contact Us