Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hi, I would like to add a custom placeholder to display value from custom billing field through WooCommerce Checkout Manager plugin (i.e : billing_wooccm12 ), and below is the function from them to access the data.

    function get_wooccm_fields($fields, $order) {
    
    if (count($billing = WOOCCM()->billing->get_fields())) {
    foreach ($billing as $field_id => $field) {
    if (!in_array($field['name'], WOOCCM()->billing->get_defaults())) {
    if ($value = get_post_meta($order->get_id(), sprintf('_%s', $field['key']), true)) {
    $fields[$field['key']] = array(
    'label' => $field['label'],
    'value' => $value
    );
    }
    }
    }
    }
    
    if (count($shipping = WOOCCM()->shipping->get_fields())) {
    foreach ($shipping as $field_id => $field) {
    if (!in_array($field['name'], WOOCCM()->shipping->get_defaults())) {
    if ($value = get_post_meta($order->get_id(), sprintf('_%s', $field['key']), true)) {
    $fields[$field['key']] = array(
    'label' => $field['label'],
    'value' => $value
    );
    }
    }
    }
    }
    
    if (count($additional = WOOCCM()->additional->get_fields())) {
    foreach ($additional as $field_id => $field) {
    if (!in_array($field['name'], WOOCCM()->additional->get_defaults())) {
    if ($value = get_post_meta($order->get_id(), sprintf('_%s', $field['key']), true)) {
    $fields[$field['key']] = array(
    'label' => $field['label'],
    'value' => $value
    );
    }
    }
    }
    }
    
    return $fields;
    }

    May I know how to add one of those values to the available placeholder?

Viewing 1 replies (of 1 total)