Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › WPML and Products are not displaying
This topic contains 23 replies, has 2 voices, and was last updated by vantinh 1 month, 1 week ago.
- AuthorPosts
- September 21, 2023 at 4:22 pm #45483
HI
My website has just 2 languages as English and German.We have two big product category (Woo) : Product and Campus
on German: we translated one category with name Produkt.Then I created 2 shortcodes , one for EN and other for DE and I am having the config with following information:
– Index table about 160.000 rows in the database
– Search source: Indextable
– Grouping in Category / Term
– Group priorities
– English shortcode : I have checked WPML option
– German; I have to get all posts from different languages as well as turn off WPML. Then I have to exclude the categories of English.– On Engish : your plugin is working well. I see the products of Product and Campus
– On German : your plugin does not show the products in category “Produkt”. I see only the products of Campus. I think it is wrong somewhere.. I am finding in a long time but not found any thing. When I changed search source back to Regular energin it is just 5 posts to be shown.Question:
1. Do you know how could be wrong ?
2. We are going to create more languages as well as italy, portugar.
must we create more shortcode for each languages and exclude categories. Then that will be a lot of categories to exclude because we will translate all categories.
3. Button more at the bottom of result html does not appears. This is so strange.Thanks
Attachments:
You must be logged in to view attached files.September 22, 2023 at 1:05 pm #45489Hi,
Thank you very much for the details, it helps greatly!
My guess is that category ID conflicts might be happening here. I think the best course of action would be to make another search bar, and use the first on the english and the second on the german version.
On the back-end, you can switch languages – so you can configure each search bar in the current language, that should avoid any conflicts. Then use each on the corresponding language.Let me know if that changes anything!
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
September 22, 2023 at 1:30 pm #45491Yes,
I have removed 2 old shortcode and recreated new shortcode . It was a bit time but working :)). Thanks
other question: In German I have to exclude 10 categories including parent and children categories.
In the next week we are going to have more languages : how can we exclude categories which are from other languages. That I can handle manually but I think that would not be a smart solution for that.
what it about your idea ?
However I found that : Search with Indextable does not show the more button at the end of result container. Therefore I have to switch to normal search behavior as regular.
Thanks
September 25, 2023 at 9:40 am #45498If the WPML compatibility is enalbed the plugin will always show only the results within the current language – so in that case you don’t need to exclude anything at all.
Best,
If the translations for the desired content will exists for that language, then it should work without exclusions.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
September 25, 2023 at 10:17 am #45504– But our product in the category parent “CAMPUS” that is existing only on English, we can not translate that on other languages because the information is belonging to the sector science.
– In WPML Plugin it has a config that the post can be : not translated, optional display translation if exist , or translated.
We selected the option “OPTIONAL”.– Other hand, I test the search element of AVADA PAGE BUILDER and this element has been working with all languages without config wpml.
On English : This element returns me all products of english, all posts of english
On German : The search of AVADA returns me all products of German, and the optional posts of English (with url . domain/de/product) that works automatically.But with your plugin: I have to create a shortcode on DE. Then, I have to exclude so many categories from EN. If I do not set up so, I will see double posts of English and German.
Do you have other idea in this case because in the future we will have more categories and change categories then we have to change your configs in the backend. It will be difficult for the non tech people to understand.
Thanks
thanks
September 25, 2023 at 10:40 am #45509Also,
We want like so:English :
Search : Cerabone
Return :
Products EN
Posts on EN with EN URL
User: show user if foundGerman :
Search : Cerabone
Return :
Products on DE (Because we already translated this products)
Posts of English with DE URL like botiss.com/de/product/abcd-def (because we can not translated these posts in this categories )
User: show user if foundSpanish :
Search : Cerabone
Return :
Products on Spanish (Because we already translated this products)
Posts of English with ES URL like botiss.com/es/product/abcd-def (because we can not translated these posts in this categories )
User: show user if foundI hope you understand our wish
many thanks
September 26, 2023 at 1:12 pm #45523Okay – so it is the missing translations causing the issue here.
It is sort of hard coded to the query, but I could potentially suggest a modification to exclude these translations from the query, and maybe add a hook point to a future release to avoid that.
Can you provide temporary FTP access?
If not then please follow these steps:
– Open up the\wp-content\plugins\ajax-search-pro\includes\classes\Search\SearchPostTypes.php
file on the server
– Find the line (around 277):
if ($site_lang_selected) {
– Change it to:
if ($args['_wpml_allow_missing_translations'] && $site_lang_selected) {
– Save the fileDo the same steps for:
–\wp-content\plugins\ajax-search-pro\includes\classes\Search\SearchIndex.php
file on the server
– Find the line (around 168):
if ($site_lang_selected) {
– Change it to:
if ($args['_wpml_allow_missing_translations'] && $site_lang_selected) {
– Save the fileAfter the change, a custom code is required to exclicitly set the allowance. Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.
add_filter( 'asp_query_args', 'asp_query_args_change', 10, 1 ); function asp_query_args_change( $args ) { $args['_wpml_allow_missing_translations'] = false; return $args; }
This will prevent missing translations from each language as well as will retain in any future versions as if this works, then I will append it to the next upcoming version.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 4, 2023 at 12:00 pm #45615Hi,
it is unfortunately that your plugin returned the posts with /en/ for url.
It could be better that :
On En: This is working well without problem
On DE: It would be nice that the missing translation will appear and with /de/ url. This is because, I want to keep users still on language , which he or she already selected to read our post. It should not mix url German and English.On Spanish: with urls /en/
So I think it should be working with the option wpml , when users enable WPML. Then users must not config a lot of for excluding categories.
should I install a test website with some products on different languages by using wpml ? then you can change code there ? what do you think ?
October 5, 2023 at 9:26 am #45620Yes please – that would be very nice. Let me know if you setup and I will test.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 18, 2023 at 3:14 pm #45750You cannot access this content.October 23, 2023 at 2:26 pm #45788Hi,
could you help us ? Because we are going to have more languages and I have to exclude a lot of categories on DE and ES
Each language hat 2 shortcodes for ajax search form.
This is very confusing for our employees.
HELP !!!
October 23, 2023 at 5:41 pm #45791Do not worry, I have not forgotten you – I had to skip work today for personal reasons (and also the weekend, I usually work as well), I could only answer tickets where no debugging was required.
I am very sorry about that, I should have let you know. I am back at the office tomorrow morning, your case is the first on the list. Thank you for your patience.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 24, 2023 at 2:23 pm #45797Can you please add temporary FTP details as well?
I may have a solution, but I can’t test it, as the file editing was not successful via back-end and it is no longer accessibe because of that. Via FTP I can edit files more safely. Thank you!
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 24, 2023 at 2:56 pm #45798It is unfortunately impossible in this hosting which I can create only one FTP for whole company. The boss does not allowed me to give you this FTP.
My solution: Let me move this website to other hosting provider in the morning tomorrow . I will write here when I finish the configuration .
October 24, 2023 at 2:57 pm #45799Okay let me know 🙂
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.