WooCommerce Shipping Tutorial – The Ultimate Guide

  Table of Contents Introduction Shipping Rate Calculation WooCommerce Shipping Methods Overview Standard Shipping Methods Flat Rate Free Shipping Local Pickup Premium Shipping Methods API based shipping method User-defined shipping methods Custom shipping method Shipping Settings in WooCommerce WooCommerce Shipping Zones WooCommerce Shipping Options Flat Rate Free Shipping Local Pickup Shipping Classes in WooCommerce Creating Shipping Classes in WooCommerce Assigning Shipping Classes to Products in WooCommerce Example: Setting Flat Rate Shipping method for a Simple product which belongs to Gift Class [...]

A paradigm shift, from box packing to weight based shipping for easy goers!

Today, as a growing business, it is imperative to have a seamless experience of shipping your goods online. The box packing option is quite a powerful option if you are willing to put your head into the nitty-gritty of it. However, if you are more of a weight based person and want to get rid of the complex nature of dimensions and configuring boxes, then weight based parcel packing option is the best choice for you. Wait a minute? Are you [...]

Hide shipping method when free shipping is available

Enable WooCommerce default Free Shipping Method and use the below code snippet to hide shipping pro methods when free shipping is available. Add the following code to your functions.php or anywhere relevant. If you are looking for a plugin to do this job, visit ELEX Hide Shipping Methods Plugin. Using this plugin, You can easily hide shipping methods based on various conditions.

Showing a required Shipping Service

Code Snippet 01 - To show Shipping Pro methods when shipping class exist With the below given piece of code, you can show the Shipping Pro Methods(Services) if  the product of the particular shipping class is in cart. Steps to add Code Snippet Add the following code to your functions.php or any where relevant. You need to find out the service code for the service which you want to hide. To Find out Service code, navigate to Cart/Checkout page. Right click on [...]

Hiding/disabling a shipping service

Code Snippet 01 : Hide a shipping method for a particular Shipping Class in USPS Plugin With the below given piece of code, you can hide an unwanted shipping method(service) for the product(in cart) of the particular shipping class. Steps to add Code Snippet Add the following code to your functions.php or any where relevant. You need to add either shipping_class_ids  of the shipping class for which you want to hide the service. To Find out shipping_class_ids for your products , navigate to Products [...]

Alter request data while creating label

Code Snippet 01: Alter data of Create Label request in FedEx. The code gives flexibility to alter the value of existing nodes while triggering Create Label request. Add the following code to your functions.php or any where relevant. In the above code, $request contains request data which will be sent to FedEx while creating the label and $order parameter contains order data. This code is given for updating the phone number. PhoneNumber is changed to 123-123-1234 and request is returned. Note: We do not recommend Adding [...]

Split cart items from the same order and ship via multiple shipping methods

You can split and group cart items separately as different packages and can be shipped individually by using different shipping methods. These packages can be created by various  logical groupings of cart items, as like product vendor, product category,  cost etc. For detailed information about it, See WooCommerce: Split cart items from the same order and ship via multiple shipping methods. The Code is as given below:

Change the default cart Message ( no available shipping methods) message

The code facilitates you to change the default cart message - 'There are no shipping methods available. Please double check your address, or contact us if you need any help'.  With this code, you can customize the message according to your requirement. Add the following code to your functions.php or anywhere relevant. In the above code, assign customized message to $custom_msg. If $custom_msg message is empty, then  default message is returned otherwise $custom_msg returned by function. Customize Cart / Checkout Page "There [...]

Show / hide shipping methods based on order weight

After adding this code snippet, you can either show or hide the required services in the cart. It shows/hides the shipping methods based on the order weight. Add the following code to your functions.php or anywhere relevant. If you are looking for a plugin to do this job, visit ELEX Hide Shipping Methods Plugin. Using this plugin, You can easily hide shipping methods based on various conditions. In the above code, $order_weight stores the total weight of the order. Then it [...]

Hide shipping methods based on destination zip code

The code snippet facilitates you to hide specific shipping method(s) depending on destination zip code of an order. Add the following code to your functions.php or anywhere relevant. In the above code: - $available_shipping_methods contains all the available shipping methods for the carrier. - $postcode contains postcode of destination. - $hide_methods array contains the postcodes with corresponding services to be hidden. If $postcode matches with the postcode in $hide_methods, then assign services of corresponding postcode to $shipping_services_to_hide array. For the existing value of $shipping_services_to_hide, unset $available_shipping_methods and return it.