Skip to content

Instantly share code, notes, and snippets.

Last active April 19, 2016 14:06
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Add custom parameters to WooCommerce products exported to Specter
* Filter hook wc_specter_send_custom_product_data
* Add custom parameters to products sent to Specter.
* The product data will be passed to Specter both on single product update (save_post)
* and on manually triggered product exports (from the Specter settings page).
* Contact Specter for detailed information on what parameters their system accepts.
add_filter( 'wc_specter_send_custom_product_data', 'my_custom_product_data', 10, 2 );
function my_custom_product_data( $args, $product ) {
$args['barCode'] = utf8_decode( get_post_meta( $product->id, 'my_custom_meta_field_1', true ) );
$args['buyPrice'] = utf8_decode( get_post_meta( $product->id, 'my_custom_meta_field_2', true ) );
return $args;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment