Best Multi Vendor Marketplace Plugin for WordPress › Forums › WCFM › Sync the enquirers for all languages
- This topic has 1 reply, 2 voices, and was last updated 8 years ago by
WCFM Forum.
- AuthorPosts
- September 7, 2018 at 5:43 pm #31100
Majd Alkouifi
GuestHi,
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 WHEREis_private= 0 ANDreply!= ” ANDproduct_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 WHEREis_private= 0 ANDreply!= ” ANDproduct_idIN (‘$all_products_id’)” );I hope this may help others 🙂
- September 8, 2018 at 5:07 pm #31175
WCFM Forum
MemberHi,
Thanks @Majd
We will implement this in WCFM core as well.
Thank You
- AuthorPosts
- The topic ‘Sync the enquirers for all languages’ is closed to new replies.