• Resolved potentdevelopment

    (@potentdevelopment)


    Hello,

    So after adding a product programmatically, I want to be able to add a line item note for each product that I added to the order.

    
    $order = wc_create_order( $default_args );
    $product = wc_get_product( $product_id );
    $product->set_price( strval( $price ) );
    $order->add_product( $product , 1 );
    

    Is there a method for adding a line item note for each product that I add to the order?

    Thank You

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

    (@rainfallnixfig)

    Hi @potentdevelopment,

    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.

    Thanks.

    Mirko P.

    (@rainfallnixfig)

    Hi there,

    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 ‘wc_create_order::add_product() How can I add line item notes?’ is closed to new replies.