• Resolved Morphy99

    (@morphy99)


    It seems my invoices have started showing product weights in the invoice PDF’s. How do I revert this behaviour?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor dwpriv

    (@dwpriv)

    Hi @morphy99

    Give this code snippet a try

    /**
    * Hide weight - WPO PDF Invoices & Packing Slips
    */
    add_action( 'wpo_wcpdf_custom_styles', function( $document_type, $document ) {
    if ( $order = $document->order ) {
    ?>
    .meta .weight, .item-meta .weight {
    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 code snippets

    Thread Starter Morphy99

    (@morphy99)

    Thanks I’ve added that and it works. I don’t understand why this has only just started appearing though, obviously an update as I haven’t changed anything but was it your plugin or Woocommerce? Maybe you can remove this from the template as I don’t think anyone wants item weights on an invoice?

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @morphy99,

    Just to clarify, the PDF documents displays the weight by default, but if you were hiding it using a code snippet, you have to adapt it to the new selectors, as our “Simple” template has been enhanced recently, that is why my colleague Delano has shared a new code snippet to achieve it.

    Regarding your suggestion, I’m afraid hiding the weight by default is something we cannot do, because a lot of customers need it, specially those which sell product with a common name but with different measures (our plugin is currently working in +300?000 sites).

    However, if you are using the?customizer?included in the Premium Templates extension (part of the?bundle), please note that you would not need any code snippet, but just to uncheck the “Show weight” option, within the “Product” column:

    Thread Starter Morphy99

    (@morphy99)

    Hi Yordan. Thanks for your reply. The weight was never shown on PDF invoices until recently. I’m guessing some update has changed this behaviour. Also, to answer your point regarding ” a lot of customers needing it”, I can’t imagine why a business would require weights on an invoice? Perhaps you’re confusing this for the dispatch note? I don’t think even business’s that “sell product with a common name but with different measures” would need it as the product value wouldn’t change by changing the weight, this is set by quantity in Woocommerce.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @morphy99,

    Actually, the weight and SKU has always been displayed out-of-the-box. As I mentioned above, you may have been hiding this by a code snippet or the use of a custom PDF template, but this is not something we do by default.

    Anyway, if you still need more help with this, just let me know and I’ll do my best to help you further ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.