Sync the enquirers for all languages

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM Sync the enquirers for all languages

Viewing 1 reply thread
  • Author
    Posts
    • #31100
      Majd Alkouifi
      Guest

      Hi,

      I’m using WPML to translate my site. When someone makes an enquiry in product page in Arabic language, and let’s say another customer browse the site in English language and he wants to read the enquiry for the same product so he won’t see anything. I contacted with WPML support and gives me this solution and it works like a charm.
      change this line: wp-content/plugins/wc-frontend-manager/views/enquiry/wcfm-view-enquiry-tab.php line_number: 27
      $enquiries = $wpdb->get_results( “SELECT * FROM {$wpdb->prefix}wcfm_enquiries WHERE is_private = 0 AND reply != ” AND product_id = {$product_id}” );

      To be:

      $all_products_id = array();
      $languages = apply_filters( ‘wpml_active_languages’,null);
      foreach( $languages as $l ) {
      $l_code = $l[‘language_code’];
      $p_id = apply_filters( ‘wpml_object_id’, $product_id, ‘product’, FALSE, $l_code );
      $all_products_id[] = $p_id;
      }
      $all_products_id = implode(“,”,$all_products_id);
      $enquiries = $wpdb->get_results( “SELECT * FROM {$wpdb->prefix}wcfm_enquiries WHERE is_private = 0 AND reply != ” AND product_id IN (‘$all_products_id’)” );

      I hope this may help others 🙂

    • #31175
      WCFM Forum
      Keymaster

      Hi,

      Thanks @Majd

      We will implement this in WCFM core as well.

      Thank You

Viewing 1 reply thread
  • The topic ‘Sync the enquirers for all languages’ is closed to new replies.