Viewing 6 replies - 1 through 6 (of 6 total)
  • This feature is not part of the shop styling plugin.
    But you I can give you a few hints:

    The files are located in a directory that is not accessible because of a htaccess file.
    You could create a PHP file in your theme directory to read an invoice from this directory and send it to the browser.

    <?php
    header('Content-disposition: attachment; filename=invoice.pdf);
    header('Content-type: application/pdf');
    readfile(HAET_INVOICE_PATH.invoice.pdf);
    ?>

    This file could use the purchaseid as a parameter to get the filename.

    BUT you need to check the owner of the invoice before sending the output to the user.

    Thread Starter devlopez

    (@templaries)

    But how can I generate that invoice file?

    You can’t generate invoices for orders sent before the shop styling plugin was installed, because the invoice needs data from the shopping cart.

    Thread Starter devlopez

    (@templaries)

    I am late for the answer, sorry.

    Yes, I know that, the order is sent and the wp_wpsc_purchase_logs table has got a row for the order.

    Now I want to generate the invoice programatically, using a php function I suppose, giving the purchase_id or similar value.

    I want to get a button in the private user area to generate the invoice giving the purchase log id.

    I understand what you want to do but unfortunately the shop styling plugin relies on some computations, that are only available in the cart and will be deleted after checkout.
    I think your idea is possible, but there is currently no plugin available to do this. If you need help I can have a look at your store and give you a quote for the changes. My email address is here: https://etzelstorfer.com/kontakt/

    Thread Starter devlopez

    (@templaries)

    Do you think that the cart contents is deleted after checkout?

    In the dashboard when you go to (wp-admin/index.php?page=wpsc-purchase-logs), you see the sales, and when you click on one sale, then, inside, you can always see packing slip.

    You can do this:

    wp-admin/index.php?page=wpsc-purchase-logs&c=packing_slip&id=[PURCHASE_ID]

    But the output format is html, not pdf.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How can I generate an invoice using the purchaseid?’ is closed to new replies.