• Resolved swissdrago

    (@swissdrago)


    Hello, thanks for this fantastic plugin!

    Please can you help us with one issue? In our store, the customer can choose the currency (we use CURCY for this).

    But on the PDF invoice, the values for all our currencies are printed instead of only the values based on the order currency.

    I reckon this is because in the database, for each order and order item, the values are converted and stored in all our currencies.

    A possible solution could be that PDF invoices would just pick the first string (which is the value in order currency) instead of the full field content – but I’m no technical person and do not know what I’m talking about ??

    Please could you have a look into the screenshot here: https://prnt.sc/gKgud-ddv_YV

    Thank you so much!

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @swissdrago,

    This is indeed something weird. Could you please check and tell me which template do you have selected on WooCommerce > PDF Invoices > General > Choose a template?

    Thread Starter swissdrago

    (@swissdrago)

    Hi Yordan, thanks for your answer. The template used is “Simple”.

    Does this already help to figure out what the issue could be?

    Thanks, many regards

    Wolfgang

    P.S. would a staging site make troubleshooting significantly easier for you?

    • This reply was modified 6 months, 2 weeks ago by swissdrago. Reason: Idea :-)
    Plugin Contributor dwpriv

    (@dwpriv)

    We will try to troubleshoot on the forums first before we use your staging site.

    What plugin are you using for the currency conversions? Does the issue persist when you temporarily deactivate that plugin?

    Thread Starter swissdrago

    (@swissdrago)

    As I wrote in my initial message, we use CURCY for multiple currencies.

    No, of course the issue is not without CURCY, because without the plugin, there are no multiple currencies to display on the invoice.

    Thread Starter swissdrago

    (@swissdrago)

    Sorry to ask again, but this issue really really hurts. Please can you help? Thanks a lot.

    Plugin Contributor dwpriv

    (@dwpriv)

    @swissdrago apologies for the delayed response

    As for the issue, the plugin seems to be adding the extra fields to the totals data. Could you use this guide to check how the data is saved to the order totals while the plugin is active, please?

    Thread Starter swissdrago

    (@swissdrago)

    Hello @dwpriv thanks for your reply.

    I prepared a new example for you, please see the two PDF files for the invoice and the order data (with the meta information about the fields).

    https://lonesome-dragon.com/download/invoice-15763.pdf

    https://lonesome-dragon.com/download/order_data_including_meta.pdf

    Many thanks for your help!

    Plugin Contributor dwpriv

    (@dwpriv)

    thanks for the PDF. Do you see a section below for “Order items meta”? Could you send the data there as well, please?

    Thread Starter swissdrago

    (@swissdrago)

    Hello @dwpriv , yes sure, here comes the items meta (sorry if this was missing before): https://lonesome-dragon.com/download/order_items_meta.jpg

    Plugin Contributor dwpriv

    (@dwpriv)

    Thanks for the images. It seems there are some CSS issues that are allowing the prices to be printed. Could you use this guide to output the PDF to HTML, then right click and download the page to share with us, please?

    Thread Starter swissdrago

    (@swissdrago)

    Hello @dwpriv yes sure, I just generated the PDF invoice as html document and inspected it.

    The “correct” string (USD and amount) is in a div with the class “woocommerce-Price-amount amount” while all the rest that should not be displayed is in another div with with the class “”woocommerce-Price-amount”.

    Here are the screenshot of the inspection and the html invoice:

    https://lonesome-dragon.com/download/pdf-invoice-screenshot-css.jpg
    https://lonesome-dragon.com/download/pdf-invoice.html

    Thanks again!


    Plugin Contributor dwpriv

    (@dwpriv)

    Thanks for that. It seems the plugin is appending the full list of it’s available conversions to the price. Try adding this code snippet to hide the additions

    //hide Curcy currency spans
    
    add_action( 'wpo_wcpdf_custom_styles', function( $document_type, $document ) {
    	if ( $order = $document->order ) {
    		?> 
    			td.price .wmc-wc-price > span:nth-child(1) > span:nth-child(2) {
    				display: none;
    			}
    		<?php
    	}
    }, 10 , 2 );


    If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters

    Thread Starter swissdrago

    (@swissdrago)

    Hi @dwpriv , thanks for the snippet. Unfortunately no change in the behavior ??

    Would it help to give you access to the staging site with the example?

    Plugin Contributor dwpriv

    (@dwpriv)

    We can try that. However, send us an email at [email protected]. We will give some instructions to do this safely.

    Thread Starter swissdrago

    (@swissdrago)

    Hi @dwpriv – the mail is sent, thanks

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Multiple currencies in shop – values in ALL currencies printed on invoice’ is closed to new replies.