Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi!
    The PDF does not support shortcodes, so I’m afraid I cannot help with that ??

    Yes you can add a page break.

    to get text content from a URL (I wouldn’t recommend this for security reasons), you can use file_get_contents. That is, if your host allows this – lots of hosts block connections like this.

    <?php
    $text = file_get_contents('https://yoursite.com/sample.txt');
    echo $text;
    ?>

    Note that if the URL is not a txt file but HTML, this may have unexpected results…

    Hope that helps!
    Ewout

    Thread Starter anagam2016

    (@anagam2016)

    Hi!

    Thanks a lot for response and for solutions.

    Now realize about risks of using file_get_contents.

    Instead of using file_get_contents, can we directly insert formatted html text into the template itself? Will this create any error?
    If no could you please show me how to do this?

    Thanks

    Plugin Contributor Ewout

    (@pomegranate)

    Hi! Yes, you can just use plain text and HTML anywhere in the template.
    There are two approaches:
    1) With a template action hook (placing a code snippet in your theme functions), this will keep the main template always up to date, while still adding the extra data
    2) In a custom template, which you may already have created for the page break. This gives you the most control, but the templates doesn’t get auto updates anymore (the plugin will, of course).

    Hope that helps!
    Ewout

    Thread Starter anagam2016

    (@anagam2016)

    Thanks a lot!
    Will use custom template to add html text.

    One more question. Is it possible to have the name of invoice.pdf file in different encoding for eg cyrillic?
    Followed the instructions at Custom PDF filenames

    But instead of getting file name as фактура.pdf, I am getting Factura.pdf

    Thanks!

    Plugin Contributor Ewout

    (@pomegranate)

    I’m not sure about that. WordPress sanatizes the filename to avoid illegal characters (that could cause issues on some systems). Can you share your complete filter code?

    Thread Starter anagam2016

    (@anagam2016)

    Here is the code i copied from Custom PDF filenames

    `/** PDF Invoice File name – Replace ‘invoice’ with ‘Фактура’ */

    add_filter( ‘wpo_wcpdf_filename’, ‘wpo_wcpdf_custom_filename’, 10, 4 );
    function wpo_wcpdf_custom_filename( $filename, $template_type, $order_ids, $context ) {
    $invoice_string = _n( ‘invoice’, ‘invoices’, count($order_ids), ‘wpo_wcpdf’ );
    $new_prefix = _n( ‘Фактура’, ‘Фактури’, count($order_ids), ‘wpo_wcpdf’ );
    $new_filename = str_replace($invoice_string, $new_prefix, $filename);

    return $new_filename;
    }

    Plugin Contributor Ewout

    (@pomegranate)

    Hi! I am not sure why it’s doing that for you. I just tried the exact code you posted and it worked for me, the filename was Фактура-1061.pdf in my case.
    It’s possible that your site runs a plugin or special code to prevent this (like Filenames to latin, but I can’t tell from here.)

    Ewout

    Thread Starter anagam2016

    (@anagam2016)

    Hi,

    Thanks a lot for your support with all the queries.
    Yes indeed i am using plugin called rus-to-lat.
    Will explore the plugin settings.

    Regards

    Plugin Contributor Ewout

    (@pomegranate)

    Ah yes, that would explain. Good luck!

    Ewout

    Hi!

    How do I insert duplicate content in the footer, as order number and date?

    Thanks!

    Plugin Contributor Ewout

    (@pomegranate)

    Hii! I answered your question in your own thread: https://www.ads-software.com/support/topic/edit-footer-23/

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Order total in words and adding content from custom url’ is closed to new replies.