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
    1. Add the following code to your functions.php or any where relevant.
    2. 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 the unwanted service and select inspect. Check ‘value’ of shipping service to get the code for the service.
    3. Shipping Pro methods will be shown in the cart/checkout page, if the product belongs to the $shipping_class_ids array. There will be no service available in the cart/checkout page if the product does not belong to the $shipping_class_ids array.

The code is as given below:

Leave a Reply