Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_filter( 'woocommerce_product_export_column_names', 'add_parent_id_export_column' );
- add_filter( 'woocommerce_product_export_product_default_columns', 'add_parent_id_export_column' );
- function add_parent_id_export_column( $columns ) {
- $columns['parent_number'] = 'Parent ID';
- return $columns;
- }
- add_filter( 'woocommerce_product_export_product_column_parent_number', 'populate_parent_id_export_data', 10, 2 );
- function populate_parent_id_export_data( $value, $product ) {
- if ( $product->is_type( 'variation' ) ) {
- $value = $product->get_parent_id();
- } else {
- $value = '';
- }
- return $value;
- }
Advertisement
Comments
-
- t33n collection Cute
- https://ay.d-ld.net/9877809738
Add Comment
Please, Sign In to add comment
Advertisement