WooCommerce by default offers only a few basic options to decide the way shipping cost is calculated. In lot of cases these options may not be sufficient and you may require to create additional checkout fields based on which shipping cost calculations are to be done

Here are a few scenarios

  1. Distance based shipping costs. In some countries e.g. district/territory field is required to decide shipping cost.
  2. For some peculiar products you may want the buyer to agree to some terms before the purchase can be made and extra cost added accordingly.
  3. Extra handling cost based on the type of packing selected

Here are the steps to achieve such requirements

Step 1: Create the necessary extra checkout fields e.g. district .

Step 2: Create JQuery file to send the parameter as a checout parameter so that the necessary calculations can be made based on the custom checkout field update

Step 3: Peform calculation based on the custom checkout field and add the value to the session variable

Step 4: Retreive the value from the session variable and assing it to the shipping cost or add it to the cost




Leave a Reply

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