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

This topic contains 15 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 2 weeks, 4 days ago.

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #46852
    medentis
    medentis
    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 Marcinko
    Ernest 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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #46854
    medentis
    medentis
    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

    Attachments:
    You must be logged in to view attached files.
    #46857
    Ernest Marcinko
    Ernest 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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #46863
    medentis
    medentis
    Participant

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

    Best, Stefan

    #46864
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Great!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #46865
    medentis
    medentis
    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

    Attachments:
    You must be logged in to view attached files.
    #46867
    medentis
    medentis
    Participant

    I have now found out for myself

    #46874
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Okay!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #46876
    medentis
    medentis
    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

    Attachments:
    You must be logged in to view attached files.
    #46878
    medentis
    medentis
    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 Marcinko
    Ernest Marcinko
    Keymaster

    Yes, that explains it.

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

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #46880
    medentis
    medentis
    Participant

    Thank you!!

    Can you speed up the search a little?

    The loading process takes quite a long time.

    #46881
    Ernest Marcinko
    Ernest 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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #46882
    medentis
    medentis
    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.