• Hello guys. I need get all input fields for each product in the custom loop (by product id). Can you help?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Alex,

    Please try this:

    $order = wc_get_order(); // or wc_get_order( $order_id );
    foreach ( $order->get_items() as $item_key => $item ) { 
        print_r( wc_get_order_item_meta( $item_key, '_wcj_product_input_fields_global_1' ) ); 
    }
    Thread Starter AlexMelik

    (@alexmeliq)

    Thank you @rokasjan.
    I need show input fields in the custom product page, there are no any orders. I have only product Id or object, I want get all fields for each product in the loop.
    class-wcj-product-input-fields-core.php there are this function – add_product_input_fields_to_frontend, which output html with fields, i need use it in my custom template.

    Thanks.

    Hi @alexmeliq,

    Not sure if I understood it correctly, but if you need to call Booster’s add_product_input_fields_to_frontend() function, please try this:

    
    WCJ()->modules['product_input_fields']->global_product_fields->add_product_input_fields_to_frontend();
    WCJ()->modules['product_input_fields']->local_product_fields->add_product_input_fields_to_frontend();
    

    Please let me know if that helped.

    P.S. And you need to set global $product;

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Get input fields by product id’ is closed to new replies.