export : display only products/variation in stock
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page pleaseIf you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.
Quote from cafesolo on May 6, 2025, 10:10Hello,
I believe you, but after adding your code, the product attributes are once again included in the product name in the order details in WooCommerce.
In my functions.php file, the two codes are arranged like this:/* Do not display attributes in the product name in the order details */ add_filter( 'woocommerce_product_variation_title_include_attributes', '__return_false' ); /* BEAR BULK display attributes in the product name in CSV */ add_filter('woocommerce_product_variation_title_include_attributes',function($should_include_attributes, $product){ if( wp_doing_ajax() ){ return true; } return $should_include_attributes; },10,2);What is wrong here ?...
Thanks
Hello,
I believe you, but after adding your code, the product attributes are once again included in the product name in the order details in WooCommerce.
In my functions.php file, the two codes are arranged like this:
/* Do not display attributes in the product name in the order details */ add_filter( 'woocommerce_product_variation_title_include_attributes', '__return_false' ); /* BEAR BULK display attributes in the product name in CSV */ add_filter('woocommerce_product_variation_title_include_attributes',function($should_include_attributes, $product){ if( wp_doing_ajax() ){ return true; } return $should_include_attributes; },10,2);
What is wrong here ?...
Thanks
Quote from Pablo Borysenco on May 6, 2025, 11:55Just for testing, try this code:
add_filter('woocommerce_product_variation_title_include_attributes',function($should_include_attributes, $product){ return $should_include_attributes; },10,2);
Just for testing, try this code:
add_filter('woocommerce_product_variation_title_include_attributes',function($should_include_attributes, $product){
return $should_include_attributes;
},10,2);Quote from cafesolo on May 6, 2025, 13:39Sorry, but with this new code attributes are not included in products titles in .csv file generated by export....
Sorry, but with this new code attributes are not included in products titles in .csv file generated by export....
Quote from Pablo Borysenco on May 7, 2025, 09:36Hello
ok! New code:
add_filter('woocommerce_product_variation_title_include_attributes',function($should_include_attributes, $product){ if( wp_doing_ajax() ){$action = $_REQUEST['action'] ?? '';
if (strpos($action, 'wpbe') !== false) {
return true;
}} return $should_include_attributes; },10,2);
Hello
ok! New code:
add_filter('woocommerce_product_variation_title_include_attributes',function($should_include_attributes, $product){
if( wp_doing_ajax() ){$action = $_REQUEST['action'] ?? '';
if (strpos($action, 'wpbe') !== false) {
return true;
}
} return $should_include_attributes; },10,2);
Quote from cafesolo on May 9, 2025, 09:52Hello,
With this new code, attributes are not displayed anymore
in products titles in .csv file generated by export...add_filter('woocommerce_product_variation_title_include_attributes',function($should_include_attributes, $product){ if( wp_doing_ajax() ){ $action = $_REQUEST['action'] ?? ''; if (strpos($action, 'wpbe') !== false) { return true; } } return $should_include_attributes; },10,2);Thanks
Hello,
With this new code, attributes are not displayed anymore
in products titles in .csv file generated by export...
add_filter('woocommerce_product_variation_title_include_attributes',function($should_include_attributes, $product){
if( wp_doing_ajax() ){
$action = $_REQUEST['action'] ?? '';
if (strpos($action, 'wpbe') !== false) {
return true;
}
}
return $should_include_attributes;
},10,2);Thanks
Quote from Pablo Borysenco on May 9, 2025, 11:38Hello
Great! Welcome;)
Hello
Great! Welcome;)
Quote from cafesolo on May 9, 2025, 11:41You read so fast : , attributes are not displayed in Bear Bulk export file, it doesn't work : /
You read so fast : , attributes are not displayed in Bear Bulk export file, it doesn't work : /
Quote from Pablo Borysenco on May 9, 2025, 12:24Ok! Try in file - \woo-bulk-editor\classes\models\products.php - change this code - https://share.pluginus.net/image/i20250509132328.png
and do a test
Ok! Try in file - \woo-bulk-editor\classes\models\products.php - change this code - https://share.pluginus.net/image/i20250509132328.png
and do a test
Quote from cafesolo on May 9, 2025, 14:25I modified the code in the \woo-bulk-editor\classes\models\products.php file
/$parent_product = $this->get_product($product->get_parent_id()); $title_base = get_post_field('post_title', $product->get_parent_id()); if (true) {And I did some tests, with and without the last code, that you had given me before :
add_filter('woocommerce_product_variation_title_include_attributes',function($should_include_attributes, $product){
if( wp_doing_ajax() ){
$action = $_REQUEST['action'] ?? '';
if (strpos($action, 'wpbe') !== false) {
return true;
}
}
return $should_include_attributes;
},10,2);In both cases it doesn't work : still no attributes in the product title in the .csv
I modified the code in the \woo-bulk-editor\classes\models\products.php file
/$parent_product = $this->get_product($product->get_parent_id());
$title_base = get_post_field('post_title', $product->get_parent_id());
if (true) {And I did some tests, with and without the last code, that you had given me before :
add_filter('woocommerce_product_variation_title_include_attributes',function($should_include_attributes, $product){
if( wp_doing_ajax() ){
$action = $_REQUEST['action'] ?? '';
if (strpos($action, 'wpbe') !== false) {
return true;
}
}
return $should_include_attributes;
},10,2);
In both cases it doesn't work : still no attributes in the product title in the .csv
Quote from Pablo Borysenco on May 12, 2025, 09:27Hello
oK! So our plugin doesn't affect this, because this is the only place where our plugin can affect the display format of titles.
For this reason my code could not change it
Hello
oK! So our plugin doesn't affect this, because this is the only place where our plugin can affect the display format of titles.
For this reason my code could not change it
Quote from cafesolo on June 4, 2025, 15:15Hello Pablo,
It's been a while...
I'm getting back to you because the developers of the serial/batch number module provided me with the code to include the serial numbers of product variations in the .csv export file...Here's the code:
function wpo_add_batch_number_to_bear_bulk_exported_data( array $answer, int $product_id, array $fields ): array { foreach ( $fields as $field_key => $field ) { if ( ! empty( $field['field_type'] ) && 'meta' === $field['field_type'] && 'product_batch_numbers' === $field['meta_key'] ) { // find field_key position in array $field_key_pos = array_search( $field_key, array_keys( $fields ) ) - 1; } } if ( ! empty( $field_key_pos ) && array_key_exists( $field_key_pos, $answer ) ) { $ids = array(); $product = wc_get_product( $product_id ); if ( empty( $product ) ) { return $answer; } $ids[] = $product->get_id(); $variation_ids = $product->get_children(); if ( ! empty( $variation_ids ) ) { foreach ( $variation_ids as $variation_id ) { $variation = wc_get_product( $variation_id ); if ( empty( $variation ) ) { continue; } $ids[] = $variation_id; } } $args = array( 'shared_ids' => $ids, 'status' => 'active', 'order_by' => WPO_WCPBN()->classes['settings']->options->get_option( 'batch_prioritization' ) ? WPO_WCPBN()->classes['settings']->options->get_option( 'batch_prioritization' ) : 'id', 'order' => 'ASC', ); $batches = wpo_wcpbn_get_batches( $args ); $batches_data = array(); foreach ( $batches as $batch ) { $batches_data[] = $batch->batch_number . ' (' . absint( $batch->quantity_available ) . ')'; } $answer[ $field_key_pos ] = implode( ' - ', $batches_data ); } return $answer; } add_filter( 'woobe_export_product_fields_answer', 'wpo_add_batch_number_to_bear_bulk_exported_data', 10, 3 );Export csv screenshot here :
https://ibb.co/w2WvkbxCould you adapt it so that all product variations attributes be exported in .csv ?
That would be great !
Thanks
Hello Pablo,
It's been a while...
I'm getting back to you because the developers of the serial/batch number module provided me with the code to include the serial numbers of product variations in the .csv export file...
Here's the code:
function wpo_add_batch_number_to_bear_bulk_exported_data( array $answer, int $product_id, array $fields ): array {
foreach ( $fields as $field_key => $field ) {
if (
! empty( $field['field_type'] ) &&
'meta' === $field['field_type'] &&
'product_batch_numbers' === $field['meta_key'] ) {
// find field_key position in array
$field_key_pos = array_search( $field_key, array_keys( $fields ) ) - 1;
}
}
if ( ! empty( $field_key_pos ) && array_key_exists( $field_key_pos, $answer ) ) {
$ids = array();
$product = wc_get_product( $product_id );
if ( empty( $product ) ) {
return $answer;
}
$ids[] = $product->get_id();
$variation_ids = $product->get_children();
if ( ! empty( $variation_ids ) ) {
foreach ( $variation_ids as $variation_id ) {
$variation = wc_get_product( $variation_id );
if ( empty( $variation ) ) {
continue;
}
$ids[] = $variation_id;
}
}
$args = array(
'shared_ids' => $ids,
'status' => 'active',
'order_by' => WPO_WCPBN()->classes['settings']->options->get_option( 'batch_prioritization' ) ? WPO_WCPBN()->classes['settings']->options->get_option( 'batch_prioritization' ) : 'id',
'order' => 'ASC',
);
$batches = wpo_wcpbn_get_batches( $args );
$batches_data = array();
foreach ( $batches as $batch ) {
$batches_data[] = $batch->batch_number . ' (' . absint( $batch->quantity_available ) . ')';
}
$answer[ $field_key_pos ] = implode( ' - ', $batches_data );
}
return $answer;
}
add_filter( 'woobe_export_product_fields_answer', 'wpo_add_batch_number_to_bear_bulk_exported_data', 10, 3 );Export csv screenshot here :
https://ibb.co/w2Wvkbx
Could you adapt it so that all product variations attributes be exported in .csv ?
That would be great !
Thanks
Quote from Pablo Borysenco on June 5, 2025, 10:07Hello
I'll pass this on to the developers so they can check it out.
Hello
I'll pass this on to the developers so they can check it out.