• Hello guys,
    Is this possible to generate invoices with custom prices? I mean, I need sometimes to generate invoices for the clients that have their packages at their country customs. And I don’t want them to pay big fees so usually we declare 20% of the real cost of goods.
    Thanks for reading, I’m looking forward to reading you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor kluver

    (@kluver)

    Hi @kenteush29,

    Our PDF Invoices plugin takes the data from the underlying WooCommerce order to create the invoice. But if I understand correctly you don’t want to change the order itself?

    You can filter the products and totals on your PDF with the following two filters:

    Product table:

    add_filter( 'wpo_wcpdf_order_items_data', 'wpo_wcpdf_order_items_data', 10, 3 );
    function wpo_wcpdf_order_items_data ( $items, $order, $template_type ) {
        //Your logic goes here...
    }

    Totals table:

    add_filter( 'wpo_wcpdf_woocommerce_totals', 'wpo_wcpdf_woocommerce_totals' , 10, 3 );
    function wpo_wcpdf_woocommerce_totals( $totals, $order, $template_type ) {
        //Your logic goes here...
    }

    These code snippets should be added to the functions.php of your child theme or via a plugin like Code Snippets. If you have never worked with code snippets or functions.php before please read this: How to use filters

    Thread Starter kenteush29

    (@kenteush29)

    I don’t really understand what to do whit these snippet. Of course I know the plugin code snippet and I use it, but is this possible to give me a code that can create pdf invoices with prices decreased by 80%? Or in other words, to declare on invoices only 20% of the products value?

    Plugin Contributor alexmigf

    (@alexmigf)

    Hi @kenteush29

    Wouldn’t be better to apply that discount on the order itself? Then it will be reflected in the PDF too.

    What you are requiring to do in the PDF is not straightforward, will require custom code and that’s not part of the free plugin support.

    Thread Starter kenteush29

    (@kenteush29)

    Impossible. The client paid an amount, and the idea here is to create an invoice with only 20% of the prices (product prices and total price).
    It’s not possible to complete your custom code for doing that?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Price changing’ is closed to new replies.