This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

the wrong URL for the direct download of the PDF

Home Forums Product Support Forums Ajax Search Pro for WordPress Support the wrong URL for the direct download of the PDF

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #46852
    medentismedentis
    Participant

    Hi,
    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=3396

    But 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
    Stefan

    #46853
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi 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.

    #46854
    medentismedentis
    Participant

    Hallo Ernest,

    I have now set it like this. Unfortunately no change.

    I would also like to allow only a certain category of PDFs

    Greetings
    Stefan

    #46857
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Okay!

    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.

    #46863
    medentismedentis
    Participant

    Hi Ernest,
    Thank you. It worked like this. I’ll take care of the categories tomorrow.

    Best, Stefan

    #46864
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Great!

    #46865
    medentismedentis
    Participant

    Hello,

    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

    #46867
    medentismedentis
    Participant

    I have now found out for myself

    #46874
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Okay!

    #46876
    medentismedentis
    Participant

    Hello 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
    Stefan

    #46878
    medentismedentis
    Participant

    Hello,

    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?

    #46879
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Yes, that explains it.

    You can do the translation here: https://i.imgur.com/8mt3H68.png

    #46880
    medentismedentis
    Participant

    Thank you!!

    Can you speed up the search a little?

    The loading process takes quite a long time.

    #46881
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Surely, 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.

    #46882
    medentismedentis
    Participant

    Are there any more beautiful designs than the default ones?

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.