Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › the wrong URL for the direct download of the PDF
- This topic has 15 replies, 2 voices, and was last updated 2 years, 3 months ago by
Ernest Marcinko.
-
AuthorPosts
-
February 7, 2024 at 1:54 pm #46852
medentis
ParticipantHi,
We would like to display the files uploaded via Delightful Downloads in the search.Unfortunately, the wrong URL for the direct download of the PDF file appears in the search results when I enter e.g. product catalog
This would be the correct URL to the PDF
https://medentis.com/?ddownload=3396But the following appears:
https://medentis.com/dedo_download/icx-systemuebersicht-7-1/Do I have to change anything here (Custom redirect URL) ?s={phrase}?
Best regards
StefanFebruary 7, 2024 at 2:03 pm #46853Ernest Marcinko
KeymasterHi Stefan,
I guess that is the media attachment page URL. Make sure the media page URL is set to the file directly: https://i.imgur.com/G6bGVsx.png
I suspect that plugin is hooking into the attachment URL filter, so that should return the URL set by that plugin.February 7, 2024 at 2:35 pm #46854medentis
ParticipantHallo Ernest,
I have now set it like this. Unfortunately no change.
I would also like to allow only a certain category of PDFs
Greetings
StefanFebruary 7, 2024 at 2:49 pm #46857Ernest Marcinko
KeymasterOkay!
So on the first screenshot you have the “dedo_download” post type selected. That is probably causing the issue. If the files are already in the media library, then you can deselect that option. It’s probably only a post type for storing the download metadata and it’s non-displayable.
If it’s needed, then I guess the only way to fix that is via a custom code, as it seems like the incorrect url is returned by wordpress.
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_results', function ( $results ) { foreach ( $results as &$r ) { if ( isset($r->post_type) && $r->post_type === 'dedo_download' ) { $r->link = get_site_url() . '/' . "?ddownload=$r->id"; } } return $results; }, 10, 1 );To restrict the results to specific categories please check this documentation.
February 7, 2024 at 4:16 pm #46863medentis
ParticipantHi Ernest,
Thank you. It worked like this. I’ll take care of the categories tomorrow.Best, Stefan
February 8, 2024 at 8:42 am #46864Ernest Marcinko
KeymasterGreat!
February 8, 2024 at 8:53 am #46865medentis
ParticipantHello,
how can I achieve that in the search display (other results) does not appear.
I have already excluded all other categories.I would also like to change all displays to German.
Best regards,
Stefan
February 8, 2024 at 10:15 am #46867medentis
ParticipantI have now found out for myself
February 9, 2024 at 10:57 am #46874Ernest Marcinko
KeymasterOkay!
February 9, 2024 at 12:51 pm #46876medentis
ParticipantHello again,
Unfortunately, files are also displayed that do not have the name. Here. e.g. Produktkatalog. Other files appear here that should not appear at all.
How can I adjust this?
Best regards
StefanFebruary 9, 2024 at 2:15 pm #46878medentis
ParticipantHello,
I have now renamed the category from product catalog to PDF files. Now it works. Apparently the search also included the category name.
Where can I translate ‘no resuls for’ please?
February 9, 2024 at 2:31 pm #46879Ernest Marcinko
KeymasterYes, that explains it.
You can do the translation here: https://i.imgur.com/8mt3H68.png
February 9, 2024 at 2:33 pm #46880medentis
ParticipantThank you!!
Can you speed up the search a little?
The loading process takes quite a long time.
February 9, 2024 at 2:49 pm #46881Ernest Marcinko
KeymasterSurely, I recommend the tips from this documentaiton: https://documentation.ajaxsearchpro.com/performance-tuning/fine-tuning-the-search-configuration
Generally the search performance correlates with the overall back-end server performance if configured correclty. I strongly recommend the index table engine from that list, it can make a huge difference.
February 9, 2024 at 5:11 pm #46882medentis
ParticipantAre there any more beautiful designs than the default ones?
-
AuthorPosts
- You must be logged in to reply to this topic.