• Hi,
    We would like the product options (info from red frame) that appear in the shopping cart, on the order page, in admin order details to paste into the order notes ( customer order note). We are using fullfilment company and unfortunately they only work on SKUs. Options do not have SKUs therefore they cannot read this data. However, they can get this information from the order notes (customer note) field. Can u provide some function?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Alessio Torrisi

    (@alessio91)

    Hi there,

    unfortunately plugin does not provide this feature, it would require a customization which falls outside our support scope.

    We remain at your disposal.

    Thread Starter brzeda

    (@brzeda)

    I mannaged to make a code:

    add_action( 'woocommerce_new_order', 'products_in_customer_notes', 10, 2 );
    
    function products_in_customer_notes( $order_id, $order ) {
        
        // Verify it's a WC Order
        if ( is_a( $order, 'WC_Order' ) ) {
            $customer_note = $order->get_customer_note();
    
              foreach ( $order->get_items() as $item_id => $item ) {
                  $product_name = $item->get_name();
                  $quantity = $item->get_quantity();
                  $customer_note .= "<br>";
                  $customer_note .= $quantity . 'x ' . $product_name;
              }
    
            // Add the note
            $order->set_customer_note($customer_note);
    
            // Save the data
            $order->save();
        }
    }

    It works but still Yith Product options doesn’t copy in there. Only product.

    Any idea?

    Thread Starter brzeda

    (@brzeda)

    Or maybe give me a guide what is that data in red frame? Is it product meta or variation or option programmatically ?

    Plugin Support Iván Sosa

    (@ivansosa)

    Hi there,

    You will need to loop the products added in the order, and find the meta ‘_ywapo_meta_data’ of each item.

    You have an example on this file:

    • wp-content/plugins/yith-woocommerce-advanced-product-options/includes/class-yith-wapo-front.php:333

    We hope it helps you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Product options insert to customer note.’ is closed to new replies.