Support » Plugin: WooCommerce PDF Invoices & Packing Slips » Possible to not show weight on invoice and packing slips

  • Resolved Tom van M

    (@tom-van-m)


    Hello team,

    Great plugin!
    Is it possible to hide the weight and length on the invoices and packing slips?
    We used some css to hide the SKU and that works great.

    Best reagards,
    Tom

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Ewout

    (@pomegranate)

    Hi! Length is normally not included on the invoices, unless this is part of the product title (in which case it’s not a simple CSS change).
    weight can be easily hidden with custom CSS though, just like SKU:

    
    .weight, .sku { display: none; }
    

    Hope that helps!

    Hello Ewout,

    When I use the css (also with !important) it doesn’t work.
    I already found a snippet for hidding SKU. How can I make this work for weight as well?

    add_action( 'wpo_wcpdf_custom_styles', 'wpo_wcpdf_custom_styles' );
    function wpo_wcpdf_custom_styles () {
    	?>
    	dt.sku, 
    	dd.sku{
    		display:none;
    	}
    	<?php
    }
    Plugin Author Ewout

    (@pomegranate)

    That’s strange. As you can see here in the template the weight is printed with the .weight class the same way the .sku class is used for the sku:
    https://github.com/wpovernight/woocommerce-pdf-invoices-packing-slips/blob/v2.2.6/templates/Simple/invoice.php#L103-L104

    Since you also mentioned lenght, I’m suspecting this may be item meta rather than product weight. Could you post a screenshot of the order items in your shop backend and the resulting PDF?

    Hello Ewout,

    Here are the screenshots

    https://imgur.com/a/NLKDCXh

    https://imgur.com/a/noNKyCs

    Thanks in advance!

    Bet regards,
    Tom

    Tom van M

    (@tom-van-m)

    Hello @pomegranate,

    Waiting is ok, ban you tell me if you think this can be solved eventually?

    Best regards,
    Tom

    Plugin Author Ewout

    (@pomegranate)

    I’m not sure what’s wrong in your template or code, but this is the regular weight item, which outputs like this in the template (HTML):

    
    <dl class="meta">
       <dt class="sku">SKU:</dt><dd class="sku">12345</dd>
       <dt class="weight">Weight:</dt><dd class="weight">0.400kg</dd>
    </dl>
    

    If I apply my previously suggested CSS:

    
    add_action( 'wpo_wcpdf_custom_styles', 'wpo_wcpdf_custom_styles' );
    function wpo_wcpdf_custom_styles () {
    	?>
    	.weight, .sku { display: none; }
    	<?php
    }
    

    Both the weight and SKU are hidden in my end result. If that doesn’t work in your template the only thing I can think of is:

    • You have applied other styles that override the above, adding !important would then resolve this
    • Your template has a different structure. Enabling HTML output (status tab) should help to determine the classes to use

    Other than that I have no idea, in a vanilla install with this plugin and WooCommerce the above CSS works fine for me…

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Possible to not show weight on invoice and packing slips’ is closed to new replies.