to ensure your profits with It is important to provide your customers with the right transportation services. If you enable you to transport based on weight, product type and size, not only provide unified freight , but also more conducive to your business success. This is why we bring you about how to add weight -based transportation guidelines to Woocommerce. But first of all, let’s see what is based on weight -based transportation, and how it helps it for your business.
What is weight -based transportation?
By default, Woocommerce mainly allows you to manage transportation and set different transportation options according to regional management, such as a certain price, free delivery and local pickup. Of course, you can add different rates to different areas, but these freight
does not consider the weight of customer orders
. Moreover, when you consider a large and weight, the transportation price will increase a lot, so the good business of any processing weight and quantity differences should be considered to enable more flexible transportation options.
This is the place where weight -based transportation played. Therefore, you should provide different transportation options and prices according to the weight of the customer’s order.
Why add weight -based transportation to Woocommerce?
Setting delivery and transportation services for your product may be very troublesome, especially when you have various products with different sizes and weights. Tax, freight, and additional costs become very difficult to manage. If you ignore these, you may be lost
. This becomes more difficult when you include national transportation. Therefore, if you have many factors that affect your transportation, you may want to use weight -based transportation. Using weight -based transportation, you can specify different transportation costs for different weight -level items. You can then ensure that the items with lighter weight have lower transportation costs and the fair cost of transporting heavier items.
Of course, weight -based transportation involves more variables, such as quantity, quality of total products, destinations, etc. If customers buy products in batches, you also need to allow more flexible transportation prices.
This is why you brought you about
How to add weight -based transportation guidelines to Woocommerce.
First, let’s see how to add weight -based transportation in a way that is more suitable for beginners. How to add weight -based transportation to Woocommerce?
Our article introduced today’s two different ways
Add weight -based transportation: Use plug -in
- Let’s introduce the use of plug -ins.
- But before we start, make sure you have set woocommerce instead of missing any main steps. It is best to use one of the themes compatible with Woocommerce for your website. This will help you avoid any possible theme or plug -in conflict in this process.
1. Use a plug -in to add weight -based transportation in WooCommerce
The easiest way to add weight -based transportation based on weight to use
dedicated WordPress plug -in.
These plugins are easy to set, which allows you to handle different weights and destination rules. They can even achieve more flexible transportation prices.
For our demonstration, we will use Woocommerce Weight Based Shipping plug -in. This is a very easy -to -use plug -in, with the exact function of weight -based transportation. With this plug -in, customers can easily calculate the order of order weight.
1.1. Install and activate the plug -in
Like any plug -in, you must install and activate it before using it. Continue and open the
dashboard
and click
plugins \u0026 gt; add New
to install the plug -in.
Then, use the search bar in the upper right corner to search
WooCommerce Weight Based Shipping
. Click
on the plug -in tab to install
immediately, and then activate
after the button switch. If you wantUnlock more additional functions, you can also use the high -end version of the plug -in. But to activate it, you must manually upload the plug -in and install it. Check our guidelines and understand how to manually install WordPress plug -in to get more information.
1.2. Use the plug -in setting to set the weight -based transportation rules After activating the plug -in, use woocommerce \u0026 gt; settings on the WordPress dashboard to open your Woocommerce transport settings. Then, open the transport
tab and click the
weight transportation.
You Now you can start adding your custom transportation rules. Let us start with clicking Add Shipping Rules .
Next, click Add new , you will be taken to the \”
rules settings\”
window.
First, let us first add labels and title for your weight transportation . You can then choose whether to tax the freight.
Next, let’s set Weight transportation
Condition
.
1.3. For heavy weight transportation setting conditions
Use destination options to select whether you want to apply weight -based transportation to all transport destination or [123 123 ] Specific country/region.
The next few fields are very important for setting weight -based transportation. Use order weight option, you can set restrictions on your condition. For example, we set this field to be greater than or equal to 1 kg and less than 10 kg. This means that our current weight -based freight is only suitable for the total weight of the shopping cart between 1 to 10 kg.
Next, you can also use Order Trip
to check the total price of the shopping cart. In this way, you can ensure that this weight -based transportation -based transportation is only applicable to specificThe total number of shopping carts is limited. If you do not want to check your shopping cart based on weight -based transportation conditions, you can keep this field.
The cost part allows you to define the basic costs of current weight -based transportation rules. First, continue to set your basic costs.
Next, if the total weight exceeds a certain limit, we can also change the cost to increase the additional cost. Therefore, for the basic costs of items between 1 to 5 kg, we set the additional charging options to £ 50. Next, we define the cost after the change in order to apply additional costs when the total weight of the shopping cart exceeding 5 kg. Therefore, if we apply this to the current settings:
For per kilogram of more than 5 kg thresholds, the plug -in will automatically increase the freight of £ 50. Finally, you can also set a threshold to limit the maximum freight of your store. If you don’t want to add restrictions on weight -based transportation, you can keep this field. Turn off the window by clicking any position on the page and clicking Save Changes
. This will preserve your rules. It should now be very suitable for your store items
How to operate based on weight -based transportation?
For the preview, we set the weight of this item to 5kg.
If we add this as a single product to a shopping cart, we should see our custom transportation options on the checkout page.
Now, let’s add a project to make the total weight 8kg, see how the cost changes according to our settings. (根据我们的运输规则,总成本应为50 英镑+ 50 英镑(每公斤超过5 公斤。)

[123 ]
In this way, you can set up a customized weight -based transportation rules in Woocommerce. These rules can easily and flexibly adapt to different weights and change the cost easily. It becomes very convenient, you can set different rules to cover different weight levels.
However, if you want to add weight based on the weight without a plug -in, you want to add weight based on the weight of WooCommerce. For transportation, you can also consider this. 2) How to add weight -based transportation based on programming To add weight -based custom transportation to WooCommerce, you can use
woocommerce linked
Add
Custom function
123 ], This function checks the total weight of the shopping cart, and then adds different freight to it.
However, this step is required to perform this step with
programming
. You need to complete some additional steps in advance.
Note: We will change some of the core documents of your website in this section. Therefore, it is best to backup your website and use one of the sub -theme plugins to create sub -themes. This will ensure that even if you have to update the theme or return to the previous changes, you will not lose any changes.
2.1. Add uniform rate and tracking uniform rate ID First, you need to create 3 separate freight. You can do this by clicking
woocommerce \u0026 gt; setting \u0026 gt; transportation
to do this. Then, click your transportation area and add 3 different weight costs. For our demonstration, we will add three unified freights based on specific weight conditions. These are: below 5 kg
5 kg of 5 kg.
10kg above
Now, continue to use
Check
- Tool track your
- unified rate ID
- Right -click the radio button of the
- to check.
]. Add the product to your shopping cart. By default, you should see all three unified freight on the checkout page.
transportation option, and then click
The Elements tab should show your transportation option
HTML/CSS attribute
.
Value field should display your Flat_rate ID. For example, for this transportation option, it shows Flat_rate: 3. This is the uniform rate ID of our \u0026 lt; 5 kg transportation.
For youHis freight is performed the same operation. Here we will use:
Flat_rate: 3
Flat_rate: 4 Flat_rate: 5 According Different uniform rates displayed Next, we will add the following
php code fragment
to the theme based on Flat_rate ID
functions.php
.
add_filter(\u0026#39;woocommerce_package_rates\u0026#39;, \u0026#39;quadlayers_woocommerce_tiered_shipping\u0026#39;, 9999, 2);功能quadlayers_woocommerce_tiered_shipping($rates,$package){if ( WC()-\u0026gt;cart -\u0026 gt; get_cart_contents_weight () \u0026 lt; 5) {if ($ raates [\u0026#39; flat_rate: 3 \u0026#39;])) Unable to set ($ raates [\u0026#39; 4 \u0026#39;], $ $ rates[\u0026#39;flat_rate:5\u0026#39;] );} elseif ( WC()-\u0026gt;cart-\u0026gt;get_cart_contents_weight() \u0026lt; 10 ) {if ( isset( $rates[\u0026#39;flat_rate:4\u0026 #39;])) Uncomfortable ($ Rates [\u0026#39; Flat_rate: 3 \u0026#39;], $ Rates [\u0026#39; Flat_rate: 5 \u0026#39;]);} [\u0026#39; Flat_rate: 5 \u0026#39;])) Unable to set ($ raates [\u0026#39; Flat_rate: 5 \u0026#39;], $ rate [\u0026#39; FLAT_Rate: 4 \u0026#39]); $ Rates;}
- This code only needs to use
- Check the total weight of your shopping cart. Keep in mind that the conditions in this code have a fixed ratio by checking the right of inspection and then setting a fixed ratioLead and then hide the rest. Therefore, in the first condition:
WC ()-\u0026 GT; CART- \u0026 GT; CART_CONTENTS_WEIGHT HOOK
if (wc ()-\u0026 gt; cart- \u0026 gt ; Get_cart_Contents_weight () \u0026 LT; 5) {if (ISSET ($ Rates [\u0026#39; Flat_rate: 3 \u0026#39;])) Unable to set ($ raates [\u0026#39; Flat_rate: 4 \u0026#39;], $ Rates [ \u0026#39; Flat_rate: 5 \u0026#39;]); Check whether the weight is less than 5kg, and then set Flat_rate: 3 and cancel the remaining unified rates according to ID. Please make sure that each of these unified rates is set according to your uniform rate ID, so that the code is suitable for your website.
You can also change the IF statement in the above code from 5 or 10 to the change condition check. For example, we can modify the code like this to check whether the weight of the cart is less than 50 kg, higher than 50 kg, less than 100 kg or more than kilograms.
2.2. Add the code to your functions.php file:
Continue and add it to the theme Functions.php
.
To access your functions.php file, please open your WordPress management instrument board and click appearance \u0026 gt; theme file editor . Then use the sidebar of the theme file on the right, click Functions.php.
Continue and add your code fragment to this code editor, and then click
to update the file
to save your changes.
Now, your freight should be changed according to your shopping cart weight, as shown below:
123] Reward: Forced sending details in WooCommerce:
Now, if you want to add more elements to the delivery process, it is best to ensure that your delivery form is more in line with customer needs. You can also choose to use
delivery address
, because WooCommerce only allows you to fill in selectively
Delivery form
. Of course, when you transport a lot of products, it will increase the difficulty of logistics, so you want to add or delete more fields to the delivery form. This is why you can also consider using a dedicated plug -in to define your transport meter and force the transport address and billing address on the checkout page.
If you need such measures, we strongly recommend that you use
WooCommerce Checkout Manager
. You can also customize and change your billing and fill in the form field, and even hide them or set them to optional, so that your website’s checkout experience is smoother.
Therefore, if you start installing plug -ins, please click
plug -in \u0026 gt; add new
on your
WordPress management
page. Use the search bar on the right to search for
WooCommerce Checkout Manager
, and then click
on the plug -in tab to install immediately
. After the button is changed, click to activate , which should activate the plug -in.
Next, click
WooCommerce \u0026 GT; Checkout Open your WOOCOMMERCE Checkout Manager
settings.
After that, you can switch the for mandatory delivery address options to . Now your customers will need to fill in the delivery details.
You can also choose to customize your transportation field in different ways. For this reason, please read this article to understand more information about this process. However, if you want to better understand the delivery address in Woocommerce, we also provide you with a perfect guide.
Conclusion:
This is how we add weight -based transportation guide to . The different parts of the custom WOOCOMMERCE checkout fee are the key part of the business profit business. Setting different costs based on your shopping cart weight can greatly help you manage your business and logistics costs. Our blog today covers multiple points in custom shipping and freight fields. This includes:
Use a plug -in to add weight -based transportation to WooCommerce.
Add to transportation based on different weightsAdd the uniform rate rate and apply them by programming. Forced delivery address and customize your delivery checkout form.
Now, there are multiple methods and plug -ins that can apply these measures to your website, but the general idea should be similar.However, if you have any questions, please tell us in the comments that we will solve it as soon as possible.
In addition, if you want to understand more information about custom WOOCOMMERCE stores and the overall experience of using it, why not check our other articles:
How to be in WoocommerceAdd delivery date
2022 Best Woocommerce request quotation plug -in
How to add the Woocommerce request quotation button