How to add weight based delivery in woocommerce

If you want to unlock more additional functions, you can also use the advanced version of the plug-in. However, the plug-in must be uploaded and installed manually to activate. For more information, see the guide on how to manually install the word press plug-in. 1.2. After using the plug-in to enable the weight based shipping rule settings plug-in, open the woocommerce shipping settings in woocommerce > settings in the WordPress dashboard. Then open the shipping tab and click weight based shipping. You can now add custom delivery rules.
Male click Add distribution rule to start. Male then click \
Secondly, the total price of the shopping cart can be confirmed by using the total of the order part. This ensures that weight based distribution only applies to shopping cart totals within specific limits. If you do not want to check the subtotal of the shopping cart under weight based transportation conditions, you can keep this field. In the charges section, you can define the default charges for the current weight based transportation rule. First, set the default cost. Secondly, if the total weight exceeds a certain limit, the cost can also be changed to increase the additional cost. Therefore, for the basic cost of projects between 1kg and 5kg, please set the additional cost option to £ 50. Secondly, if the total shopping cart is more than 5kg, please define the changed fee to apply the additional fee. Therefore, if you apply it to the current settings:
The plug-in will automatically increase the distribution fee of £ 50 for all added kg exceeding the 5kg threshold. Finally, you can also set a threshold to limit the maximum freight of the store. You can keep this field if you do not want to add limits to weight based transportation. Click anywhere on the page, and then click save changes to close the window. This will save the rules and run perfectly in the store project. How does weight based delivery work? For preview, we set the weight of this single item to 5kg. After adding it to the shopping cart as a single item, the custom delivery option must be displayed on the settlement page.
Now let’s add an item with a total weight of 8kg and see what happens according to the setting cost. (according to our delivery regulations, the total cost is £ 50 + £ 50 (an increase of more than 5kg per kilogram).) This allows woocommerce to set customizable weight based shipping rules. This rule can be easily and flexibly applied to various weights and the cost can be easily changed. The plug-in makes it very convenient for you to configure and change rules during movement, and set other rules to include various weighting classes.
However, if you want to add weight based distribution in woocommerce, you can also consider adding it. Male 2) how to add weight based distribution programmatically? For custom weight based distribution in woocommerce, please use woocommerce hook to check the total basket weight, and then add it here
You can add custom functions and other freight charges. However, to perform this step programmatically, several additional steps must be performed in advance. Note: this section will change some core files of the website. Therefore, it is best to back up the website and create a sub theme using one of the sub theme plug-ins. In this way, changes are not lost even if the topic needs to be updated or returned to previous changes. 2.1. Before adding fixed charge and tracking fixed charge ID, 3 separate freight must be generated. Click woocommerce > Settings > shipping. Then click the delivery area to add 3 different weight charges. For demonstration, add 3 fixed freight rates according to specific weight conditions. These are: less than 5kg, more than 10kg. More than 10kg male now use the inspection tool to track the fixed fee ID. After adding items to the shopping cart, by default, the checkout page displays all 3 fixed fee distributions. Right click the radio button for the shipping option and click Check. The element tab must display the HTML \/ CSS attributes of the shipping option. The value field must display your flat_rate ID. For example, this shipping option is displayed as flat_rate: 3. This performs the same task for different freight rates. Here you will use: Fixed cost: 3 fixed cost: 4 fixed cost: 5 programming mode displays different fixed costs according to weight, followed by the theme function based on flat_rate ID. Add the following PHP code snippet to the PHP file: add_filter( ‘woocommerce_package_rates’, ‘quadlayers_woocommerce_tiered_shipping’, 9999, 2 );
Function four layers _woocomerce _tiered _shipping ($rates, $package){
If (wc() – > shopping cart – > get_cart_contents_weight() maleshopping cart – > get_cart_contents_weight() malecart – > cart_contents_weight hook, start by checking the total weight of the shopping cart. Remember that the condition of this code is to check the weight, then set a specific fixed fee, and the rest is hidden. Therefore, under the first condition, click: if (wc() – > shopping cart – > get_cart_contents_weight() maletheme file editor. Then use the correct theme file sidebar to implement functions. Click PHP. Continue adding code snippets to the code editor and click file update to save the changes. The current distribution fee changes according to the weight of the shopping cart as follows: Male bonus: woocommerce mandatory delivery details: if more elements are added in the delivery process now, it is better to further customize the delivery form according to the needs of customers. By default, woocommerce can only fill in the delivery form selectively, so it can also force the selection of delivery address. Of course, when delivering a large number of products that make logistics difficult, you may want to add or delete several fields on the distribution form. Therefore, you can also use the special plug-in to customize the delivery form and force the delivery address and billing address on the payment page. If these measures are required, it is recommended to use woocommerce checkout manager. You can also customize and change the billing and filling in form fields, hide them or set them as optional fields to make the checkout experience of the website smoother. So on the WordPress administration page, click plug ins > add new

Author:

Leave a Reply

Your email address will not be published. Required fields are marked *