1

I'm going to attempt to add a brand column to the WooCommerce Products admin table, and also update the search filter so it searches for brands also. Has anybody done this before though? I've never made changes to a well established plugin before, how do I stand with updates potentially overwriting my changes in the future?

Am I correct in thinking this should be achieved through a child them?

Also, how might I manipulate the Products plugin to include a brand column.

Thanks

1
  • You should not make changes in the code of WooCommerce plugin. If you want custom functionality, you can make a new plugin using hooks provided by WooCommerce.

  • WordPress provides manage_product_posts_custom_column, using this you can add a custom column to any post type.

  • Also I suggest trying the Admin Columns plugin.

  • Sorry, I think my question is misleading. I have brands set to products. What I'm trying to do is add a Column to the products table in the woo commerce admin section which displays the brands of a specific product. – Liam Dec 7 '15 at 11:30
  • @Liam: Please see updated answer. If have any doubts, feel free to ask. – WisdmLabs Dec 7 '15 at 11:59
  • Thanks @WisdmLabs the plugin looks good actually, but as an attempt at learning I'd like to carry this out using a child theme. The column I'm attempting to add is a post term called pa_brand. I can access this using $terms = wp_get_post_terms( $item['ID'], 'pa_brand' ); how can I set this to the new column? – Liam Dec 7 '15 at 12:19
0

I'm agreed that plugins and core code shouldn't be manipulated somehow.

So, if I understand correctly, you registered a custom taxonomy pa_brand and want to add this column to products.

All you need is two WordPress hooks manage_edit-product_columns to add the column and and manage_posts_custom_column to populate it with brands.

You can find the complete code of your question in this tutorial.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.