Home Forums Platforms WP e-Commerce Plugin Ideas Add PDF support to Printable Invoices

Welcome to our community support forums! We're here to help - but if you have an urgent request for a Pro Plugin, you will get a prioritised response through our Premium Support page.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #7036
    Michael Visser
    Keymaster

    Currently you have to print the invoice using CutePDF, add a built-in PDF generator for this Plugin.

    #8464
    Michael Visser
    Keymaster

    Should be added to the Purchase Receipt and Admin Report at purchase time. Could also be saved to the server and available within My Account.

    #8543
    enzo
    Participant

    just saw this, perhaps you could adapt another plugin i’m making use of? : http://www.techna2.com/blog/documentation/wp-post-to-pdf/

    ^ works great for WPEC product pages. i had to make some tweaks to get it to work…

    in wp-post-to-pdf.php after the line:

    // Process shortcodes if selected
    if ($this->options['processShortcodes'])
    $post->post_content = do_shortcode($post->post_content);

    i added:

    // Strip HTML formatting (i.e. post-text = strip_tags(post-text, 'exceptions') )
    // http://www.php.net/manual/en/function.strip-tags.php
    $post->post_content = strip_tags($post->post_content, '');

    // Get post image (http://wordpress.org/extend/plugins/wp-get-post-image/)
    if (function_exists('wp_get_post_image'))
    $image = wp_get_post_image('width=500&parent_id='.$post->ID);

    … and further down, i updated the output to:

    // Set some content to print
    $html = " . html_entity_decode($post->post_title, ENT_QUOTES) . ";
    $html = html_entity_decode($image, ENT_QUOTES);
    $html .= html_entity_decode($post->post_content, ENT_QUOTES);

    the result is a clean pdf with the main post image above it.

    then i edited the generate_pdf_file() function to include the wpsc-product page type:

    if ('post' != $post->post_type and 'page' != $post->post_type and 'wpsc-product' != $post->post_type)

    … using icon position = ‘manual’ setting under options, simply included the code in the single product page template.

    #8574
    Michael Visser
    Keymaster

    Hi envo, very nice. I’ll have a play with that tomorrow. Seems simple enough. 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Plugin Ideas’ is closed to new topics and replies.