Title: sync and show
Last modified: August 3, 2021

---

# sync and show

 *  Resolved [jnz31](https://wordpress.org/support/users/jnz31/)
 * (@jnz31)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/sync-and-show-3/)
 * hi
 * there is no option to bulk ‘sync and show’ products, only the option to ‘sync
   and hide’. that is very unpractical when it comes to variable products. why dont
   you implement a third option in the pulldown menu to handle the visibility, too?
 * i now hacked your plugin to set it to ‘sync and show’ instead of ‘sync and hide’,
   aka. set the meta for fb_visibility, too. i saw this request here a lot, but 
   no solution. so here is my hack:
 * in file
    facebook-for-woocommerce/includes/Admin.php around line 991
 * before:
 *     ```
       if ( 'facebook_include' === $action ) {
   
         Products::enable_sync_for_products( $products );
         $this->resync_products( $products );
   
       } elseif ( 'facebook_exclude' === $action ) {
       ```
   
 * after:
 *     ```
       if ( 'facebook_include' === $action ) {
         Products::enable_sync_for_products( $products );
         foreach ($products as $product) {
           if ( $product->is_type( 'variable' ) ) {
             foreach ( $product->get_children() as $variation_id ) {
               $variation = wc_get_product( $variation_id );
               if ( $variation instanceof \WC_Product ) {
                 Products::set_product_visibility($variation, true);
               }
             }
           } else {
             Products::set_product_visibility($product, true);
           }
         }
         $this->resync_products( $products );
       } elseif ( 'facebook_exclude' === $action ) {
       ```
   
    -  This topic was modified 4 years, 11 months ago by [jnz31](https://wordpress.org/support/users/jnz31/).

Viewing 1 replies (of 1 total)

 *  [nicw.a11n](https://wordpress.org/support/users/nicw/)
 * (@nicw)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/sync-and-show-3/#post-14732054)
 * Hi [@jnz31](https://wordpress.org/support/users/jnz31/)
 * Thank you so much for the feedback, and the time taken to post your solution 
   here where it will be available to others.
 * We don’t recommend that core files be changed, since customizations will be lost
   when upgrading to the next version it is a risky strategy.
 * Have you considered opening an issue on the repository in Github? The code for
   this extension is open source and in a public repository [here](https://github.com/woocommerce/facebook-for-woocommerce)
   and the developers could then look to including the option.
 * I’m going to mark this as resolved, so that anyone looking for a similar solution
   might find it here, although it is definitely an “at your own risk” option.

Viewing 1 replies (of 1 total)

The topic ‘sync and show’ is closed to new replies.

 * ![](https://ps.w.org/facebook-for-woocommerce/assets/icon.svg?rev=3469606)
 * [Meta for WooCommerce](https://wordpress.org/plugins/facebook-for-woocommerce/)
 * [Support Threads](https://wordpress.org/support/plugin/facebook-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/facebook-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/facebook-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/facebook-for-woocommerce/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [nicw.a11n](https://wordpress.org/support/users/nicw/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/sync-and-show-3/#post-14732054)
 * Status: resolved