woogc/ps/synchronize_product/ignore_meta_key
Name: woogc/ps/synchronize_product/ignore_meta_key
Type: Filter
Arguments: $IgnoreMeta, $prop_title, $prop_value, $child_product, $main_product_data, $origin_product_blog_ID
The filter can be used to ignore/skip a meta field to replicate, when running a Product synchronization procedure.
The following example ignores any parent Product Title change
add_filter ( 'woogc/ps/synchronize_product/ignore_meta_key', 'woogc_ps_synchronize_product_ignore_meta_key', 10, 6 ); function woogc_ps_synchronize_product_ignore_meta_key ( $ignore, $prop_title, $prop_value, $child_product, $main_product_data, $origin_product_blog_ID ) { if ( $prop_title == 'name' ) return TRUE; return $ignore; }
To ignore the synchronisation for a custom field called ‘total_reviews’ the following code can be used:
add_filter ( 'woogc/ps/synchronize_product/ignore_meta_key', 'woogc_ps_synchronize_product_ignore_meta_key', 10, 6 ); function woogc_ps_synchronize_product_ignore_meta_key ( $ignore, $prop_title, $prop_value, $child_product, $main_product_data, $origin_product_blog_ID ) { if ( $prop_title == 'total_reviews' ) return TRUE; return $ignore; }
The code should be placed inside a php file on wp-content/mu-plugins folder.