Adjust shipping rates based on product shipping class

This code snippet will help you to Adjust shipping rates based on product shipping class.

Add the following code to Appearance –> Editor –> functions.php.


In the above code snippet, for shipping class 13, the shipping price is adjusted by 10.

The shipping class can be got by going to Shipping class –>take mouse pointer to the respective shipping class –> right click –> click on inspect –> data-id contains the shipping class as shown below:

Element

Element

Price before adding snippet:

Cart without Code Snippet

Cart without Code Snippet

 

Price after adding snippet:

Cart with Code Snippet

Cart with Code Snippet

 

Leave a Reply