WooCommerce: Hide Weight & Dimensions From Additional Information Tab @ Single Product

If a WooCommerce product comes with weight and/or height / length / width values, these will be displayed by default in the Single Product page, under the “Additional Information” tab.

Should you need to hide them completely from the frontend while keeping the list of attributes below them, thankfully there’s a PHP one-liner you can use. Enjoy!

Continue reading WooCommerce: Hide Weight & Dimensions From Additional Information Tab @ Single Product

WooCommerce: Find Products With No Weight @ WP Admin

If your shipping rates depend on product weight, it is very likely you’ve forgotten to add weight to ALL your products. In this way, some shipping rates may be underestimated on the WooCommerce Checkout page.

So, here’s how to print a notice on the WordPress Dashboard > Products screen with a list of products that have no weight, together with the links to edit them quickly.

This is a handy snippet you can reuse for other case scenarios such as easily finding products with no dimensions, no prices, no images, no custom field value, or even a specific weight or given price. Enjoy!

Continue reading WooCommerce: Find Products With No Weight @ WP Admin

WooCommerce: Save & Display Order Total Weight

For tracking purposes, or maybe because your shop manager needs to be aware of this, saving the total weight of each order and displaying it on the single order admin page is quite simple.

That’s right – WooCommerce does not save this value by default. You either need to save it yourself into the “order meta” or recalculate the weight based on the order items and their quantities. Here, we’ll cover option one (saving is better than calculating in regard to performance).

Enjoy 🙂

Continue reading WooCommerce: Save & Display Order Total Weight

WooCommerce: Display Total Weight @ Cart & Checkout

Following up from the other day’s snippet (deny checkout based on cart weight), you might want to show what is the current Total Weight on the cart and checkout page in case this is useful to your customers.

Of course, in order for this snippet to work, all your products must have a weight, otherwise the total will always be equal to 0. So here you go – enjoy!

Continue reading WooCommerce: Display Total Weight @ Cart & Checkout

WooCommerce: Deny Checkout Based on Cart Weight

A WooCommerce fan asked me: “How do you deny checkout if the cart weight is above a certain threshold?“.

Well, this is straight forward thanks to a WooCommerce core function called “cart_contents_weight” which allows you to get the total weight of your cart, and then the “wc_add_notice” function which shows a notification error.

Enjoy!

Continue reading WooCommerce: Deny Checkout Based on Cart Weight