Banner Logo

Be a part of the family: Connect, Receive Support,
Contribute, and Reap Abundant Rewards!

Add SKU and Type columns to Product Page

WCMp Advanced Frontend Manager

Resolved
Viewing 3 reply threads
  • Author
    Posts
    • #133905
      redilson
      Participant

      Hello WCMP team,

      Is there an easy way to add an SKU and Product Type column to the product page listings on: /dashboard/products ?

      Thanks you in advance.

    • #133932
      Anonymous
      Inactive

      Hi,
      Yes there is an easy way to add an SKU and Product Type in the Product list
      Below is the code in your active theme functions.php

      add_filter( 'wcmp_vendor_dashboard_product_list_table_headers', function($headers) {
          $headers['product-type'] = __( 'Product Type', 'dc-woocommerce-multi-vendor' );
      	$headers['sku'] = __( 'SKU', 'dc-woocommerce-multi-vendor' );
          return $headers;
      } );
      // For add that headers content
      add_filter( 'wcmp_vendor_dashboard_product_list_table_row_data', function( $row, $product, $filterActionData, $requestData ) {
      	$row['product-type'] = $product->get_type();
      	$row['sku'] = $product->get_sku();
          return $row;
      }, 10, 4 );
      
      Copy

      I hope the code will solve your problem.
      Thanks

    • #134020
      redilson
      Participant

      This is great! Thank you! Anyway to make those columns sortable?

    • #134062

      This will require further custom code.

Viewing 3 reply threads

The topic ‘Add SKU and Type columns to Product Page’ is closed to new replies.