• Resolved zzbeck

    (@zzbeck)


    Hi!
    We really want to show custom product field (from Woo product backend), on the order line on the receipt. We need this to display location on each product.
    I have searched the support forum, but can only fin information on how to display custom order fields.

    Is this possible in some way?

    Hope you can help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support kenil802

    (@kenil802)

    Hi @zzbeck,

    Apologies for the delay in response.

    I will ask the developer regarding this and get back to you with an update.

    Reghards,
    Kenil Shah

    Thread Starter zzbeck

    (@zzbeck)

    Thanks!

    Plugin Support kenil802

    (@kenil802)

    Hi @zzbeck,

    Apologies for the delay in response.

    Please add the below code and it will come like this as shown in the screenhsot: https://prnt.sc/y0ra4c

    Code:

    add_filter( ‘wcdn_order_item_fields’, ‘wcdn_product_field’, 10, 4 );
    function wcdn_product_field( $array, $product, $order, $item ) {
    $new_fields = array();
    $new_fields[‘field_name’] = array(
    ‘label’ => ‘Your field name :’,
    ‘value’ => get_post_meta( $product->id, ‘field_meta_key’, true )
    );
    return $new_fields;
    }

    In the above snippet, change the label and add the correct meta key to get the value of that field, and after that add it in the functions.php file of the active theme.

    Do let us know how it goes.

    Regards,
    Kenil Shah

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom product field on order line’ is closed to new replies.