• Resolved jnz31

    (@jnz31)


    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 3 years, 3 months ago by jnz31.
Viewing 1 replies (of 1 total)
  • Plugin Support nicw.a11n

    (@nicw)

    Hi @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 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.