mikelee74
Forum Replies Created
-
You are right! Thank!!!
Hi,
I add the following function in function.php file:
—————————————-
function custom_woo_ce_extend_product_fields( $fields ) {$fields[] = array(
‘name’ => ‘static_field2’,
‘label’ => __( ‘Duplicate Product ID’, ‘woo_ce’ ),
‘hover’ => __( ‘Static Field within functions.php’, ‘woo_ce’ )
);
return $fields;}
add_filters( ‘woo_ce_product_fields’, ‘custom_woo_ce_extend_product_fields’ );function custom_woo_ce_extend_product_item( $product, $product_id ) {
$product->static_field2 = $product->ID;
return $product;}
add_filter( ‘woo_ce_product_item’, ‘custom_woo_ce_extend_product_item’, 10, 2 );
———————————–
I put “static_field2” because I have another static field in my function file, but it doesn’t work. The error is:
Fatal error: Call to undefined function add_filters()thank you
Sorry, but I’m not sure to understand.
I have to insert in my function.php the following function?:function custom_woo_ce_extend_product_fields( $fields ) {
$fields[] = array(
‘name’ => ‘static_field’,
‘label’ => __( ‘Static Field’, ‘woo_ce’ ),
‘hover’ => __( ‘Static Field within functions.php’, ‘woo_ce’ )
);
return $fields;}
add_filters( ‘woo_ce_product_fields’, ‘custom_woo_ce_extend_product_fields’ );function custom_woo_ce_extend_product_item( $product, $product_id ) {
$product->static_field = ‘Static value’;
return $product;}
add_filter( ‘woo_ce_product_item’, ‘custom_woo_ce_extend_product_item’, 10, 2 );and what I have to change?
thank oyuWhere is this note?
thank you
I find the solution.
The Order field list is saved every time you export a file.Sorry, I have to replace only order for product!
This new field that I have to add is static!
Hi,
I need to insert a new column in the “Product export type file” not in the “Order export type file”.
There are some differences between the two kind of export?tnx