Home Forums General Issues Woocommerce Attribute Function Question Reply To: Woocommerce Attribute Function Question

  • Hi Michael,

    Using a custom function hooked to the woocommerce_before_order_itemmeta action hook, you could make it possible to achieve what you are looking for:

    add_action( 'woocommerce_before_order_itemmeta', 'storage_location_of_order_items', 10, 3 );
    function storage_location_of_order_items( $item_id, $item, $product ){
        // Only in backend Edit single Order pages
        if( current_user_can('edit_shop_orders') ):
        // The product ID (in WooCommerce 3+)
        $product_id = $product->get_id();
        // Get your ACF product value (replace the slug by yours below)
        $acf_value = __('Stored in: ') . get_field( 'BinLocation', $product_id );
        // Outputing the value of the "location storage" for this product item
        echo '<div class="wc-order-item-custom"><strong>'. $acf_value .'</strong></div>';