$filter_productsPost = new WP_Query($filter_products);
I done know why there is "OR condition" for en language in sql see below
SELECT SQL_CALC_FOUND_ROWS yswp_gstic_posts.id
FROM yswp_gstic_posts
INNER JOIN yswp_gstic_postmeta
ON ( yswp_gstic_posts.id = yswp_gstic_postmeta.post_id )
INNER JOIN yswp_gstic_postmeta AS mt1
ON ( yswp_gstic_posts.id = mt1.post_id )
JOIN yswp_gstic_icl_translations wpml_translations
ON yswp_gstic_posts.id = wpml_translations.element_id
AND wpml_translations.element_type = Concat('post_',
yswp_gstic_posts.post_type)
WHERE 1 = 1
AND ( ( yswp_gstic_postmeta.meta_key = '_price'
AND Cast(yswp_gstic_postmeta.meta_value AS signed) >= '0' )
AND ( mt1.meta_key = '_price'
AND Cast(mt1.meta_value AS signed) <= '50000' ) )
AND yswp_gstic_posts.post_type = 'product'
AND (( yswp_gstic_posts.post_status = 'publish' ))
AND ( ( ( wpml_translations.language_code = 'ar' OR ( wpml_translations.language_code = 'en'
AND yswp_gstic_posts.post_type IN ( 'product' )
AND ( ( (SELECT Count(element_id)
FROM yswp_gstic_icl_translations
WHERE trid = wpml_translations.trid
AND language_code = 'ar') = 0 )
OR ( (SELECT Count(element_id)
FROM yswp_gstic_icl_translations t2
JOIN yswp_gstic_posts p
ON p.id = t2.element_id
WHERE t2.trid = wpml_translations.trid
AND t2.language_code = 'ar'
AND ( p.post_status = 'publish'
OR p.post_status = 'private'
OR (
p.post_type = 'attachment'
AND p.post_status = 'inherit' )
)) =
0
)
)
) )
AND yswp_gstic_posts.post_type IN (
'post', 'page', 'attachment', 'wp_block',
'wp_template',
'wp_template_part',
'wp_navigation'
, 'product',
'product_variation',
'wpcf7_contact_form'
) )
OR yswp_gstic_posts.post_type NOT IN (
'post', 'page', 'attachment', 'wp_block',
'wp_template',
'wp_template_part',
'wp_navigation'
, 'product',
'product_variation',
'wpcf7_contact_form' ) )
GROUP BY yswp_gstic_posts.id
ORDER BY yswp_gstic_posts.post_date DESC
LIMIT 0, 9
Hello There.
Thank you for reaching out to WPML Support.
Based on your description, I understand that the English products are being displayed on the Arabic page. From the WPML Debug Info, I can see that the translation preference for the Product post type is set to "Translatable - use translation if available or fallback to default language". This adjustment ensures that if translation is not available for a specific product, it will then fall back to the default language, which in your case seems to be English.
Before this matter is assigned to my colleague for a detailed follow-up, I would recommend a preliminary step that might address the issue. Please navigate to your WordPress dashboard and follow these steps:
- Go to WPML > Settings.
- Scroll down to the 'Post Type Translation' section.
- Locate the 'Product' post type.
- Change the translation preference for the Product post type to "Translatable
only show translated items".
Please apply this change and check if it resolves the issue. If you need further assistance, please let us know and we will be glad to help.
Best regards,
Prosenjit
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.