• Resolved kiberchaka

    (@kiberchaka)


    Hi!
    WooCommerce orders are custom post types, and they have a menu for bulk editing. But there only some specified actions to edit, for exaple, to change order status. But general posts have Edit bulk option, that have some fields.
    Is it possible to enable this option for Orders post type?
    Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support kellymetal a11n

    (@kellymetal)

    Hi there,

    The Posts > All Posts bulk edit functionality does allow editing some fields (similar to the bulk edit with Products), however those fields (Category, Author, etc) do not really apply to Orders. Which fields there were you trying to edit?

    On Orders, the main thing that would make sense to bulk edit would be the statuses, which is why they are included in the bulk action dropdown.

    Thread Starter kiberchaka

    (@kiberchaka)

    I tryed to edit a custom field with a plugin for editing custom fields. This plugin works with Post types and custom types. But this plugin adds his functionality to the interface that appears when you choose Edit optin in bulk edit dropdown. But there is no Edit option in Orders bulk editing. So I am intrested, is it possible to enable this option. I don’t mind if there is no athor etc. because there will appear custom fields added by other plugin.

    • This reply was modified 3 years, 11 months ago by kiberchaka.
    Plugin Support kellymetal a11n

    (@kellymetal)

    Hi there,

    Thank you for the clarification here. Even if you somehow added an “Edit” option in that bulk actions dropdown, the functionality would need to be written to actually work with and update those specific custom fields in the database. I would recommend reaching out to the developers of that custom fields plugin to see if they might have any other advice for working with the custom fields you’ve added.

    Aside from that, this would require quite a bit of custom code (not just a short code snippet like we would be able to provide here in the forums). If you need assistance with coding or custom development, we recommend reaching out to a developer from one of the services at https://woocommerce.com/customizations/

    Thread Starter kiberchaka

    (@kiberchaka)

    Hi!
    Thank you for keeping discussion! ??

    But, if I create a custom post type it has general Bulk Edit option by default. So, I assume, that in orders (and they are custom post type too) it is just disabled somehow. And I don’t think that there is a lot of coding needed, just to find where WooCommerce developers disabled it, or didn’t enabled on orders custom post type registration.

    Plugin Support kellymetal a11n

    (@kellymetal)

    Hi there,

    It looks like the Edit is removed from the dropdown in the define_bulk_actions method here:
    https://github.com/woocommerce/woocommerce/blob/ab4a46e32e338cbf33094ab26144744a021a21a9/includes/admin/list-tables/class-wc-admin-list-table-orders.php#L140

    Then it looks like there’s a filter for customizing the actions here:
    https://github.com/woocommerce/woocommerce/blob/ab4a46e32e338cbf33094ab26144744a021a21a9/includes/admin/list-tables/abstract-class-wc-admin-list-table.php#L50

    I wrote a little snippet to add the Edit back in, but I’m not sure if that’s the best way of doing it:

    
    function my_custom_bulk_actions( $actions ) {
        $actions['edit'] = __( 'Edit', 'woocommerce' );
    
        return $actions;
    }
    add_filter( 'bulk_actions-edit-shop_order', 'my_custom_bulk_actions', 99, 2 );
    

    It did bring back the Edit option though:

    Edit orders
    Link to image: https://d.pr/i/CjaBrS

    Plugin Support fevered – a11n

    (@fevered)

    Hey there, since we haven’t heard back from you in awhile I’ll mark this thread as resolved now. If you have any further questions, I recommend creating a new thread.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to add into Bulk Edit list for Woocommerce Orders general Edit option?’ is closed to new replies.