Home Forums Plugins Store Exporter Support [Resolved] exporting custom field Reply To: [Resolved] exporting custom field

#35427
KatrinaMiller
Participant

I added this code, it adds the Lead Time field to the product options list on the export screen, and creates a row in the export file, but all the values are 0

function wpsc_ce_custom_product_fields( $fields ) {
$fields[] = array (
‘name’ => ‘leadtime’,
‘label’ => ‘Lead Time’,
‘default’ => 1
);
return $fields;
}
add_filter( ‘wpsc_ce_product_fields’, ‘wpsc_ce_custom_product_fields’ );

function wpsc_ce_custom_product_item_leadtime( $product, $product_id ) {
$product->leadtime = $product->lead-time;
return $product;
}
add_filter( ‘wpsc_ce_product_item’, ‘wpsc_ce_custom_product_item_leadtime’, 10, 2 );