Setting A Default Product Weight and Dimensions To Ship Your Products using WooCommerce Shipping Plugins

This guide will help you set the default weight and dimensions for your products when using a WooCommerce Shipping Plugin. We will take the example of WooCommerce UPS Shipping plugin to help you understand the process better.

Most of the times WooCommerce store owners do not provide weight and dimensions to their products. Or in some cases, the products that they sell have lesser weight so the store owners choose not to provide product weight and dimensions.

However, this creates problems when it comes to shipping these products. Since almost every shipping carrier requires weight to calculate shipping rates, it is very important to provide shipping rates to the products.

How To Set Default Product Weight & Dimensions

Consider the product shown in the image below. The product is not having any weight as well as dimensions set up on the product page.

Product Page

Now, if this product is added to the cart, the following message is shown on the cart page.

Missing Weight Error

To set up default product weight and dimensions, all you need to do is use the code in this link. Copy this code and paste it into the functions.php file. You can access this file by clicking,

Appearance > Editor > Functions.php

After doing so, provide your desired weight and dimensions for your products that you want to be applied by default. All you need to change the value in the following code to enter the length, width, height, and weight, respectively.

$default_length = 13;
$default_width = 13;
$default_height = 13;
$default_weight = 13;

After providing the default values, just save the changes and there you go. Now all your products will have the default weight and dimensions that you have provided using the code. As for our product, once adding the code we  changed the default weight and dimensions to,

Weight – 1 lbs
Length – 2 in
Width – 3 in
Height – 2 in

And the result being shipping rates were displayed for the product. You can see the weight and dimensions of the products on the cart page by enabling the debug mode. The image below shows the shipping rates on the cart page for the product with no weight and dimensions.

Shipping Rates

Plugins Supporting This Functionality

If you have any query regarding this article or have any difficulty in implementing the shipping scenario, please let us know in the comment section below. You can also contact our customer support. Our support team will surely help you resolve your issues.

Last Updated On May 14, 2019