• Resolved rosalitoudtohan

    (@rosalitoudtohan)


    Help. This is my code to add Custom Details as Order Line Item.

    add_action( 'woocommerce_checkout_create_order_line_item', 'wdm_add_custom_order_line_item_meta',10,4 );
    function wdm_add_custom_order_line_item_meta($item, $cart_item_key, $values, $order) {
    if(array_key_exists('wdm_name', $values)) {
    $item->add_meta_data('_wdm_name',$values['wdm_name']);
    }
    }

    But I also want to save the meta_data to the order itself as a whole. How to do that?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Mirko P.

    (@rainfallnixfig)

    Hi there,

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook Community group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Cheers.

    Mirko P.

    (@rainfallnixfig)

    We’ve not seen any activity on this thread for a while, so I’m marking this thread as resolved.

    Hopefully, you were able to find a solution and the above resources for developers were helpful. If you have further questions, please feel free to open a new topic.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘save metadata to the actual order.’ is closed to new replies.