• Resolved drix93

    (@drix93)


    Hey I’m in the process of using WPML to translate an English based website to French and at the moment I have DK PDF installed to generate PDF copies of some products I have on the website. Currently the product post type is actually a custom post type.

    My issue is that after translation of the website to French and switching to the French language, clicking on the button to get the PDF doesn’t work where it just refreshes the page and doesn’t make a PDF at all. Keep in mind it does work for the English version of the website as it have before though. Also when the website is changed to the French version, this is added to the end of the url to tell it’s on the French version: “/?lang=fr”.

    Any help to get this resolved would be great. Don’t wanna change plugin because of this if it can be fixed.

Viewing 1 replies (of 1 total)
  • Thread Starter drix93

    (@drix93)

    I found a fix already, fairly simple and sad to be honest.

    In the URL where WPML adds – “?lang=fr” for example:
    https://wordpress.org/support/topic/dk-pdf-and-wpml/?lang=fr

    The DK-PDF plugin will also put its own addition to the URL like this:
    https://wordpress.org/support/topic/dk-pdf-and-wpml/?lang=fr?pdf=2844

    To fix the issue I had, I just needed to change the “?” to an “&” and it was fine after that. So the new URL would be:
    https://wordpress.org/support/topic/dk-pdf-and-wpml/?lang=fr&pdf=2844

    It’s hard for me to tell you where you’d find the file since am using a custom-made plugin but the code was located on the single-product page within a button:
    <a class="product-button" href="' . get_permalink() . '?pdf' . $post->ID . '" target="_blank"><span class="button-inside">Create Spec Sheet<i class="fa fa-file-pdf-o"></i></span></a>

    I added an IF statement which would change the “?” to “&” if the site was in the French version.

    • This reply was modified 8 years ago by drix93.
    • This reply was modified 8 years ago by drix93.
    • This reply was modified 8 years ago by drix93.
    • This reply was modified 8 years ago by drix93.
Viewing 1 replies (of 1 total)

The topic ‘DK PDF and WPML’ is closed to new replies.