• Resolved cryptohjg

    (@cryptohjg)


    Hi, my invoice isn’t displaying correctly. The pdf is showing all the information, but it’s all mixed up. The header and customer info is correct, but the order info itself is all jumbled up and overlapping.

    Can anyone help

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

    (@kluver)

    Hi @cryptohjg,

    Make sure you are using the latest version (2.1.4) of the plugin. After making sure you are up to date please reinstall the fonts by going to your WordPress Dashboard > WooCommerce > PDF Invoices > Status and clicking ‘Reinstall Fonts’.

    This should solve your problem.

    With kind regards,

    Michael

    Hi,
    I have the same problem. I have the latest version and I reinstalled the fonts but still the product meta are displaying above the product table instead of behind under the product.

    After running some tests, it seems that it’s that part of the code somehow desplaying the meta:
    <?php $items = $this->get_order_items(); if( sizeof( $items ) > 0 ) : foreach( $items as $item_id => $item ) : ?>

    Thanks in advance

    • This reply was modified 6 years, 10 months ago by barbuse95.
    Plugin Contributor Ewout

    (@pomegranate)

    Hi Barbuse,
    @cryptohjg contacted us via email and told us he found that that the issue lies with the plugin WooCommerce Product Addons (by N-Media, official Woocommerce.com plugin works fine). Are you using that plugin?

    When you say meta is output by the $this->get_order_items() method, it is probably caused by an improper use of filters by a third party plugin.
    Our plugin uses the WooCommerce function wc_display_item_meta, which has an option echo, which determines whether this function should actually display the HTML, or return it instead. Because the PDF Invoice plugin collects all the data first and then displays it in the PDF, it has that echo parameter set to false. But other plugins can hook into this behavior and if they don’t respect the display parameter this can cause the issues you’re describing.
    We have also seen this issue with a plugin called “WooCommerce Personalized Product Option Manager” (also by N-Media, can’t be a coincidence…). Are you by any chance using that plugin or any other plugins that do stuff with item meta?

    Ewout

    Thanks for your reply !
    Yes, I’m using “WooCommerce Personalized Product Option Manager” but it worked just fine up until the last update I made (either of wordpress, woocommmerce, the product addon or yours). Is there any possibilites to correct that, for exemple not “echo the meta in your addon but do in the other one ?

    Plugin Contributor Ewout

    (@pomegranate)

    Hi!
    Unfortunately this is not something that I can change from our end. I see that the “WooCommerce Personalized Product Option Manager” has had a big update recently. On our end, nothing has changed with the way item meta is treated since the very first release ??

    The “WooCommerce Personalized Product Option Manager” overrides that echo parameter (or any other parameters for that matter!) and sets it to ‘true’, thus displaying instead of returning the meta:
    https://plugins.trac.www.ads-software.com/browser/woocommerce-product-addon/trunk/inc/woocommerce.php#L689

    This is a bug in that plugin that we cannot do anything about because the PDF invoice plugin needs to collect all data first before it can put it in the invoice… Luckily this is very easy to fix for the developers of that plugin, so I recommend contacting their support, you can refer them to this thread for more information.

    Ewout

    p.s. I just noticed that “WooCommerce Product Addons” and “WooCommerce Personalized Product Option Manager” are two names for the same plugin from N-Media ??

    Thanks for your help!
    I’ve contacted N-Media about this issue and here’s the answer of the author:

    Hi,

    I see, well i have added a hook/filter to change args, hooks name is

    $args = apply_filters( 'ppom_woocommerce_display_item_meta_args', $args, $item );
    We will push this change in repo soon. Please ask them it’s enough to fix issue with PDF Invoice?

    Plugin Contributor Ewout

    (@pomegranate)

    Definitely not a good fix… They should simply not override the arguments that are passed to the filter in the first place. It’s like ordering a cheeseburger and the girl at the cashier tells the kitchen to make chicken nuggets, ignoring your order: “Here are your chicken nuggets sir” :). Applying the filter is the equivalent of you needing to shout to the kitchen “NO! not chicken nuggets, I ordered a cheeseburger”.

    Kidding aside, they should remove their own args altogether because WooCommerce already sets them (when not set by the process/plugin requesting the data):
    https://github.com/woocommerce/woocommerce/blob/85d96317145315048d59a7c0f3a84b4969ef9f77/includes/wc-template-functions.php#L2547-L2553

    Hi,

    well we have removed script that changing meta args, and will push this in version 4.3 soon.

    Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Invoice not displaying correctly’ is closed to new replies.